Skip to content

Commit

Permalink
refactor: change config prop name to show vs enable
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 committed Mar 17, 2020
1 parent 55bf6ee commit 6ba6751
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/chart_types/xy_chart/utils/axis_utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ describe('Axis computational utils', () => {
const axisSpec: AxisSpec = {
id: 'bottom',
position: 'bottom',
enableDuplicatedTicks: false,
showDuplicatedTicks: false,
chartType: 'xy_axis',
specType: 'axis',
groupId: '__global__',
Expand Down Expand Up @@ -1489,7 +1489,7 @@ describe('Axis computational utils', () => {
const axisSpec: AxisSpec = {
id: 'bottom',
position: 'bottom',
enableDuplicatedTicks: true,
showDuplicatedTicks: true,
chartType: 'xy_axis',
specType: 'axis',
groupId: '__global__',
Expand Down
2 changes: 1 addition & 1 deletion src/chart_types/xy_chart/utils/axis_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ export function enableDuplicatedTicks(
};
});

if (axisSpec.enableDuplicatedTicks === true) {
if (axisSpec.showDuplicatedTicks === true) {
return allTicks;
}

Expand Down
2 changes: 1 addition & 1 deletion src/chart_types/xy_chart/utils/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export interface AxisSpec extends Spec {
/** Show only integar values **/
integersOnly?: boolean;
/** Remove duplicate ticks, default is false*/
enableDuplicatedTicks?: boolean;
showDuplicatedTicks?: boolean;
}

export type TickFormatterOptions = {
Expand Down
7 changes: 1 addition & 6 deletions stories/line/10_duplicate_ticks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ export const example = () => {
const duplicateTicksInAxis = boolean('Show duplicate ticks in x axis', false);
return (
<Chart className="story-chart">
<Axis
id="bottom"
position={Position.Bottom}
tickFormat={formatter}
enableDuplicatedTicks={duplicateTicksInAxis}
/>
<Axis id="bottom" position={Position.Bottom} tickFormat={formatter} showDuplicatedTicks={duplicateTicksInAxis} />
<Axis
id="left"
title={KIBANA_METRICS.metrics.kibana_os_load[0].metric.title}
Expand Down

0 comments on commit 6ba6751

Please sign in to comment.