From 9817a91fe3209f16da0c83f2e17bf6c79bdcbf47 Mon Sep 17 00:00:00 2001 From: vn7n24fzkq Date: Mon, 22 Feb 2021 23:30:12 +0800 Subject: [PATCH] Increase stats card width & add GitHub icon --- src/templates/stats-card.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/templates/stats-card.js b/src/templates/stats-card.js index ddfd2dcb6..b11396de9 100644 --- a/src/templates/stats-card.js +++ b/src/templates/stats-card.js @@ -1,9 +1,10 @@ const Card = require("./card"); const d3 = require("d3"); const moment = require("moment"); +const Icons = require("../const/icon"); function createStatsCard(title, statsData, theme) { - let card = new Card(title, 230, 200, theme); + let card = new Card(title, 340, 200, theme); let svg = card.getSVG(); //draw icon @@ -45,11 +46,20 @@ function createStatsCard(title, statsData, theme) { .text((d) => { return `${d.value}`; }) - .attr("x", 140) + .attr("x", 130) .attr("y", (d) => labelHeight * d.index * 1.8 + labelHeight) .style("fill", theme.text_color) .style("font-size", `${labelHeight}px`); + const panelForGitHubLogo = svg + .append("g") + .attr("transform", `translate(220,20)`); + panelForGitHubLogo + .append("g") + .attr("transform", `scale(6)`) + .style("fill", theme.icon_color) + .html(Icons.GITHUB); + return card.toString(); }