Skip to content

Commit

Permalink
Merge pull request #77 from oflg/master
Browse files Browse the repository at this point in the history
add GitHubHeatMap Snippet
  • Loading branch information
linonetwo authored Apr 13, 2023
2 parents d652cae + 63a5f70 commit f48f7d3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
25 changes: 25 additions & 0 deletions src/echarts/snippets/GitHubHeatMap.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title: $:/plugins/Gk0Wk/echarts/Snippets/GitHubHeatMap
type: text/vnd.tiddlywiki
tags: $:/tags/TextEditor/Snippet
caption: Add a ~GitHub style ~HeatMap

<div style="max-width: 800px; height: 230px; margin: 0 auto;">
<center style="font-size:20px;">
<$button
set="$:/state/heatmap!!year"
setTo={{{ [{$:/state/heatmap!!year}subtract[1]!match[-1]] ~[<now YYYY>subtract[1]] }}}
class="tc-btn-invisible tc-tiddlylink"

>
</$button> ''<$text text={{{[{$:/state/heatmap!!year}match[]then<now YYYY>else{$:/state/heatmap!!year}]}}}/>'' <$button
set="$:/state/heatmap!!year"
setTo={{{ [{$:/state/heatmap!!year}add[1]!match[1]] ~[<now YYYY>add[1]] }}}
class="tc-btn-invisible tc-tiddlylink"

>
</$button>
</center>
<$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/GitHubHeatMap.js" $width="100%" $height="100%" year={{$:/state/heatmap!!year}}/>
</div>
21 changes: 19 additions & 2 deletions wiki/tiddlers/Index.tid
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,25 @@ tags: ECharts Readme
title: Index
type: text/vnd.tiddlywiki

<div style="max-width: 800px; height: 200px; margin: 0 auto;">
<$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/GitHubHeatMap.js" subfilter="[all[tiddlers]!is[shadow]!is[system]!field:calendarEntry[yes]]" $width="100%" $height="100%" />
<div style="max-width: 800px; height: 230px; margin: 0 auto;">
<center style="font-size:20px;">
<$button
set="$:/state/heatmap!!year"
setTo={{{ [{$:/state/heatmap!!year}subtract[1]!match[-1]] ~[<now YYYY>subtract[1]] }}}
class="tc-btn-invisible tc-tiddlylink"

>
</$button> ''<$text text={{{[{$:/state/heatmap!!year}match[]then<now YYYY>else{$:/state/heatmap!!year}]}}}/>'' <$button
set="$:/state/heatmap!!year"
setTo={{{ [{$:/state/heatmap!!year}add[1]!match[1]] ~[<now YYYY>add[1]] }}}
class="tc-btn-invisible tc-tiddlylink"

>
</$button>
</center>
<$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/GitHubHeatMap.js" $width="100%" $height="100%" year={{$:/state/heatmap!!year}} subfilter="[all[tiddlers]!is[shadow]!is[system]!field:calendarEntry[yes]]" />
</div>

<$list filter="[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]" variable="lang">
Expand Down

0 comments on commit f48f7d3

Please sign in to comment.