Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"clsx": "^2.1.1",
"d3": "^7.9.0",
"dotenv": "^16.4.7",
"layerchart": "^0.99.2",
"layerchart": "^0.99.4",
"lodash": "^4.17.21",
"svelte-inspect-value": "0.2.0",
"tailwind-merge": "^2.6.0",
Expand Down
64 changes: 62 additions & 2 deletions frontend/src/routes/[conf]/[name]/overview/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
Dagre,
Group,
Html,
Line,
Rect,
Spline,
Svg,
Text,
Tooltip,
ancestors,
descendants
Expand Down Expand Up @@ -156,7 +159,7 @@
<Separator fullWidthExtend={true} wide={true} />

<div class="flex-1 flex py-4">
<div class="flex-1 border rounded">
<div class="flex-1 border rounded grid grid-stack">
<Chart
data={chartData}
transform={{
Expand All @@ -166,6 +169,8 @@
}}
padding={{ top: 60, bottom: 20, left: 20, right: 20 }}
let:tooltip
let:width
let:height
>
<TransformControls />

Expand Down Expand Up @@ -308,6 +313,62 @@
</Dagre>
</div>

<!-- Put legend in separate SVG layer to not be affected by transform (pan/zoom) -->
<Svg ignoreTransform>
{@const legendWidth = 200}
{@const legendHeight = 90}
{@const legendPadding = 20}
{@const legendLabelWidth = 72}
{@const legendItems = [
{
label: 'Batch',
class:
'stroke-purple-500 stroke-[2] [stroke-dasharray:30_100] [stroke-dashoffset:130] animate-dashoffset-0.5x'
},
{
label: 'Streaming',
class:
'stroke-blue-500 stroke-[2] [stroke-dasharray:10_10] [stroke-dashoffset:20] animate-dashoffset-2x'
}
]}

<Group x={width - legendWidth} y={height - legendHeight}>
<Rect
x={0}
y={0}
width={legendWidth}
height={legendHeight}
class="fill-neutral-100 stroke-border"
rx={8}
/>
<Text
value="Legend"
x={legendPadding}
y={24}
width={legendWidth}
textAnchor="start"
class="text-sm fill-surface-content font-bold"
/>
<Group y={24}>
{#each legendItems as item, i (item.label)}
<Text
value={item.label}
x={legendPadding}
y={24 + i * 24}
class="text-xs fill-surface-content/50"
/>
<Line
x1={legendPadding + legendLabelWidth}
y1={20 + i * 24}
x2={legendWidth - legendPadding}
y2={20 + i * 24}
class={item.class}
/>
{/each}
</Group>
</Group>
</Svg>

{#if !hideTooltip}
<Tooltip.Root {...tooltipProps.root} contained="window" xOffset={0} yOffset={30} let:data>
<Tooltip.List {...tooltipProps.list}>
Expand Down Expand Up @@ -338,7 +399,6 @@
{/if}

<!-- EntitySource -->

{#each ['table', 'snapshotTable', 'mutationTable', 'mutationTopic'] as prop}
{#if data.value.conf[prop] !== undefined}
<Tooltip.Item
Expand Down