Skip to content

Commit

Permalink
feat(axis): add visibility to tick style (#374)
Browse files Browse the repository at this point in the history
Add visibility property to `tickLineStyle` in `Theme`. (default: `false`)

BREAKING CHANGE: `theme.axes.tickLineStyle.visible` is now required (default base is false)

closes #330
  • Loading branch information
nickofthyme authored Sep 19, 2019
1 parent 53a0fe0 commit 265a6bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/utils/themes/dark_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const DARK_THEME: Theme = {
padding: 1,
},
tickLineStyle: {
visible: true,
stroke: '#444',
strokeWidth: 1,
},
Expand Down
1 change: 1 addition & 0 deletions src/utils/themes/light_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const LIGHT_THEME: Theme = {
padding: 4,
},
tickLineStyle: {
visible: true,
stroke: '#eaeaea',
strokeWidth: 1,
},
Expand Down
5 changes: 4 additions & 1 deletion src/utils/themes/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export interface StrokeStyle {
/** The stroke width in pixel */
strokeWidth: number;
}

export type TickStyle = StrokeStyle & Visible;

export interface StrokeDashArray {
/** The dash array for dashed strokes */
dash: number[];
Expand All @@ -50,7 +53,7 @@ export interface AxisConfig {
axisTitleStyle: TextStyle;
axisLineStyle: StrokeStyle;
tickLabelStyle: TextStyle;
tickLineStyle: StrokeStyle;
tickLineStyle: TickStyle;
gridLineStyle: {
horizontal: GridLineConfig;
vertical: GridLineConfig;
Expand Down
1 change: 1 addition & 0 deletions stories/styling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ storiesOf('Stylings', module)
padding: number('tickLabelPadding', 1, {}, 'Tick Label'),
},
tickLineStyle: {
visible: boolean('showTicks', true, 'Tick Line'),
stroke: color('tickLineColor', '#333', 'Tick Line'),
strokeWidth: range('tickLineWidth', 0, 5, 1, 'Tick Line'),
},
Expand Down

0 comments on commit 265a6bb

Please sign in to comment.