mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-09-03 18:16:43 +00: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:
@@ -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>
|
||||
`);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user