refactor(documents): extract Y-axis and X-axis components (#385)
Felix's review named "TimelineAxes" as one of four split targets. The Y-axis and X-axis don't sit adjacent in the DOM — Y is a flex sibling of the bars+X column — so two single-purpose components beats a discriminator-prop component. tickIndicesFor and the omitTickYear derivation move to TimelineXAxis where they belong. Closes part 2 of Felix's component-split concern. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
19
frontend/src/lib/document/TimelineYAxis.svelte
Normal file
19
frontend/src/lib/document/TimelineYAxis.svelte
Normal file
@@ -0,0 +1,19 @@
|
||||
<script lang="ts">
|
||||
let {
|
||||
maxCount,
|
||||
barAreaHeight
|
||||
}: {
|
||||
maxCount: number;
|
||||
barAreaHeight: number;
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="flex flex-col justify-between pr-1.5 text-right font-sans text-xs leading-none text-ink-3"
|
||||
style="height: {barAreaHeight}px;"
|
||||
aria-hidden="true"
|
||||
data-testid="timeline-y-axis"
|
||||
>
|
||||
<span>{maxCount}</span>
|
||||
<span>0</span>
|
||||
</div>
|
||||
Reference in New Issue
Block a user