Skip to content

Commit f6e9358

Browse files
committed
ci: Stop using nested svg
1 parent 8ebb1d3 commit f6e9358

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

ci/github-actions/illustrate-benchmark-reports.ts

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,16 @@ function renderReport(report: Report) {
4444
numberContent: String(unit.mean).slice(0, numberLength - 1) + 's',
4545
}))
4646
const labels = shapes.map(({ command, y, labelX, labelWidth }) =>
47-
svg`<svg
47+
svg`<text
4848
x=${labelX}
49-
y=${y}
49+
y=${y + rowHeight * 0.8}
5050
width=${labelWidth}
5151
height=${rowHeight}
52-
>
53-
<text
54-
x="0%"
55-
y="80%"
56-
width="100%"
57-
height="100%"
58-
textLength="100%"
59-
lengthAdjust="spacingAndGlyphs"
60-
fill=${textColor}
61-
font-family=${fontFamily}
62-
>${command}</text>
63-
</svg>`
52+
textLength=${labelWidth}
53+
lengthAdjust="spacingAndGlyphs"
54+
fill=${textColor}
55+
font-family=${fontFamily}
56+
>${command}</text>`
6457
)
6558
const bars = shapes.map(({ y, index, barX, barWidth }) =>
6659
svg`<rect
@@ -72,21 +65,14 @@ function renderReport(report: Report) {
7265
/>`
7366
)
7467
const numbers = shapes.map(({ y, numberX, numberContent }) =>
75-
svg`<svg
68+
svg`<text
7669
x=${numberX}
77-
y=${y}
70+
y=${y + rowHeight * 0.8}
7871
width=${numberColumnWidth}
7972
height=${rowHeight}
80-
>
81-
<text
82-
x="0%"
83-
y="80%"
84-
width="100%"
85-
height="100%"
86-
fill=${textColor}
87-
font-family=${fontFamily}
88-
>${numberContent}</text>
89-
</svg>`
73+
fill=${textColor}
74+
font-family=${fontFamily}
75+
>${numberContent}</text>`
9076
)
9177
return svg`<svg
9278
xmlns=${xmlns}

0 commit comments

Comments
 (0)