Skip to content

Commit

Permalink
Increase stats card width & add GitHub icon
Browse files Browse the repository at this point in the history
  • Loading branch information
vn7n24fzkq committed Feb 22, 2021
1 parent fb76a53 commit 9817a91
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/templates/stats-card.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 9817a91

Please sign in to comment.