Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
31e28ad
BrushState WIP
techniq Jun 21, 2025
c7add51
Merge branch 'next' into brush-state
techniq Jul 14, 2025
9141f25
Merge branch 'next' into brush-state
techniq Jul 14, 2025
d8486dd
Merge branch 'next' into brush-state
techniq Sep 11, 2025
d394745
Add missing import after merge
techniq Sep 11, 2025
c19464c
Fix some svelte/type checks
techniq Sep 11, 2025
d9c45a4
Update @layerstack/utils with improved clamp() types. Fix remaining …
techniq Sep 12, 2025
53797b4
Merge branch 'next' into brush-state
techniq Sep 28, 2025
d91841b
fix merge
techniq Sep 28, 2025
9fc08f0
Move BrushState to $lib/states
techniq Sep 29, 2025
cb20ec2
Fix CI
techniq Sep 29, 2025
b9de0f7
Fix CI
techniq Sep 29, 2025
bbd11b6
Move Chart state into ChartState
techniq Oct 19, 2025
2130761
Refactor chart context to use ChartState instead of ChartContextValue…
techniq Oct 19, 2025
4e0b0de
Fix prop reactivity (brushing, etc)
techniq Oct 19, 2025
3e320ec
Cleanup
techniq Oct 19, 2025
c858e18
More cleanup
techniq Oct 19, 2025
52da3c7
Merge branch 'docs-v2' into state-refactor
techniq Oct 19, 2025
3ec5992
Extract GeoState from GeoContext component
techniq Oct 19, 2025
dd6594c
Merge branch 'docs-v2' into state-refactor
techniq Oct 19, 2025
aeabf39
Merge branch 'docs-v2' into state-refactor
techniq Oct 20, 2025
5ac9391
Fix import
techniq Oct 20, 2025
7368208
Merge branch 'docs-v2' into state-refactor
techniq Oct 20, 2025
3d8ec93
Merge branch 'docs-v2' into state-refactor
techniq Oct 21, 2025
a0cccf8
Merge branch 'docs-v2' into state-refactor
techniq Oct 22, 2025
a8b82b1
Merge branch 'docs-v2' into state-refactor
techniq Oct 23, 2025
f574beb
Merge branch 'brush-state' into state-refactor
techniq Oct 23, 2025
6a1d0ff
Merge branch 'docs-v2' into state-refactor
techniq Oct 23, 2025
3cf8406
Merge branch 'docs-v2' into state-refactor
techniq Oct 27, 2025
9a863be
Update .gitignore
techniq Nov 13, 2025
45f06e2
Merge branch 'docs-v2' into state-refactor
techniq Nov 13, 2025
d74ff78
Fix type
techniq Nov 13, 2025
573dc8f
Merge branch 'docs-v2' into state-refactor
techniq Nov 14, 2025
e82a674
Merge branch 'docs-v2' into state-refactor
techniq Nov 28, 2025
3fe2d48
Extract TransformState from TransformContext component
techniq Nov 28, 2025
8b6756b
Update brush examples
techniq Nov 28, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
<Layer>
<Area line={{ class: 'stroke-2 stroke-primary' }} class="fill-primary/20" />

{#if context.brush.isActive}
{#if context.brush.active}
<Text
x={-4}
y={context.height / 2}
value={format(context.brush.xDomain?.[0] as any)}
value={format(context.brush.x?.[0] as any)}
textAnchor="end"
verticalAnchor="middle"
class="text-xs"
/>
<Text
x={context.width + 4}
y={context.height / 2}
value={format(context.brush.xDomain?.[1] as any)}
value={format(context.brush.x?.[1] as any)}
verticalAnchor="middle"
class="text-xs"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Layer>
<Area line={{ class: 'stroke-2 stroke-primary' }} class="fill-primary/20" />

{#if context.brush.isActive}
{#if context.brush.active}
<rect
x={context.brush.range.x}
width={context.brush.handleSize}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
{#snippet children({ context })}
<Layer>
<Area line={{ class: 'stroke-2 stroke-primary' }} class="fill-primary/20" />
{#if context.brush.isActive}
{#if context.brush.active}
<Text
x={context.brush.range.x - 4}
y={context.brush.range.height / 2}
value={format(context.brush.xDomain?.[0] as any)}
value={format(context.brush.x?.[0] as any)}
textAnchor="end"
verticalAnchor="middle"
class="text-xs"
/>
<Text
x={context.brush.range.x + context.brush.range.width + 4}
y={context.brush.range.height / 2}
value={format(context.brush.xDomain?.[1] as any)}
value={format(context.brush.x?.[1] as any)}
verticalAnchor="middle"
class="text-xs"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
axis: 'both',
resetOnEnd: true,
onBrushEnd: (e) => {
xDomain = e.xDomain;
yDomain = e.yDomain;
xDomain = e.brush.x;
yDomain = e.brush.y;
}
}}
height={300}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
brush={{
resetOnEnd: true,
onBrushEnd: (e) => {
xDomain = e.xDomain;
xDomain = e.brush.x;
}
}}
height={300}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
axis: 'y',
resetOnEnd: true,
onBrushEnd: (e) => {
yDomain = e.yDomain;
yDomain = e.brush.y;
}
}}
height={300}
Expand Down
12 changes: 6 additions & 6 deletions docs/src/examples/components/BrushContext/minimap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
axis: 'both',
resetOnEnd: true,
onBrushEnd: (e) => {
xDomain = e.xDomain;
yDomain = e.yDomain;
xDomain = e.brush.x;
yDomain = e.brush.y;
}
}}
height={400}
Expand All @@ -50,11 +50,11 @@
brush={{
axis: 'both',
mode: 'separated',
xDomain: xDomain,
yDomain: yDomain,
x: xDomain as any,
y: yDomain as any,
onChange: (e) => {
xDomain = e.xDomain;
yDomain = e.yDomain;
xDomain = e.brush.x;
yDomain = e.brush.y;
}
}}
>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/examples/components/BrushContext/selection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
brush={{
axis: 'both',
onChange: (e) => {
xDomain = e.xDomain;
yDomain = e.yDomain;
xDomain = e.brush.x;
yDomain = e.brush.y;
}
}}
height={400}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
padding={{ left: 16 }}
brush={{
onChange: (e) => {
xDomain = e.xDomain;
xDomain = e.brush.x;
}
}}
height={40}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
brush={{
axis: 'y',
onChange: (e) => {
yDomain = e.yDomain;
yDomain = e.brush.y;
}
}}
height={300}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
padding={{ left: 16 }}
brush={{
onChange: (e) => {
xDomain = e.xDomain;
xDomain = e.brush.x;
}
}}
height={40}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
padding={{ left: 16 }}
brush={{
mode: 'separated',
xDomain,
onChange: (e) => (xDomain = e.xDomain),
x: xDomain as any,
onChange: (e) => (xDomain = e.brush.x),
onReset: (e) => (xDomain = null)
}}
height={20}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
brush={{
resetOnEnd: true,
onBrushEnd: (e) => {
xDomain = e.xDomain;
xDomain = e.brush.x;
}
}}
height={300}
Expand Down
2 changes: 1 addition & 1 deletion packages/layerchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@layerstack/svelte-actions": "1.0.1-next.14",
"@layerstack/svelte-state": "0.1.0-next.19",
"@layerstack/tailwind": "2.0.0-next.17",
"@layerstack/utils": "2.0.0-next.14",
"@layerstack/utils": "2.0.0-next.15",
"d3-array": "^3.2.4",
"d3-color": "^3.1.0",
"d3-delaunay": "^6.0.4",
Expand Down
Loading
Loading