diff --git a/src/components/fields/derived.js b/src/components/fields/derived.js index cdeb5a36b..78dd465d8 100644 --- a/src/components/fields/derived.js +++ b/src/components/fields/derived.js @@ -482,6 +482,23 @@ export const TextPosition = connectToContainer(UnconnectedDropdown, { }, }); +export const TextInfo = connectToContainer(UnconnectedFlaglist, { + modifyPlotProps: (props, context, plotProps) => { + const {localize: _, container} = context; + const options = [ + {label: _('Label'), value: 'label'}, + {label: _('Value'), value: 'value'}, + {label: _('%'), value: 'percent'}, + ]; + + if (container.text) { + options.push({label: _('Text'), value: 'text'}); + } + + plotProps.options = options; + }, +}); + export const HoverInfo = connectToContainer(UnconnectedFlaglist, { modifyPlotProps: (props, context, plotProps) => { const {localize: _, container} = context; diff --git a/src/default_panels/StyleTracesPanel.js b/src/default_panels/StyleTracesPanel.js index 2a5d210a1..f91fc5497 100644 --- a/src/default_panels/StyleTracesPanel.js +++ b/src/default_panels/StyleTracesPanel.js @@ -35,6 +35,7 @@ import { BinningDropdown, NumericReciprocal, ShowInLegend, + TextInfo, } from '../components/fields/derived'; const StyleTracesPanel = (props, {localize: _}) => ( @@ -94,17 +95,6 @@ const StyleTracesPanel = (props, {localize: _}) => ( /> - - - @@ -346,6 +336,9 @@ const StyleTracesPanel = (props, {localize: _}) => ( + + +