Skip to content

Commit d6d9491

Browse files
author
Oussama
committed
fix: prevent annotation lines crossing labels
1 parent a1fd53f commit d6d9491

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

website/src/lib/components/Annotation.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<g class="annotation" class:strong={emphasis === 'strong'}>
1313
<line x1={x} y1={y} x2={x + dx} y2={y + dy} />
1414
<circle cx={x} cy={y} r="3" />
15-
<foreignObject x={x + dx} y={y + dy - 20} {width} height="120">
15+
<foreignObject x={x + dx - 4} y={y + dy - 24} width={width + 8} height="124">
1616
<div class="note">
1717
{#if value}
1818
<span class="value">{value}</span>
@@ -41,7 +41,11 @@
4141
display: flex;
4242
flex-direction: column;
4343
gap: 0.25rem;
44+
width: fit-content;
45+
max-width: 100%;
46+
padding: 0.125rem 0.25rem 0.25rem;
4447
color: currentColor;
48+
background: color-mix(in srgb, var(--bg-paper) 94%, transparent);
4549
font-family: var(--font-body);
4650
font-size: var(--type-small-size);
4751
line-height: var(--type-small-line);

website/src/lib/scenes/Scene3Gender.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
},
4444
{
4545
decade: 1990,
46-
dx: 42,
47-
dy: 82,
46+
dx: -36,
47+
dy: 84,
4848
value: '1980s',
4949
label: 'sustained rise begins.',
5050
width: 160,

0 commit comments

Comments
 (0)