diff --git a/packages/grafana-data/src/dataframe/frameComparisons.ts b/packages/grafana-data/src/dataframe/frameComparisons.ts index 218b9694883..478bbbfff37 100644 --- a/packages/grafana-data/src/dataframe/frameComparisons.ts +++ b/packages/grafana-data/src/dataframe/frameComparisons.ts @@ -9,7 +9,7 @@ import { DataFrame } from '../types/dataFrame'; * compareArrayValues(a, b, framesHaveSameStructure); * ``` * NOTE: this does a shallow check on the FieldConfig properties, when using the query - * editor, this should be sufficient, however if applicaitons are mutating properties + * editor, this should be sufficient, however if applications are mutating properties * deep in the FieldConfig this will not recognize a change * * @beta diff --git a/packages/grafana-ui/src/components/uPlot/Plot.tsx b/packages/grafana-ui/src/components/uPlot/Plot.tsx index 16e1d3d0c73..685b5939925 100755 --- a/packages/grafana-ui/src/components/uPlot/Plot.tsx +++ b/packages/grafana-ui/src/components/uPlot/Plot.tsx @@ -1,7 +1,7 @@ import React, { createRef, MutableRefObject } from 'react'; import uPlot, { Options } from 'uplot'; import { PlotContext, PlotContextType } from './context'; -import { DEFAULT_PLOT_CONFIG } from './utils'; +import { DEFAULT_PLOT_CONFIG, pluginLog } from './utils'; import { PlotProps } from './types'; function sameDims(prevProps: PlotProps, nextProps: PlotProps) { @@ -73,6 +73,7 @@ export class UPlotChart extends React.Component { ...this.props.config.getConfig(), }; + pluginLog('UPlot', false, 'Reinitializing plot'); const plot = new uPlot(config, this.props.data, this.plotContainer!.current!); if (plotRef) { diff --git a/packages/grafana-ui/src/components/uPlot/utils.ts b/packages/grafana-ui/src/components/uPlot/utils.ts index 12dbff7ab46..a738de8dfcd 100755 --- a/packages/grafana-ui/src/components/uPlot/utils.ts +++ b/packages/grafana-ui/src/components/uPlot/utils.ts @@ -156,7 +156,7 @@ export function findMidPointYPosition(u: uPlot, idx: number) { // Dev helpers /** @internal */ -export const pluginLogger = createLogger('uPlot Plugin'); +export const pluginLogger = createLogger('uPlot'); export const pluginLog = pluginLogger.logger; // pluginLogger.enable(); attachDebugger('graphng', undefined, pluginLogger); diff --git a/public/app/plugins/panel/timeseries/ThresholdsStyleEditor.tsx b/public/app/plugins/panel/timeseries/ThresholdsStyleEditor.tsx new file mode 100644 index 00000000000..41173185b9c --- /dev/null +++ b/public/app/plugins/panel/timeseries/ThresholdsStyleEditor.tsx @@ -0,0 +1,18 @@ +import React, { useCallback } from 'react'; +import { FieldOverrideEditorProps, SelectableValue } from '@grafana/data'; +import { GraphTresholdsStyleMode, Select } from '@grafana/ui'; + +export const ThresholdsStyleEditor: React.FC< + FieldOverrideEditorProps, any> +> = ({ item, value, onChange }) => { + console.log(value); + const onChangeCb = useCallback( + (v: SelectableValue) => { + onChange({ + mode: v.value, + }); + }, + [onChange] + ); + return