Skip to content

Commit 993b707

Browse files
committed
feat: hide grid by setting it to false; closes: #212
1 parent e75e73e commit 993b707

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Customize the appearance of your Activity Graph however you want with URL params
104104
| `days` | number of to days display on graph | number between (1 - 90) [Recommended below 40] |
105105
| `from` | date from which the graph starts | format `YYYY-MM-DD` |
106106
| `to` | date where the graph will end | format `YYYY-MM-DD` |
107+
| `grid` | show grid | boolean (default: `true`) |
107108

108109
**For `custom_title` please make sure that you are using %20 for spaces**
109110

src/GraphCards.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export class Card {
99
private readonly radius: number,
1010
private readonly colors: Colors,
1111
private readonly title = '',
12-
private readonly area = false
12+
private readonly area = false,
13+
private readonly showGrid = true
1314
) {}
1415

1516
private getOptions() {
@@ -24,13 +25,15 @@ export class Card {
2425
y: 4.5,
2526
},
2627
low: 0,
28+
showGrid: this.showGrid,
2729
},
2830
axisX: {
2931
title: 'Days',
3032
offset: 50,
3133
labelOffset: {
3234
x: -4.5,
3335
},
36+
showGrid: this.showGrid,
3437
},
3538
chartPadding: {
3639
top: 80,

src/interfaces/interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class QueryOption {
2121
custom_title?: string;
2222
from?: string;
2323
to?: string;
24+
grid: boolean;
2425
colors: Colors;
2526
area: boolean;
2627
radius: number;
@@ -46,6 +47,7 @@ export class ParsedQs {
4647
days?: string;
4748
from?: string;
4849
to?: string;
50+
grid?: string;
4951
}
5052

5153
export class GraphArgs {

src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export class Utilities {
119119
? Math.min(Math.max(this.queryString.height, 200), 600)
120120
: 420, // Custom height implementation from range [200, 600], if not specified use default value - 420
121121
days: isFromValid && isToValid ? days : this.validateDays(this.queryString.days),
122+
grid: this.queryString.grid === 'false' ? false : true,
122123
from,
123124
to,
124125
};
@@ -150,7 +151,8 @@ export class Utilities {
150151
options.radius,
151152
options.colors,
152153
title,
153-
options.area
154+
options.area,
155+
options.grid
154156
);
155157
const getChart = await graph.buildGraph(fetchCalendarData.contributions);
156158
return {

0 commit comments

Comments
 (0)