Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
taro-calendar-heatmap
Advanced tools
Readme
基于 Taro 的日历热力图,生成类似于 GitHub Contribution 统计图。
npm i taro-calendar-heatmap --save
import CalendarHeatmap from 'taro-calendar-heatmap';
// 引入样式
import 'taro-calendar-heatmap/dist/index.css';
const data = [
{ date: '2021-3-24', count: 6 },
{ date: '2021-3-25', count: 1 },
{ date: '2021-3-26', count: 4 },
{ date: '2021-3-27', count: 5 },
{ date: '2021-3-28', count: 7 },
];
<CalendarHeatMap data={data} showMonthLabel showWeekLabel theme="github" />;
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
spacing | 方块的间隙 | number | 1 |
squareWidth | 方块的宽度 | number | 14 |
radius | 方块的弧度 | number | 3 |
colorRange | 颜色范围,第一个颜色值为方块未填充的颜色 | string[] | [] |
theme | 日历主题 | github | purple | volcano | blue | orange | github |
startDate | 开始时间,可以传时间字符串、Date、时间戳 | string | Date | number | One year ago |
endDate | 结束时间,可以传时间字符串、Date、时间戳 | string | Date | number | Today |
showWeekLabel | 是否显示周标签 | boolean | false |
showMonthLabel | 是否显示月份标签 | boolean | false |
firstDay | 每周的第一天 | Mon | Sun |
data | 日历数据 | DataProp[] | [] |
onClick | 点击回调,可以在回调可以获取点击的日期时间 | Function | (date: Date ) => {} |
showTooltip | 点击是否显示提示 | boolean | false |
tooltipContent | 提示框内容,可以穿字符串或者组件。 | string | Element |
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
count | 次数,次数越多,颜色越深 | number | 0 |
date | 可以传时间字符串、Date、时间戳 | string | Date | number | null |
组件内置了 GitHub、酱紫、火山、极客蓝、日暮五种主题,效果如下。
theme | 主题名称 | 截图 |
---|---|---|
github | GitHub | |
purple | 酱紫 | |
volcano | 火山 | |
blue | 极客蓝 | |
orange | 日暮 |
FAQs
A calendar heatmap component build by taro.
The npm package taro-calendar-heatmap receives a total of 0 weekly downloads. As such, taro-calendar-heatmap popularity was classified as not popular.
We found that taro-calendar-heatmap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.