Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
1823768
[Chart] Expose `x`/`y`/`z`/`r` accessors via slot props
techniq Jul 10, 2024
6ab467b
Begin to experiment with new AreaChart component
techniq Jul 10, 2024
abfc417
Add TooltipHeader component
techniq Jul 14, 2024
c15cd87
[TooltipItem] Support `color` prop to add swatch, support theme color…
techniq Jul 14, 2024
7c94f0c
Refined Tooltip design WIP
techniq Jul 19, 2024
4c323df
[AreaChart] Add api, source, and related
techniq Aug 1, 2024
8f6e138
[AreaChart] Require passing x/y accessors and default xScale based on…
techniq Aug 1, 2024
23bdedb
Update more usage to use <TooltipHeader> instead of <Tooltip header={…
techniq Aug 1, 2024
fda2ac3
Consolidate Tooltip components (<TooltipItem>, <TooltipSeparator>, et…
techniq Aug 4, 2024
be1fd3a
Update more examples to new Tooltip module components
techniq Aug 4, 2024
be66334
Refine TooltipHeader default styles
techniq Aug 4, 2024
7438c63
[TooltipSeparator] Use theme color
techniq Aug 4, 2024
3c733a6
[TooltipHeader] Remove word wrapping (as before)
techniq Aug 4, 2024
8515547
Update more examples to new Tooltip module components
techniq Aug 4, 2024
ae98d4e
Update remaining examples to new Tooltip module components
techniq Aug 4, 2024
55fd79f
Update remaining <Tooltip header={...}> to <Tooltip.Root><Tooltip.Hea…
techniq Aug 4, 2024
5f087fd
Hopefully fix remaining build issues after Tooltip module components
techniq Aug 4, 2024
b927956
[AreaChart] Add axis formatting
techniq Aug 5, 2024
87cdeda
Add BarChart
techniq Aug 5, 2024
a20f89b
Add 2 examples for an Area with threshold coloring using RectClipPath…
techniq Aug 7, 2024
673a436
[Area] Add over/under threshold examples
techniq Aug 7, 2024
2da8547
[Area] Add Highlight color based on value example
techniq Aug 7, 2024
2c38f94
[Area] Add "Highlight color based on value using tooltip slot prop" e…
techniq Aug 7, 2024
6eaa71a
Add @layerstack svelte-stores, tailwind, and utils packages and move …
techniq Aug 15, 2024
f8b9b96
Add `@layerstack/svelte-actions` and use `scrollIntoView` action inst…
techniq Aug 15, 2024
cab25a3
Format
techniq Aug 15, 2024
596d5cd
Move graph example data to static/load to reduce cloudflare worker size
techniq Aug 15, 2024
d359712
Remove old graph data file
techniq Aug 15, 2024
fba4f2b
Fetch CHANGELOG.md from github via load() to reduce cloudflare worker…
techniq Aug 15, 2024
ac5db02
Reorganize menu and setup chart descriptions
techniq Aug 15, 2024
e3ae1ef
Fix topojson preview
techniq Aug 15, 2024
b92f705
Add map pan/zoom to topojson and geosjon previews with enhanced tile …
techniq Aug 15, 2024
47330c9
feat(AreaChart): Add `labels` prop and pass `tooltip` as slot prop
techniq Aug 16, 2024
d9efcbb
feat(BarChart): Add `tooltip` slot prop
techniq Aug 16, 2024
32557f8
feat(TooltipItem): Rework `color` prop to be any string color and use…
techniq Aug 16, 2024
f1293fb
feat: Add LineChart component
techniq Aug 16, 2024
0e7283b
Format
techniq Aug 16, 2024
e906257
feat(AreaChart): Add `series` support
techniq Aug 17, 2024
45dd039
Always show tooltip highlight points above areas and simplify by leve…
techniq Aug 17, 2024
d0c22c5
feat: Add ScatterChart
techniq Aug 17, 2024
547a294
docs(Axis): Add responsive ticks example
techniq Aug 18, 2024
ca8b4d5
Use only layerstack/utils format instead of date-fns for bar examples…
techniq Aug 18, 2024
1fef599
docs: Add Force Text example
techniq Aug 19, 2024
850043d
Make pnpm check happpy
techniq Aug 19, 2024
4b6d669
Pass width, height, and padding to chart slots. Improve ScatterChart…
techniq Aug 22, 2024
24787c2
fix(Voronoi): Dispatch custom `pointerevent` instead of forwarding to…
techniq Aug 22, 2024
b871dd4
Add more slots (axis, marks, highlight) for more granular overrides
techniq Aug 22, 2024
16969e6
Use new granular slots for AreaChart highlight series example
techniq Aug 22, 2024
1dc2830
Add xScale and yScale to slot props
techniq Aug 22, 2024
1da5cc0
[AreaChart] Add Gradient and ThresholdGradient examples
techniq Aug 22, 2024
9e23a1e
Refine setting thresholdOffset for better readability
techniq Aug 22, 2024
5f4cdaf
feat(BarChart) Support series (with props) and add `before-marks` and…
techniq Aug 23, 2024
5c4f557
fix(Spline): Enable passing `fill` prop (useful for Bar with single r…
techniq Aug 23, 2024
7d2bc90
feat(AreaChart,LineChart,ScatterChart) Support passing props per seri…
techniq Aug 23, 2024
020028c
Workaround svelte-check / typescript error
techniq Aug 23, 2024
cd047d5
Add PieChart (WIP)
techniq Aug 24, 2024
783cd8a
feat(Arc): Support passing `tooltip` and `data` props to simplify set…
techniq Aug 25, 2024
d06572e
Support passing props to inner components
techniq Aug 25, 2024
928d741
Change wideData and longData year to number
techniq Aug 25, 2024
0f21c50
Add TODOs
techniq Aug 25, 2024
ac1e815
Simplify
techniq Aug 25, 2024
d2dae6b
docs(BarChart): Add horizontal / diverging example (WIP)
techniq Aug 26, 2024
2ae86c8
Add vitest
techniq Aug 26, 2024
497d6e1
Format all tooltip values by default (using default formatter based o…
techniq Aug 26, 2024
edb045d
fix(BarChart): Change `layout` prop to `orientation` to align with ot…
techniq Aug 26, 2024
2561bb6
feat(Points): Add `xValue` and `yValue` to each point, and improve types
techniq Aug 26, 2024
b7927c8
fix(Labels): Handle multiple x or y properties (stack, diverting) by …
techniq Aug 26, 2024
a8b0d46
Finish horizontal / diverging example and add percent-based version a…
techniq Aug 26, 2024
6d98f57
Fix negative labels/axis on percent version
techniq Aug 26, 2024
2b9e68e
Add data source links for population pyramid
techniq Aug 26, 2024
22e94bf
Add stack tests (WIP - fix build by adding test)
techniq Aug 26, 2024
50d32c2
fix(Labels): Restore passing $$restProps to fix check/build, but also…
techniq Aug 26, 2024
7779db3
docs(ForceText): Add force and trransition toggles
techniq Aug 27, 2024
eeb3032
docs(Chart): Improve description
techniq Aug 27, 2024
20114e9
docs(Arc): Improve segmented example
techniq Aug 27, 2024
19b1060
test(accessor): Add tests for accessor function
techniq Aug 28, 2024
7aba712
Set timezone when running tests to EST
techniq Aug 28, 2024
ccf643b
feat(Chart): Use `accessor()` util before passsing x/y accessors to L…
techniq Aug 28, 2024
fd4fd50
feat: Rename `createStackData()` to `groupStackData()`, refine return…
techniq Aug 28, 2024
d52b807
docs: Add tooltip examples to Bar/Columns group/stack examples
techniq Aug 28, 2024
a93abe4
fix(accessor): Handle number indexes (ex. stack)
techniq Aug 28, 2024
54bdeab
Use `[...data]` array copying to fix type workaround
techniq Aug 28, 2024
e6da55d
feat(Bar): Forward pointer events to enable individual bar tooltips
techniq Aug 28, 2024
5cc5760
docs(Bars/Columns): Add individual tooltip examples
techniq Aug 28, 2024
339d082
fix(groupStackData): Fix `value` when using `groupBy` and `stackBy`
techniq Aug 28, 2024
3fb6145
fix(Rect/Spline): Forward `pointerenter` events
techniq Aug 28, 2024
6102677
test(groupStackData): Fix `value` with groupBy only
techniq Aug 28, 2024
2b59d05
docs: Simplify Bar/Columns stacked examples by removing explicit yDom…
techniq Aug 28, 2024
bf29d40
docs(Tooltip): Fix area stack tooltip example
techniq Aug 29, 2024
4b7f0be
fix(Points):Fix points when using array accessor after using `accesso…
techniq Aug 29, 2024
5c986de
fix(TooltipControls): Fix display of selected options
techniq Aug 30, 2024
2635931
feat(Points): Add canvas support
techniq Sep 1, 2024
df1555d
docs(ForceText): Use new Points canvas support instead of individual …
techniq Sep 1, 2024
8759761
Remove console.log
techniq Sep 1, 2024
307d72b
Rename menu group "Data-driven" to "Marks
techniq Sep 1, 2024
bcb347c
Add a simple Bar docs page
techniq Sep 1, 2024
bc51494
Provider better AreaChart custom tooltip example
techniq Sep 1, 2024
70b9920
fix(Area): Pass `x` override to internal Spline
techniq Sep 1, 2024
fa81232
feat(AreaChart): Add stackSeries support
techniq Sep 1, 2024
9d615a1
Cleanup and fix CI build
techniq Sep 1, 2024
3d4d995
feat(AreaChart): Add total to tooltip when using `stackSeries`
techniq Sep 2, 2024
3e7e26d
chore!: Remove `AreaStack` as use cases fully supported by `Area`
techniq Sep 2, 2024
bd6687b
Remove using `accessor()` before passing x/y accessors to LayerCake t…
techniq Sep 2, 2024
5b26d38
feat(Area): Simplify usage when `y` accessor set to `[0,1]`
techniq Sep 2, 2024
131689f
fix(AreaChart): Reverse series order so tooltip items match stacks
techniq Sep 2, 2024
2554e61
Add type hack until LayerCake can support `Accessor<TData>` or simila…
techniq Sep 2, 2024
b988dac
feat(BarChart): Add `stackSeries` support
techniq Sep 2, 2024
36565d9
fix(Point): Restoring passing `class` to svg circle after supporting …
techniq Sep 4, 2024
d56f7c3
feat(Chart): Add `radial` prop to enable radial instead of cartesian …
techniq Sep 4, 2024
8f6e8cd
feat(Svg): Add `center` to conveniently center children, useful for r…
techniq Sep 4, 2024
4df3419
Rename `axisBottom` / `axisLeft` to `xAxis` / `yAxis` and begin to su…
techniq Sep 4, 2024
1efcd32
fix(Chart): Default domain sorting to `false` (instead of LayerCake `…
techniq Sep 5, 2024
27ea02b
feat(Voronoi): Support radial coordinates. Issue #112
techniq Sep 5, 2024
d7907ab
feat(Highlight): Support radial coordiantes for `points` and `lines`.…
techniq Sep 5, 2024
f4f62a6
feat(Labels): Support `center` placement (useful with Points)
techniq Sep 5, 2024
525267b
fix(Points): Fix passing fill and stroke for Svg (after supporting Ca…
techniq Sep 5, 2024
966dac0
feat(LineChart): Support passing `points` prop to easily add Points (…
techniq Sep 5, 2024
53befbf
docs(LineChart): Add more examples (Radar, Points with Labels)
techniq Sep 5, 2024
1d547d5
feat(AreaChart): Support radial and better handle y0/y1 with series
techniq Sep 5, 2024
ce8fd20
Fix overlooked axisBottom => xAxis
techniq Sep 5, 2024
1a01226
fix(Highlight): Handle non-zero y values when drawing lines (ex. radi…
techniq Sep 6, 2024
708f8b5
fix(Highlight): Handle null value points
techniq Sep 6, 2024
0e75096
fix(Spline): Handle null data via defined by default
techniq Sep 6, 2024
f2bd001
fix(Area): Handle null data via defined by default
techniq Sep 6, 2024
0d4fbfe
Rename `before-marks`/`after-marks` to `below-marks`/`above-marks` to…
techniq Sep 6, 2024
8ff333b
Add pengiun example dataset
techniq Sep 7, 2024
adea4cf
feat(TooltipHeader): Support color swatch
techniq Sep 7, 2024
7ef6800
feat(Chart): Expose `config` as slot prop
techniq Sep 7, 2024
2fa18f9
feat(ScatterChart): Support series (with data)
techniq Sep 7, 2024
4425931
fix(ChartContext): Subscribe to chart config before passing to slot prop
techniq Sep 7, 2024
d24c5c4
docs(ScatterChart): Set custom tooltip example chart height to match …
techniq Sep 7, 2024
f16c81d
fix(Points): Remove incorrect points for null/undefined values
techniq Sep 7, 2024
7c0fc28
feat(AreaChart): Support series data and points prop
techniq Sep 8, 2024
451e00c
feat(AreaChart): Allow series.key as fallback for label and value, an…
techniq Sep 8, 2024
3e9b7c3
feat(LineChart): Support series.data and s.key. Cleanup/refine docs
techniq Sep 8, 2024
97a8210
docs(LineChart): Radar with series data
techniq Sep 8, 2024
861c81a
fix(cartesianToPolar): Correctly calculate angle/radians between 0 an…
techniq Sep 8, 2024
ba5c262
feat(tooltip): Update bisect-x mode to support radial coordinates
techniq Sep 8, 2024
576c2ee
Use `scaleTime()` (default) instead of `scaleUtc()` to fix axis forma…
techniq Sep 8, 2024
578ef98
feat(BarChart): Support series.data and s.key. Cleanup/refine docs
techniq Sep 9, 2024
6ecbe23
docs(LineChart): Add more examples
techniq Sep 10, 2024
10961c5
docs(LineChart): Improve gradient encoding tooltip/highlight
techniq Sep 10, 2024
12996c1
refactor(Chart): No longer expose layout components (Svg, Canvas) fro…
techniq Sep 10, 2024
cdccab7
docs(BarChart): Increase height of horizontal series example
techniq Sep 10, 2024
af155a0
refactor: Use `xBaseline` / `yBaseline` instead of `xDomain` to `yDom…
techniq Sep 10, 2024
f401e70
docs(LineChart): Improve radial large series axis
techniq Sep 11, 2024
8ddc8a5
fix(Highlight): Handle null value for lines
techniq Sep 11, 2024
8e176b0
breaking(Threshold): Simplify implementation and rename `pathAbove`/`…
techniq Sep 11, 2024
f73f35b
fix(Points): Fix array values
techniq Sep 11, 2024
cf0adc4
docs(PieChart): Tweak arc example
techniq Sep 13, 2024
87524d0
feat(PieChart): Add Group to enable shifting all arcs (useful for arc…
techniq Sep 13, 2024
60e492a
docs(TranslucentGlobe): Update Tooltip
techniq Sep 13, 2024
d99a09a
feat(Chart): Support x1/y1 derived scales, useful for grouped bar cha…
techniq Sep 14, 2024
11c5878
feat(BarChart): Support "group" series layout (and replace `seriesSta…
techniq Sep 14, 2024
e71aaf1
Improve changesets
techniq Sep 15, 2024
370e4c3
feat(Chart): Expose x1Scale and y1Scale as slot props
techniq Sep 16, 2024
5a17a87
feat(ChartContext): Default x1Domain / y1Domain to extent of chart da…
techniq Sep 16, 2024
599d05e
docs: Simplify dual axis example with remapping scale by using y1Scale
techniq Sep 16, 2024
58b43a0
breaking: Add new color `cScale` (and related `c` accessor, domain, r…
techniq Sep 18, 2024
d859098
fix(ChartContext): Use distinct values for color domain
techniq Sep 20, 2024
57f94ee
Remove unused import
techniq Sep 20, 2024
f57b640
feat(PieChart): Add `series` support (and remove `separateTracks`)
techniq Sep 20, 2024
daedbe6
refactor(PieChart): Simplify single value use case and always guarant…
techniq Sep 20, 2024
dc94fba
refactor(Chart): Handle radial default xRange/yRange within Chart ins…
techniq Sep 21, 2024
36ad32c
Add another workaround for LayerCake typings to fix `svelte-check`
techniq Sep 21, 2024
6fa8be9
breaking(Pie): Remove `placement` prop and instead rely Svg `center` …
techniq Sep 21, 2024
be7a6de
fix(PieChart): Support passing explicit (>0) outerRadius for single a…
techniq Sep 21, 2024
05aa848
docs(Pie): Fix accidental search/replace
techniq Sep 21, 2024
967fb7b
docs(AreaChart): Use thresholdValue for Area y0 for better readability
techniq Sep 21, 2024
8de38b0
feat(Points): Integrate with rScale. Add support with ScatterChart
techniq Sep 21, 2024
6b4b164
docs(PieChart): Add "Single value gradient with text" example
techniq Sep 21, 2024
abb8b9c
feat: Support easy disabling axis on simplified charts, and add sparl…
techniq Sep 22, 2024
3c8fe19
feat(Bars): Support passing `data` override
techniq Sep 23, 2024
8dfaa74
feat(BarChart): Support passing series (long) data
techniq Sep 23, 2024
0008ee6
Add changeset for new simplified charts (AreaChart, BarChart, LineCha…
techniq Sep 23, 2024
79079d5
Tweak changeset
techniq Sep 23, 2024
12118fe
fix(Svg): Fix center reactivity with width/height changes
techniq Sep 23, 2024
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
5 changes: 5 additions & 0 deletions .changeset/chilly-years-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Bars): Support passing `data` override
5 changes: 5 additions & 0 deletions .changeset/cold-taxis-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Chart): Expose `config` as slot prop
5 changes: 5 additions & 0 deletions .changeset/cool-needles-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

feat: Add simplified charts to streamline creating common chart types with recommended conventions and granular extensibility (AreaChart, BarChart, LineChart, PieChart, and ScatterChart)
5 changes: 5 additions & 0 deletions .changeset/cuddly-avocados-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Bar): Forward pointer events to enable individual bar tooltips
5 changes: 5 additions & 0 deletions .changeset/eight-llamas-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Highlight): Handle non-zero y values when drawing lines (ex. radial line chart with inner radius)
5 changes: 5 additions & 0 deletions .changeset/empty-pianos-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Voronoi): Support radial coordinates. Issue #112
5 changes: 5 additions & 0 deletions .changeset/five-plums-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking(Tooltip): Rename Tooltip to Tooltip.Root
5 changes: 5 additions & 0 deletions .changeset/flat-ties-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

breaking(Bar/Bars): Replace groupBy/groupPadding with Chart-level x1/y1 derived scales
5 changes: 5 additions & 0 deletions .changeset/four-months-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Labels): Handle multiple x or y properties (stack, diverting) by leveraging Points component internally
5 changes: 5 additions & 0 deletions .changeset/four-rockets-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking(Tooltip): Remove default grid on Tooltip.Root and add Tooltip.List as Tooltip.Item container
5 changes: 5 additions & 0 deletions .changeset/fresh-houses-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking(Chart): Default domain sorting to `false` (instead of LayerCake's `true`) to simplify bandScale use cases
5 changes: 5 additions & 0 deletions .changeset/green-crews-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Points): Add `xValue` and `yValue` to each point, and improve types
5 changes: 5 additions & 0 deletions .changeset/grumpy-masks-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking(Tooltip): Consolidate Tooltip components (TooltipItem, TooltipSeparator, etc) to Tooltip.Item, Tooltip.Separtor, etc
5 changes: 5 additions & 0 deletions .changeset/hot-houses-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Highlight): Support radial coordiantes for `points` and `lines`. Issue #112
5 changes: 5 additions & 0 deletions .changeset/late-cheetahs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Spline): Handle null data via defined by default
5 changes: 5 additions & 0 deletions .changeset/little-geese-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Points): Add canvas support
5 changes: 5 additions & 0 deletions .changeset/long-crabs-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Chart): Expose `x`/`y`/`z`/`r` accessors via slot props
5 changes: 5 additions & 0 deletions .changeset/long-pugs-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(TooltipSeparator): Use theme color
5 changes: 5 additions & 0 deletions .changeset/lucky-tables-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

refactor: Add `@layerstack/svelte-actions`, `@layerstack/svelte-stores`, `@layerstack/tailwind`, and `@layerstack/utils` packages and move `svelte-ux` package to `devDependancies` (components only for docs)
5 changes: 5 additions & 0 deletions .changeset/mighty-teachers-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat: Rename `createStackData()` to `groupStackData()`, refine returned structure to simplify tooltips and make consistent with different options combinations, and add tests
5 changes: 5 additions & 0 deletions .changeset/neat-schools-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking: Remove `AreaStack` as use cases fully supported by `Area`
5 changes: 5 additions & 0 deletions .changeset/new-readers-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Labels): Support `center` placement (useful with Points)
5 changes: 5 additions & 0 deletions .changeset/polite-cooks-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

feat(Svg): Add `center` to conveniently center children, useful for radial layouts without requiring `Group` wrapper
5 changes: 5 additions & 0 deletions .changeset/polite-tools-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking: Remove <Tooltip.Root header={...}> and replace with <Tooltip.Header>
5 changes: 5 additions & 0 deletions .changeset/poor-hats-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking(Pie): Remove `placement` prop and instead rely Svg `center` or use `Group` for positioning
5 changes: 5 additions & 0 deletions .changeset/red-roses-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking: Add new color `cScale` (and related `c` accessor, domain, range, etc) and replace `rScale` usage (which should be used for radius, etc)
5 changes: 5 additions & 0 deletions .changeset/rotten-baboons-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Area): Handle null data via defined by default
5 changes: 5 additions & 0 deletions .changeset/rude-students-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(tooltip): Update bisect-x mode to support radial coordinates
5 changes: 5 additions & 0 deletions .changeset/seven-cars-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Highlight): Handle null value points
5 changes: 5 additions & 0 deletions .changeset/sharp-ways-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Voronoi): Dispatch custom `pointerevent` instead of forwarding to fix console errors
5 changes: 5 additions & 0 deletions .changeset/short-colts-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Points): Integrate with rScale
5 changes: 5 additions & 0 deletions .changeset/slimy-points-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Points): Remove incorrect points for null/undefined values
5 changes: 5 additions & 0 deletions .changeset/smooth-tomatoes-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': minor
---

breaking(Threshold): Simplify implementation and rename `pathAbove`/`pathBelow` slots to `above`/`below`
5 changes: 5 additions & 0 deletions .changeset/spotty-moles-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Area): Pass `x` override to internal Spline
5 changes: 5 additions & 0 deletions .changeset/stale-tools-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Spline): Enable passing `fill` prop (useful for Bar with single rounded edge)
5 changes: 5 additions & 0 deletions .changeset/twelve-otters-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Tooltip.Item): Support `color` prop to add swatch, support theme colors and any color via `color="variable"`
5 changes: 5 additions & 0 deletions .changeset/twenty-queens-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(cartesianToPolar): Correctly calculate angle/radians between 0 and 2π
5 changes: 5 additions & 0 deletions .changeset/weak-tigers-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Arc): Support passing `tooltip` and `data` props to simplify setting up tooltip pointer events
5 changes: 5 additions & 0 deletions .changeset/witty-goats-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(Chart): Support x1/y1 derived scales, useful for grouped bar charts
10 changes: 8 additions & 2 deletions packages/layerchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"prepublishOnly": "svelte-package",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "TZ=UTC-5 vitest",
"lint": "prettier --check .",
"format": "prettier --write .",
"prepare": "svelte-kit sync"
Expand Down Expand Up @@ -66,6 +67,7 @@
"svelte-check": "^3.8.5",
"svelte-json-tree": "^2.2.0",
"svelte-preprocess": "^6.0.2",
"svelte-ux": "^0.74.4",
"svelte2tsx": "^0.7.15",
"tailwindcss": "^3.4.10",
"topojson-client": "^3.1.0",
Expand All @@ -74,10 +76,15 @@
"typescript": "^5.5.4",
"unist-util-visit": "^5.0.0",
"us-atlas": "^3.0.1",
"vite": "^5.4.0"
"vite": "^5.4.0",
"vitest": "^2.0.5"
},
"type": "module",
"dependencies": {
"@layerstack/svelte-actions": "^0.0.3",
"@layerstack/svelte-stores": "^0.0.3",
"@layerstack/tailwind": "^0.0.5",
"@layerstack/utils": "^0.0.3",
"d3-array": "^3.2.4",
"d3-color": "^3.1.0",
"d3-delaunay": "^6.0.4",
Expand All @@ -102,7 +109,6 @@
"lodash-es": "^4.17.21",
"posthog-js": "^1.155.4",
"shapefile": "^0.6.6",
"svelte-ux": "^0.74.4",
"topojson-client": "^3.1.0"
},
"peerDependencies": {
Expand Down
22 changes: 21 additions & 1 deletion packages/layerchart/src/lib/components/Arc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import { chartContext } from './ChartContext.svelte';
import { motionStore } from '$lib/stores/motionStore.js';
import { degreesToRadians } from '$lib/utils/math.js';
import type { TooltipContextValue } from './tooltip/TooltipContext.svelte';

export let spring: boolean | Parameters<typeof springStore>[1] = undefined;
export let tweened: boolean | Parameters<typeof tweenedStore>[1] = undefined;
Expand Down Expand Up @@ -86,7 +87,7 @@
$: scale = scaleLinear().domain(domain).range(range);

function getOuterRadius(outerRadius: number | undefined, chartRadius: number) {
if (outerRadius == null) {
if (!outerRadius) {
return chartRadius;
} else if (outerRadius > 1) {
// discrete value
Expand Down Expand Up @@ -172,6 +173,16 @@
$: angle = ((startAngle ?? 0) + (endAngle ?? 0)) / 2;
$: xOffset = Math.sin(angle) * offset;
$: yOffset = -Math.cos(angle) * offset;

/**
* Tooltip context to setup pointer events to show tooltip for related data. Must set `data` prop as well
*/
export let tooltip: TooltipContextValue | undefined = undefined;

/**
* Data to set when showing tooltip
*/
export let data: any = undefined;
</script>

{#if track}
Expand All @@ -188,6 +199,15 @@
d={arc()}
transform="translate({xOffset}, {yOffset})"
{...$$restProps}
on:pointerenter={(e) => tooltip?.show(e, data)}
on:pointermove={(e) => tooltip?.show(e, data)}
on:pointerleave={(e) => tooltip?.hide()}
on:touchmove={(e) => {
if (tooltip) {
// Prevent touch to not interfer with pointer when using tooltip
e.preventDefault();
}
}}
on:click
on:pointerenter
on:pointermove
Expand Down
Loading