fix: wakatime compact card bargraph rendering (#885)

* fix: wakatime compact card bargraph rendering at the right side

* Updated snapshots
This commit is contained in:
Haraldo Filho
2021-03-07 22:16:02 +05:30
committed by GitHub
parent 8e994304b3
commit 32976d8bd6
3 changed files with 30 additions and 28 deletions
+9 -9
View File
@@ -73,10 +73,10 @@ const createTextNode = ({
return `
<g class="stagger" style="animation-delay: ${staggerDelay}ms" transform="translate(25, 0)">
<text class="stat bold" y="12.5">${label}:</text>
<text
class="stat"
x="${hideProgress ? 170 : 350}"
y="12.5"
<text
class="stat"
x="${hideProgress ? 170 : 350}"
y="12.5"
data-testid="${id}"
>${value}</text>
${cardProgress}
@@ -158,17 +158,17 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
const compactProgressBar = languages
.map((lang) => {
// const progress = (width * lang.percent) / 100;
const progress = ((width - 50) * lang.percent) / 100;
const progress = ((width - 25) * lang.percent) / 100;
const languageColor = languageColors[lang.name] || "#858585";
const output = `
<rect
mask="url(#rect-mask)"
mask="url(#rect-mask)"
data-testid="lang-progress"
x="${progressOffset}"
x="${progressOffset}"
y="0"
width="${progress}"
width="${progress}"
height="8"
fill="${languageColor}"
/>
@@ -230,7 +230,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
return card.render(`
<svg x="0" y="0" width="100%">
${finalLayout}
</svg>
</svg>
`);
};