diff --git a/README.md b/README.md index d9383355..32235fba 100644 --- a/README.md +++ b/README.md @@ -20,25 +20,25 @@ Please refer to the updated link [here](#how-to-use) ## Table of contents -- [Table of contents](#table-of-contents) -- [How to Use](#how-to-use) - - [Attention ⚠](#attention-) -- [Use themes](#use-themes) -- [Available Themes](#available-themes) -- [Customization](#customization) - - [Common Options](#common-options) -- [Deploy on your own Replit instance](#deploy-on-your-own-replit-instance) - - [Follow the steps](#follow-the-steps) -- [Deploy on your own Vercel instance](#deploy-on-your-own-vercel-instance) - - [First Method](#first-method) - - [Second Method](#second-method) - - [Finally](#finally) -- [Contributing](#contributing) -- [Core Team 💻](#core-team-) -- [Contributors ✨](#contributors-) -- [Resources Used to build this project](#resources-used-to-build-this-project) -- [Star History](#star-history) - - [Made with ❤ and TypeScript ](#made-with--and-typescript-) +- [Table of contents](#table-of-contents) +- [How to Use](#how-to-use) + - [Attention ⚠](#attention-) +- [Use themes](#use-themes) +- [Available Themes](#available-themes) +- [Customization](#customization) + - [Common Options](#common-options) +- [Deploy on your own Replit instance](#deploy-on-your-own-replit-instance) + - [Follow the steps](#follow-the-steps) +- [Deploy on your own Vercel instance](#deploy-on-your-own-vercel-instance) + - [First Method](#first-method) + - [Second Method](#second-method) + - [Finally](#finally) +- [Contributing](#contributing) +- [Core Team 💻](#core-team-) +- [Contributors ✨](#contributors-) +- [Resources Used to build this project](#resources-used-to-build-this-project) +- [Star History](#star-history) + - [Made with ❤ and TypeScript ](#made-with--and-typescript-) ## How to Use @@ -89,6 +89,7 @@ Customize the appearance of your Activity Graph however you want with URL params | Arguments | Description | Type of Value | | :------------: | :-------------------------------------------: | :--------------------------------------------: | | `bg_color` | card's background color | hex code (without `#`) | +| `border_color` | card's border color | hex code (without `#`) | | `color` | graph card's text color | hex code (without `#`) | | `title_color` | graph card's title color | hex code (without `#`) | | `line` | graph's line color | hex code (without `#`) | @@ -119,7 +120,7 @@ Example: **Example:** ```md -[![Ashutosh's github activity graph](https://github-readme-activity-graph.vercel.app/graph?username=ashutosh00710&bg_color=fffff0&color=708090&line=24292e&point=24292e&area=true&hide_border=true)](https://github.com/ashutosh00710/github-readme-activity-graph) +[![Ashutosh's github activity graph](https://github-readme-activity-graph.vercel.app/graph?username=ashutosh00710&bg_color=fffff0&color=708090&line=24292e&point=24292e&area=true&border_color=ff0000)](https://github.com/ashutosh00710/github-readme-activity-graph) ``` ## Deploy on your own Replit instance diff --git a/__test__/fakeInputs.ts b/__test__/fakeInputs.ts index f18b193e..3346aec1 100644 --- a/__test__/fakeInputs.ts +++ b/__test__/fakeInputs.ts @@ -85,6 +85,17 @@ export let fakeQueryString = [ hide_border: true, custom_title: 'some title', }, + { + username: 'githubusername', + bg_color: '44475a', + border_color: 'ff0000', + color: 'f8f8f2', + line: 'ff79c6', + point: 'bd93f9', + area: true, + hide_title: false, + custom_title: undefined, + }, ]; export let fakeQueryStringRes = [ @@ -269,6 +280,26 @@ export let fakeQueryStringRes = [ to: '', grid: true, }, + { + username: 'githubusername', + radius: 0, + height: 420, + colors: { + areaColor: '9e4c98', + bgColor: '44475a', + borderColor: 'ff0000', + color: 'f8f8f2', + titleColor: 'f8f8f2', + lineColor: 'ff79c6', + pointColor: 'bd93f9', + }, + area: true, + hide_title: false, + days: 31, + from: '', + to: '', + grid: true, + }, ]; export let fakeGraphArgs: GraphArgs = { diff --git a/__test__/mockFunctions.ts b/__test__/mockFunctions.ts index 8416f521..9316f764 100644 --- a/__test__/mockFunctions.ts +++ b/__test__/mockFunctions.ts @@ -25,7 +25,7 @@ export const mockFetchCorrect = jest.fn().mockReturnValue( }, }, }, - }) + }), ); //For invalid username diff --git a/__test__/svgs.test.ts b/__test__/svgs.test.ts index 6ca11c38..52052f62 100644 --- a/__test__/svgs.test.ts +++ b/__test__/svgs.test.ts @@ -23,7 +23,7 @@ describe('SVG Testing', () => { fakeQueryStringRes[0].radius, fakeQueryStringRes[0].colors, "xyz's Contribution Graph", - fakeQueryStringRes[0].area + fakeQueryStringRes[0].area, ).buildGraph([ { contributionCount: 2, @@ -45,7 +45,7 @@ describe('SVG Testing', () => { contributionCount: 14, date: '1', }, - ]) + ]), ).toMatchSnapshot(); }); }); diff --git a/src/GraphCards.ts b/src/GraphCards.ts index ae39f15f..da044772 100644 --- a/src/GraphCards.ts +++ b/src/GraphCards.ts @@ -10,7 +10,7 @@ export class Card { private readonly colors: Colors, private readonly title = '', private readonly area = false, - private readonly showGrid = true + private readonly showGrid = true, ) {} private getOptions() { diff --git a/src/handlers.ts b/src/handlers.ts index 1b14990c..e10d4891 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -18,7 +18,7 @@ export class Handlers { const fetchCalendarData = await fetcher.fetchContributions( utils.queryOptions().days, queryOptions.from, - queryOptions.to + queryOptions.to, ); const { finalGraph, header } = await utils.buildGraph(fetchCalendarData); @@ -38,7 +38,7 @@ export class Handlers { const fetcher = new Fetcher(utils.username); const fetchCalendarData: UserDetails | string = await fetcher.fetchContributions( - utils.queryOptions().days + utils.queryOptions().days, ); if (typeof fetchCalendarData === 'object') { diff --git a/src/interfaces/interface.ts b/src/interfaces/interface.ts index 402e8803..d0dbece5 100644 --- a/src/interfaces/interface.ts +++ b/src/interfaces/interface.ts @@ -34,6 +34,7 @@ export class ParsedQs { hide_title?: boolean; custom_title?: string; bg_color?: string; + border_color?: string; hide_border?: boolean; area_color?: string; color?: string; diff --git a/src/svgs.ts b/src/svgs.ts index b83e3d16..0b585197 100644 --- a/src/svgs.ts +++ b/src/svgs.ts @@ -12,8 +12,8 @@ export const graphSvg = (props: GraphArgs) => ` + props.colors.borderColor + }; stroke-width:1;"/>