Skip to content

Commit bf4a641

Browse files
committed
use const for margins
1 parent 4d478f2 commit bf4a641

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ab-testing/frontend/src/lib/components/AudienceBreakdown.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
1818
const BAR_HEIGHT = 40;
1919
20+
const BAR_MARGIN_X = 0.1;
21+
const BAR_MARGIN_Y = 2;
22+
2023
const testSpaces = ['A', 'B', 'C'];
2124
2225
const chartHeight = testSpaces.length * BAR_HEIGHT + BAR_HEIGHT + 16;
@@ -85,13 +88,13 @@
8588
</svg>
8689
{#each getAllRows(testsBySpace) as bar}
8790
<svg
88-
x={`${bar.x + 0.1}%`}
91+
x={`${bar.x + BAR_MARGIN_X}%`}
8992
y={bar.y}
90-
width={`${bar.width - 0.2}%`}
93+
width={`${bar.width - BAR_MARGIN_X * 2}%`}
9194
height={BAR_HEIGHT}
9295
>
9396
<g class="bar">
94-
<rect height={BAR_HEIGHT - 2} width="100%" rx="4" />
97+
<rect height={BAR_HEIGHT - BAR_MARGIN_Y} width="100%" rx="4" />
9598
<text class="name" x="50%" y="50%">{bar.name}</text>
9699
<text class="segments" x="50%" y="50%">{bar.segments}</text>
97100
</g>

0 commit comments

Comments
 (0)