{"id":16498747,"url":"https://github.com/kagol/calendar-graph","last_synced_at":"2025-03-21T08:30:56.065Z","repository":{"id":38467924,"uuid":"244095505","full_name":"kagol/calendar-graph","owner":"kagol","description":"生成指定的Github贡献图","archived":false,"fork":false,"pushed_at":"2023-01-07T22:02:28.000Z","size":676,"stargazers_count":8,"open_issues_count":27,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-17T22:45:40.538Z","etag":null,"topics":["angular","calendar-component","component","component-library","devui","frontend"],"latest_commit_sha":null,"homepage":"https://github.com/kagol/calendar-graph","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kagol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-01T05:55:35.000Z","updated_at":"2023-03-17T09:07:08.000Z","dependencies_parsed_at":"2023-02-08T02:32:55.404Z","dependency_job_id":null,"html_url":"https://github.com/kagol/calendar-graph","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagol%2Fcalendar-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagol%2Fcalendar-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagol%2Fcalendar-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagol%2Fcalendar-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kagol","download_url":"https://codeload.github.com/kagol/calendar-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244764752,"owners_count":20506696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","calendar-component","component","component-library","devui","frontend"],"created_at":"2024-10-11T14:49:56.359Z","updated_at":"2025-03-21T08:30:55.167Z","avatar_url":"https://github.com/kagol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calendar Graph\n\n生成自定义的Github提交图。\n\n## 快速开始\n\n``` html\n\u003cd-calendar-graph text=\"❤ DevUI\"\u003e\u003c/d-calendar-graph\u003e\n```\n\n## 支持的字母和符号\n\nA-Za-z0-9❤️\n\n## API\n\n### date\n\n自定义日期区间\n\n``` javascript\nconst date = '2020-06-01';\nconst date = ['2020-06-01'];\nconst date = ['2020-06-01', '2020-11-03'];\n```\n\n### text\n\n自定义显示文本\n\n``` javascript\nconst text = '❤ DevUI';\nconst text = 'DevUI is excellent';\nconst text = 'Today is 20201103';\n```\n\n### dataSource\n\n1. 更灵活的配置\n\n``` javascript\nconst dataSource = transpose([\n  // I\n  [ 1, 1, 1, 1, 1, 1, 1 ],\n\n  [ 0, 0, 0, 0, 0, 0, 0 ],\n  [ 0, 0, 0, 0, 0, 0, 0 ],\n  \n  // a\n  [ 0, 1, 0, 0, 1, 0, 0 ],\n  [ 0, 1, 0, 1, 0, 1, 0 ],\n  [ 0, 1, 0, 1, 0, 1, 0 ],\n  [ 0, 0, 1, 1, 1, 1, 0 ],\n\n  [ 0, 0, 0, 0, 0, 0, 0 ],\n\n  // m\n  [ 0, 1, 1, 1, 1, 1, 0 ],\n  [ 0, 1, 0, 0, 0, 0, 0 ],\n  [ 0, 1, 0, 0, 0, 0, 0 ],\n  [ 0, 1, 1, 1, 1, 1, 0 ],\n  [ 0, 1, 0, 0, 0, 0, 0 ],\n  [ 0, 1, 0, 0, 0, 0, 0 ],\n  [ 0, 0, 1, 1, 1, 1, 0 ],\n\n  [ 0, 0, 0, 0, 0, 0, 0 ],\n  \n  [ 0, 0, 0, 0, 0, 0, 0 ],\n\n  // K\n  [ 1, 1, 1, 1, 1, 1, 1 ],\n  [ 0, 0, 0, 1, 0, 0, 0 ],\n  [ 0, 0, 0, 1, 0, 0, 0 ],\n  [ 0, 0, 1, 0, 1, 0, 0 ],\n  [ 1, 1, 0, 0, 0, 1, 1 ],\n  \n  [ 0, 0, 0, 0, 0, 0, 0 ],\n\n  // a\n  [ 0, 1, 0, 0, 1, 0, 0 ],\n  [ 0, 1, 0, 1, 0, 1, 0 ],\n  [ 0, 1, 0, 1, 0, 1, 0 ],\n  [ 0, 0, 1, 1, 1, 1, 0 ],\n  \n  [ 0, 0, 0, 0, 0, 0, 0 ],\n\n  // g\n  [ 0, 1, 1, 1, 0, 0, 1 ],\n  [ 1, 0, 0, 0, 1, 0, 1 ],\n  [ 1, 0, 0, 0, 1, 0, 1 ],\n  [ 1, 1, 1, 1, 1, 1, 0 ],\n  \n  [ 0, 0, 0, 0, 0, 0, 0 ],\n\n  // o\n  [ 0, 0, 1, 1, 1, 0, 0 ],\n  [ 0, 1, 0, 0, 0, 1, 0 ],\n  [ 0, 1, 0, 0, 0, 1, 0 ],\n  [ 0, 0, 1, 1, 1, 0, 0 ],\n  \n  [ 0, 0, 0, 0, 0, 0, 0 ],\n\n  // l\n  [ 1, 1, 1, 1, 1, 1, 0 ],\n\n])\n```\n\n2. 也可以使用定义好的字符变量\n\n``` javascript\nconst dataSource = [].concat(\n  LETTER_I, EMPTY_WEEK, EMPTY_WEEK,\n  LETTER_a, EMPTY_WEEK, LETTER_m, EMPTY_WEEK, EMPTY_WEEK,\n  LETTER_K, EMPTY_WEEK, LETTER_a, EMPTY_WEEK, LETTER_g, EMPTY_WEEK, LETTER_o, EMPTY_WEEK, LETTER_l\n);\n```\n\n### schedule\n\n这是一个boolean类型的参数，用于打印提交日程，默认值为false，即不打印提交日程。\n\n提交日程的格式是：\n\n您需要在X年X月X日，提交X次代码。\n\n只要按照日程规定的日期进行Github代码提交，即可在你的Github提交日历图上画出想要的图形，快试试吧！\n\n### theme\n\n``` javascript\n类型 string ｜ string[] | object\n```\n\n自定义主题\n\n默认主题 [ '#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127' ];\n\n案例\n\n``` html\n\u003cd-calendar-graph text=\"DevUI is excellent\" theme=\"halloween\"\u003e\u003c/d-calendar-graph\u003e\n\n\u003cd-calendar-graph text=\"DevUI is excellent\" theme=\"#7F7FF0\"\u003e\u003c/d-calendar-graph\u003e\n\n\u003cd-calendar-graph text=\"DevUI is excellent\" [theme]=\"['#d8e9f2', '#fdde8a', '#fa9e59', '#e55648', '#ae1345']\"\u003e\u003c/d-calendar-graph\u003e\n\n\u003cd-calendar-graph text=\"DevUI is excellent\" [theme]=\"{\n  source: [0, 10, 20, 30, 40],\n  target: ['#d8e9f2', '#f57647', '#ee6544', '#e55648', '#db484c']\n}\"\u003e\u003c/d-calendar-graph\u003e\n\n\u003cd-calendar-graph text=\"DevUI is excellent\" [theme]=\"{\n  '0': '#d8e9f2',\n  '5': '#fbe793',\n  '10': '#fdcf7d',\n  '20': '#fdb163',\n  '50': '#f88a50',\n  '100': '#ee6544',\n  '200': '#db484c',\n  '500': '#bf2649',\n  '1000': '#9e0142'\n}\"\u003e\u003c/d-calendar-graph\u003e\n```\n\n## 栗子🌰\n\n❤️ DevUI\n\n[❤️ DevUI](src/assets/lovedevui.png)\n\nDevUI is excellent\n\n[DevUI is excellent](src/assets/devui-excellent.png)\n\n## TODO\n\n- 解析多种格式的theme\n  - 主题名称，如：'halloween'\n  - 基本色，如：'#7F7FF0'\n  - 颜色数组，如：[ '#e55648', ... ]\n  - 阶梯查找表，如：{ source: [], target: [] }\n  - 数值/颜色映射表，如：{ 10: '#fdcf7d', ... }\n\n- 完善提交日历\n- 完善Tooltip显示内容\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagol%2Fcalendar-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkagol%2Fcalendar-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagol%2Fcalendar-graph/lists"}