From 09706b51c2bef73b128bff924bb259ec7eb4867a Mon Sep 17 00:00:00 2001 From: oflg Date: Tue, 17 Jan 2023 15:45:45 +0800 Subject: [PATCH] add GitHubHeatMap Snippet --- src/echarts/snippets/GitHubHeatMap.tid | 25 +++++++++++++++++++++++++ wiki/tiddlers/Index.tid | 21 +++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 src/echarts/snippets/GitHubHeatMap.tid diff --git a/src/echarts/snippets/GitHubHeatMap.tid b/src/echarts/snippets/GitHubHeatMap.tid new file mode 100644 index 0000000..6092882 --- /dev/null +++ b/src/echarts/snippets/GitHubHeatMap.tid @@ -0,0 +1,25 @@ +title: $:/plugins/Gk0Wk/echarts/Snippets/GitHubHeatMap +type: text/vnd.tiddlywiki +tags: $:/tags/TextEditor/Snippet +caption: Add a ~GitHub style ~HeatMap + +
+
+ <$button + set="$:/state/heatmap!!year" + setTo={{{ [{$:/state/heatmap!!year}subtract[1]!match[-1]] ~[subtract[1]] }}} + class="tc-btn-invisible tc-tiddlylink" + + > + ◄ + ''<$text text={{{[{$:/state/heatmap!!year}match[]thenelse{$:/state/heatmap!!year}]}}}/>'' <$button + set="$:/state/heatmap!!year" + setTo={{{ [{$:/state/heatmap!!year}add[1]!match[1]] ~[add[1]] }}} + class="tc-btn-invisible tc-tiddlylink" + + > + ► + +
+ <$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/GitHubHeatMap.js" $width="100%" $height="100%" year={{$:/state/heatmap!!year}}/> +
\ No newline at end of file diff --git a/wiki/tiddlers/Index.tid b/wiki/tiddlers/Index.tid index 0defbe0..b4a11b3 100755 --- a/wiki/tiddlers/Index.tid +++ b/wiki/tiddlers/Index.tid @@ -6,8 +6,25 @@ tags: ECharts Readme title: Index type: text/vnd.tiddlywiki -
-<$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/GitHubHeatMap.js" $width="100%" $height="100%" /> +
+
+ <$button + set="$:/state/heatmap!!year" + setTo={{{ [{$:/state/heatmap!!year}subtract[1]!match[-1]] ~[subtract[1]] }}} + class="tc-btn-invisible tc-tiddlylink" + + > + ◄ + ''<$text text={{{[{$:/state/heatmap!!year}match[]thenelse{$:/state/heatmap!!year}]}}}/>'' <$button + set="$:/state/heatmap!!year" + setTo={{{ [{$:/state/heatmap!!year}add[1]!match[1]] ~[add[1]] }}} + class="tc-btn-invisible tc-tiddlylink" + + > + ► + +
+ <$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/GitHubHeatMap.js" $width="100%" $height="100%" year={{$:/state/heatmap!!year}}/>
<$list filter="[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]" variable="lang">