Commit a94c2565 by Dominik Prokop Committed by GitHub

GraphNG: remove y-axis position control from series color picker in the legend (#30302)

parent c14c7b68
......@@ -12,11 +12,9 @@ export interface SeriesColorPickerPopoverProps extends ColorPickerProps, Popover
export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopoverProps> = props => {
const { yaxis, onToggleAxis, color, ...colorPickerProps } = props;
return (
<ColorPickerPopover
{...colorPickerProps}
color={color || '#000000'}
customPickers={{
const customPickers = onToggleAxis
? {
yaxis: {
name: 'Y-Axis',
tabComponent() {
......@@ -36,9 +34,9 @@ export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopove
);
},
},
}}
/>
);
}
: undefined;
return <ColorPickerPopover {...colorPickerProps} color={color || '#000000'} customPickers={customPickers} />;
};
interface AxisSelectorProps {
......
......@@ -27,7 +27,6 @@ export const VizLegendListItem: React.FunctionComponent<Props> = ({ item, onSeri
onSeriesColorChange(item.label, color);
}
}}
yAxis={item.yAxis}
/>
<div
onClick={event => {
......
......@@ -5,28 +5,14 @@ import { SeriesIcon } from './SeriesIcon';
interface Props {
disabled: boolean;
color: string;
yAxis: number;
onColorChange: (color: string) => void;
onToggleAxis?: () => void;
}
export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({
disabled,
yAxis,
color,
onColorChange,
onToggleAxis,
}) => {
export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({ disabled, color, onColorChange }) => {
return disabled ? (
<SeriesIcon color={color} />
) : (
<SeriesColorPicker
yaxis={yAxis}
color={color}
onChange={onColorChange}
onToggleAxis={onToggleAxis}
enableNamedColors
>
<SeriesColorPicker color={color} onChange={onColorChange} enableNamedColors>
{({ ref, showColorPicker, hideColorPicker }) => (
<SeriesIcon
color={color}
......
......@@ -35,7 +35,6 @@ export const LegendTableItem: React.FunctionComponent<Props> = ({
onSeriesColorChange(item.label, color);
}
}}
yAxis={item.yAxis}
/>
<div
onClick={event => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment