Skip to content

Commit

Permalink
Remove default color from color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
drewdaemon committed Dec 2, 2021
1 parent a02d1e2 commit a8f84dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { uniq, mapValues } from 'lodash';
import type { PaletteOutput, PaletteRegistry } from 'src/plugins/charts/public';
import type { Datatable } from 'src/plugins/expressions';
import { euiLightVars } from '@kbn/ui-shared-deps-src/theme';
import { LIGHT_THEME } from '@elastic/charts';
import type { AccessorConfig, FramePublicAPI } from '../types';
import { getColumnToLabelMap } from './state_helpers';
import { FormatFactory, LayerType, layerTypes } from '../../common';
Expand All @@ -26,11 +25,6 @@ interface LayerColorConfig {
}

export const defaultReferenceLineColor = euiLightVars.euiColorDarkShade;
export const {
axes: {
axisLine: { stroke: defaultAxisLineColor },
},
} = LIGHT_THEME;

export type ColorAssignments = Record<
string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('Axes Settings', () => {
describe('manipulating axis color', () => {
it('starts on default axis color', () => {
const component = shallow(<AxisSettingsPopover {...props} />);
expect(component.find(EuiColorPicker).prop('color')).toBe(defaultAxisLineColor);
expect(component.find(EuiColorPicker).prop('color')).toBeUndefined();
});

it('reports a new color choice', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { EuiIconAxisRight } from '../../assets/axis_right';
import { EuiIconAxisTop } from '../../assets/axis_top';
import { ToolbarButtonProps } from '../../../../../../src/plugins/kibana_react/public';
import { validateExtent } from '../axes_configuration';
import { defaultAxisLineColor } from '../color_assignment';

type AxesSettingsConfigKeys = keyof AxesSettingsConfig;

Expand Down Expand Up @@ -322,7 +321,10 @@ export const AxisSettingsPopover: React.FunctionComponent<AxisSettingsPopoverPro
compressed
isClearable={true}
onChange={(newColor) => updateColor(axis, newColor)}
color={color || defaultAxisLineColor}
placeholder={i18n.translate('xpack.lens.xyChart.axisColor.auto', {
defaultMessage: 'Auto',
})}
color={color}
aria-label={axisColorLabel}
/>
</EuiFormRow>
Expand Down

0 comments on commit a8f84dd

Please sign in to comment.