Skip to content

Commit 265a6bb

Browse files
authored
feat(axis): add visibility to tick style (#374)
Add visibility property to `tickLineStyle` in `Theme`. (default: `false`) BREAKING CHANGE: `theme.axes.tickLineStyle.visible` is now required (default base is false) closes #330
1 parent 53a0fe0 commit 265a6bb

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

src/utils/themes/dark_theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export const DARK_THEME: Theme = {
8686
padding: 1,
8787
},
8888
tickLineStyle: {
89+
visible: true,
8990
stroke: '#444',
9091
strokeWidth: 1,
9192
},

src/utils/themes/light_theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const LIGHT_THEME: Theme = {
8585
padding: 4,
8686
},
8787
tickLineStyle: {
88+
visible: true,
8889
stroke: '#eaeaea',
8990
strokeWidth: 1,
9091
},

src/utils/themes/theme.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export interface StrokeStyle {
3333
/** The stroke width in pixel */
3434
strokeWidth: number;
3535
}
36+
37+
export type TickStyle = StrokeStyle & Visible;
38+
3639
export interface StrokeDashArray {
3740
/** The dash array for dashed strokes */
3841
dash: number[];
@@ -50,7 +53,7 @@ export interface AxisConfig {
5053
axisTitleStyle: TextStyle;
5154
axisLineStyle: StrokeStyle;
5255
tickLabelStyle: TextStyle;
53-
tickLineStyle: StrokeStyle;
56+
tickLineStyle: TickStyle;
5457
gridLineStyle: {
5558
horizontal: GridLineConfig;
5659
vertical: GridLineConfig;

stories/styling.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ storiesOf('Stylings', module)
262262
padding: number('tickLabelPadding', 1, {}, 'Tick Label'),
263263
},
264264
tickLineStyle: {
265+
visible: boolean('showTicks', true, 'Tick Line'),
265266
stroke: color('tickLineColor', '#333', 'Tick Line'),
266267
strokeWidth: range('tickLineWidth', 0, 5, 1, 'Tick Line'),
267268
},

0 commit comments

Comments
 (0)