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 ...@@ -12,11 +12,9 @@ export interface SeriesColorPickerPopoverProps extends ColorPickerProps, Popover
export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopoverProps> = props => { export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopoverProps> = props => {
const { yaxis, onToggleAxis, color, ...colorPickerProps } = props; const { yaxis, onToggleAxis, color, ...colorPickerProps } = props;
return (
<ColorPickerPopover const customPickers = onToggleAxis
{...colorPickerProps} ? {
color={color || '#000000'}
customPickers={{
yaxis: { yaxis: {
name: 'Y-Axis', name: 'Y-Axis',
tabComponent() { tabComponent() {
...@@ -36,9 +34,9 @@ export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopove ...@@ -36,9 +34,9 @@ export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopove
); );
}, },
}, },
}} }
/> : undefined;
); return <ColorPickerPopover {...colorPickerProps} color={color || '#000000'} customPickers={customPickers} />;
}; };
interface AxisSelectorProps { interface AxisSelectorProps {
......
...@@ -27,7 +27,6 @@ export const VizLegendListItem: React.FunctionComponent<Props> = ({ item, onSeri ...@@ -27,7 +27,6 @@ export const VizLegendListItem: React.FunctionComponent<Props> = ({ item, onSeri
onSeriesColorChange(item.label, color); onSeriesColorChange(item.label, color);
} }
}} }}
yAxis={item.yAxis}
/> />
<div <div
onClick={event => { onClick={event => {
......
...@@ -5,28 +5,14 @@ import { SeriesIcon } from './SeriesIcon'; ...@@ -5,28 +5,14 @@ import { SeriesIcon } from './SeriesIcon';
interface Props { interface Props {
disabled: boolean; disabled: boolean;
color: string; color: string;
yAxis: number;
onColorChange: (color: string) => void; onColorChange: (color: string) => void;
onToggleAxis?: () => void;
} }
export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({ export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({ disabled, color, onColorChange }) => {
disabled,
yAxis,
color,
onColorChange,
onToggleAxis,
}) => {
return disabled ? ( return disabled ? (
<SeriesIcon color={color} /> <SeriesIcon color={color} />
) : ( ) : (
<SeriesColorPicker <SeriesColorPicker color={color} onChange={onColorChange} enableNamedColors>
yaxis={yAxis}
color={color}
onChange={onColorChange}
onToggleAxis={onToggleAxis}
enableNamedColors
>
{({ ref, showColorPicker, hideColorPicker }) => ( {({ ref, showColorPicker, hideColorPicker }) => (
<SeriesIcon <SeriesIcon
color={color} color={color}
......
...@@ -35,7 +35,6 @@ export const LegendTableItem: React.FunctionComponent<Props> = ({ ...@@ -35,7 +35,6 @@ export const LegendTableItem: React.FunctionComponent<Props> = ({
onSeriesColorChange(item.label, color); onSeriesColorChange(item.label, color);
} }
}} }}
yAxis={item.yAxis}
/> />
<div <div
onClick={event => { 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