1 Star 0 Fork 0

Kagol / calendar-graph

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Calendar Graph

生成自定义的Github提交图。

快速开始

<d-calendar-graph text="❤ DevUI"></d-calendar-graph>

支持的字母和符号

A-Za-z0-9❤️

API

date

自定义日期区间

const date = '2020-06-01';
const date = ['2020-06-01'];
const date = ['2020-06-01', '2020-11-03'];

text

自定义显示文本

const text = '❤ DevUI';
const text = 'DevUI is excellent';
const text = 'Today is 20201103';

dataSource

  1. 更灵活的配置
const dataSource = transpose([
  // I
  [ 1, 1, 1, 1, 1, 1, 1 ],

  [ 0, 0, 0, 0, 0, 0, 0 ],
  [ 0, 0, 0, 0, 0, 0, 0 ],
  
  // a
  [ 0, 1, 0, 0, 1, 0, 0 ],
  [ 0, 1, 0, 1, 0, 1, 0 ],
  [ 0, 1, 0, 1, 0, 1, 0 ],
  [ 0, 0, 1, 1, 1, 1, 0 ],

  [ 0, 0, 0, 0, 0, 0, 0 ],

  // m
  [ 0, 1, 1, 1, 1, 1, 0 ],
  [ 0, 1, 0, 0, 0, 0, 0 ],
  [ 0, 1, 0, 0, 0, 0, 0 ],
  [ 0, 1, 1, 1, 1, 1, 0 ],
  [ 0, 1, 0, 0, 0, 0, 0 ],
  [ 0, 1, 0, 0, 0, 0, 0 ],
  [ 0, 0, 1, 1, 1, 1, 0 ],

  [ 0, 0, 0, 0, 0, 0, 0 ],
  
  [ 0, 0, 0, 0, 0, 0, 0 ],

  // K
  [ 1, 1, 1, 1, 1, 1, 1 ],
  [ 0, 0, 0, 1, 0, 0, 0 ],
  [ 0, 0, 0, 1, 0, 0, 0 ],
  [ 0, 0, 1, 0, 1, 0, 0 ],
  [ 1, 1, 0, 0, 0, 1, 1 ],
  
  [ 0, 0, 0, 0, 0, 0, 0 ],

  // a
  [ 0, 1, 0, 0, 1, 0, 0 ],
  [ 0, 1, 0, 1, 0, 1, 0 ],
  [ 0, 1, 0, 1, 0, 1, 0 ],
  [ 0, 0, 1, 1, 1, 1, 0 ],
  
  [ 0, 0, 0, 0, 0, 0, 0 ],

  // g
  [ 0, 1, 1, 1, 0, 0, 1 ],
  [ 1, 0, 0, 0, 1, 0, 1 ],
  [ 1, 0, 0, 0, 1, 0, 1 ],
  [ 1, 1, 1, 1, 1, 1, 0 ],
  
  [ 0, 0, 0, 0, 0, 0, 0 ],

  // o
  [ 0, 0, 1, 1, 1, 0, 0 ],
  [ 0, 1, 0, 0, 0, 1, 0 ],
  [ 0, 1, 0, 0, 0, 1, 0 ],
  [ 0, 0, 1, 1, 1, 0, 0 ],
  
  [ 0, 0, 0, 0, 0, 0, 0 ],

  // l
  [ 1, 1, 1, 1, 1, 1, 0 ],

])
  1. 也可以使用定义好的字符变量
const dataSource = [].concat(
  LETTER_I, EMPTY_WEEK, EMPTY_WEEK,
  LETTER_a, EMPTY_WEEK, LETTER_m, EMPTY_WEEK, EMPTY_WEEK,
  LETTER_K, EMPTY_WEEK, LETTER_a, EMPTY_WEEK, LETTER_g, EMPTY_WEEK, LETTER_o, EMPTY_WEEK, LETTER_l
);

schedule

这是一个boolean类型的参数,用于打印提交日程,默认值为false,即不打印提交日程。

提交日程的格式是:

您需要在X年X月X日,提交X次代码。

只要按照日程规定的日期进行Github代码提交,即可在你的Github提交日历图上画出想要的图形,快试试吧!

theme

类型 string  string[] | object

自定义主题

默认主题 [ '#ebedf0', '#c6e48b', '#7bc96f', '#239a3b', '#196127' ];

案例

<d-calendar-graph text="DevUI is excellent" theme="halloween"></d-calendar-graph>

<d-calendar-graph text="DevUI is excellent" theme="#7F7FF0"></d-calendar-graph>

<d-calendar-graph text="DevUI is excellent" [theme]="['#d8e9f2', '#fdde8a', '#fa9e59', '#e55648', '#ae1345']"></d-calendar-graph>

<d-calendar-graph text="DevUI is excellent" [theme]="{
  source: [0, 10, 20, 30, 40],
  target: ['#d8e9f2', '#f57647', '#ee6544', '#e55648', '#db484c']
}"></d-calendar-graph>

<d-calendar-graph text="DevUI is excellent" [theme]="{
  '0': '#d8e9f2',
  '5': '#fbe793',
  '10': '#fdcf7d',
  '20': '#fdb163',
  '50': '#f88a50',
  '100': '#ee6544',
  '200': '#db484c',
  '500': '#bf2649',
  '1000': '#9e0142'
}"></d-calendar-graph>

栗子🌰

❤️ DevUI

❤️ DevUI

DevUI is excellent

DevUI is excellent

MIT License Copyright (c) 2020 Kagol Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

生成指定的代码提交日历图 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/kagol/calendar-graph.git
git@gitee.com:kagol/calendar-graph.git
kagol
calendar-graph
calendar-graph
master

搜索帮助