mirror of
https://github.com/anuraghazra/github-readme-stats.git
synced 2024-12-15 06:04:17 +08:00
fix: wakatime compact card bargraph rendering (#885)
* fix: wakatime compact card bargraph rendering at the right side * Updated snapshots
This commit is contained in:
parent
8e994304b3
commit
32976d8bd6
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,3 +6,5 @@ package-lock.json
|
|||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
coverage
|
coverage
|
||||||
|
vercel_token
|
||||||
|
|
||||||
|
@ -73,10 +73,10 @@ const createTextNode = ({
|
|||||||
return `
|
return `
|
||||||
<g class="stagger" style="animation-delay: ${staggerDelay}ms" transform="translate(25, 0)">
|
<g class="stagger" style="animation-delay: ${staggerDelay}ms" transform="translate(25, 0)">
|
||||||
<text class="stat bold" y="12.5">${label}:</text>
|
<text class="stat bold" y="12.5">${label}:</text>
|
||||||
<text
|
<text
|
||||||
class="stat"
|
class="stat"
|
||||||
x="${hideProgress ? 170 : 350}"
|
x="${hideProgress ? 170 : 350}"
|
||||||
y="12.5"
|
y="12.5"
|
||||||
data-testid="${id}"
|
data-testid="${id}"
|
||||||
>${value}</text>
|
>${value}</text>
|
||||||
${cardProgress}
|
${cardProgress}
|
||||||
@ -158,17 +158,17 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
const compactProgressBar = languages
|
const compactProgressBar = languages
|
||||||
.map((lang) => {
|
.map((lang) => {
|
||||||
// const progress = (width * lang.percent) / 100;
|
// 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 languageColor = languageColors[lang.name] || "#858585";
|
||||||
|
|
||||||
const output = `
|
const output = `
|
||||||
<rect
|
<rect
|
||||||
mask="url(#rect-mask)"
|
mask="url(#rect-mask)"
|
||||||
data-testid="lang-progress"
|
data-testid="lang-progress"
|
||||||
x="${progressOffset}"
|
x="${progressOffset}"
|
||||||
y="0"
|
y="0"
|
||||||
width="${progress}"
|
width="${progress}"
|
||||||
height="8"
|
height="8"
|
||||||
fill="${languageColor}"
|
fill="${languageColor}"
|
||||||
/>
|
/>
|
||||||
@ -230,7 +230,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
return card.render(`
|
return card.render(`
|
||||||
<svg x="0" y="0" width="100%">
|
<svg x="0" y="0" width="100%">
|
||||||
${finalLayout}
|
${finalLayout}
|
||||||
</svg>
|
</svg>
|
||||||
`);
|
`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,10 +100,10 @@ exports[`Test Render Wakatime Card should render correctly 1`] = `
|
|||||||
<g transform=\\"translate(0, 0)\\">
|
<g transform=\\"translate(0, 0)\\">
|
||||||
<g class=\\"stagger\\" style=\\"animation-delay: NaNms\\" transform=\\"translate(25, 0)\\">
|
<g class=\\"stagger\\" style=\\"animation-delay: NaNms\\" transform=\\"translate(25, 0)\\">
|
||||||
<text class=\\"stat bold\\" y=\\"12.5\\">Other:</text>
|
<text class=\\"stat bold\\" y=\\"12.5\\">Other:</text>
|
||||||
<text
|
<text
|
||||||
class=\\"stat\\"
|
class=\\"stat\\"
|
||||||
x=\\"350\\"
|
x=\\"350\\"
|
||||||
y=\\"12.5\\"
|
y=\\"12.5\\"
|
||||||
data-testid=\\"Other\\"
|
data-testid=\\"Other\\"
|
||||||
>19 mins</text>
|
>19 mins</text>
|
||||||
|
|
||||||
@ -123,10 +123,10 @@ exports[`Test Render Wakatime Card should render correctly 1`] = `
|
|||||||
</g><g transform=\\"translate(0, 25)\\">
|
</g><g transform=\\"translate(0, 25)\\">
|
||||||
<g class=\\"stagger\\" style=\\"animation-delay: NaNms\\" transform=\\"translate(25, 0)\\">
|
<g class=\\"stagger\\" style=\\"animation-delay: NaNms\\" transform=\\"translate(25, 0)\\">
|
||||||
<text class=\\"stat bold\\" y=\\"12.5\\">TypeScript:</text>
|
<text class=\\"stat bold\\" y=\\"12.5\\">TypeScript:</text>
|
||||||
<text
|
<text
|
||||||
class=\\"stat\\"
|
class=\\"stat\\"
|
||||||
x=\\"350\\"
|
x=\\"350\\"
|
||||||
y=\\"12.5\\"
|
y=\\"12.5\\"
|
||||||
data-testid=\\"TypeScript\\"
|
data-testid=\\"TypeScript\\"
|
||||||
>1 min</text>
|
>1 min</text>
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ exports[`Test Render Wakatime Card should render correctly 1`] = `
|
|||||||
|
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
@ -254,31 +254,31 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
|
|||||||
</mask>
|
</mask>
|
||||||
|
|
||||||
<rect
|
<rect
|
||||||
mask=\\"url(#rect-mask)\\"
|
mask=\\"url(#rect-mask)\\"
|
||||||
data-testid=\\"lang-progress\\"
|
data-testid=\\"lang-progress\\"
|
||||||
x=\\"0\\"
|
x=\\"0\\"
|
||||||
y=\\"0\\"
|
y=\\"0\\"
|
||||||
width=\\"6.291999999999999\\"
|
width=\\"6.6495\\"
|
||||||
height=\\"8\\"
|
height=\\"8\\"
|
||||||
fill=\\"#858585\\"
|
fill=\\"#858585\\"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<rect
|
<rect
|
||||||
mask=\\"url(#rect-mask)\\"
|
mask=\\"url(#rect-mask)\\"
|
||||||
data-testid=\\"lang-progress\\"
|
data-testid=\\"lang-progress\\"
|
||||||
x=\\"6.291999999999999\\"
|
x=\\"6.6495\\"
|
||||||
y=\\"0\\"
|
y=\\"0\\"
|
||||||
width=\\"0.44\\"
|
width=\\"0.465\\"
|
||||||
height=\\"8\\"
|
height=\\"8\\"
|
||||||
fill=\\"#2b7489\\"
|
fill=\\"#2b7489\\"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<rect
|
<rect
|
||||||
mask=\\"url(#rect-mask)\\"
|
mask=\\"url(#rect-mask)\\"
|
||||||
data-testid=\\"lang-progress\\"
|
data-testid=\\"lang-progress\\"
|
||||||
x=\\"6.731999999999999\\"
|
x=\\"7.1145\\"
|
||||||
y=\\"0\\"
|
y=\\"0\\"
|
||||||
width=\\"0.30800000000000005\\"
|
width=\\"0.32550000000000007\\"
|
||||||
height=\\"8\\"
|
height=\\"8\\"
|
||||||
fill=\\"#cb171e\\"
|
fill=\\"#cb171e\\"
|
||||||
/>
|
/>
|
||||||
@ -306,7 +306,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
|
|||||||
</g>
|
</g>
|
||||||
|
|
||||||
|
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Loading…
Reference in New Issue
Block a user