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
5 changes: 5 additions & 0 deletions .changeset/every-sheep-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

Update dependencies
5 changes: 5 additions & 0 deletions .changeset/soft-pens-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix: Update `dagreAncestors()` and `dagreDescendants()` util types
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"up-deps": "pnpm update -r -i --latest"
},
"devDependencies": {
"@changesets/cli": "2.29.4",
"@changesets/cli": "2.29.6",
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
"rimraf": "6.0.1",
"wrangler": "^4.20.0"
"wrangler": "^4.30.0"
},
"packageManager": "[email protected]"
}
3 changes: 0 additions & 3 deletions packages/layerchart/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,6 @@
- breaking(Bar|Bars): Replaced `inset: number` prop with `insets: Insets | undefined`. ([#321](https://github.com/techniq/layerchart/pull/321))

To migrate from `inset` to `insets` replace `inset = n` with:

- `insets = { x: n / 2 }` if `orientation="vertical"`
- `insets = { y: n / 2 }` if `orientation="horizontal"`

Expand Down Expand Up @@ -2029,7 +2028,6 @@
```

**Additional**

- Rename tooltipContext's `top`/`left` to `x`/`y`
- Add `anchor` prop to align based on corner/edge/center (9 points) of tooltip instead of always top-left corner.
- Add more tooltip examples
Expand Down Expand Up @@ -2159,7 +2157,6 @@
- Remove `ConnectedPoints` component and replace with `links` prop on `<Points>` ([`f514bb6`](https://github.com/techniq/layerchart/commit/f514bb69fa99c6243958cf9a620ca24a137b1d6d))

- Highlight overhaul ([`d9dd4bf`](https://github.com/techniq/layerchart/commit/d9dd4bf38f17530950d29eb6edff400a7d6dff02))

- Consolidate HighlightLine and HighlightRect
- Support enabling `points`, `lines`, and `area` individually
- Support passing props to underlying Line, Circle, and Rect
Expand Down
41 changes: 20 additions & 21 deletions packages/layerchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"prepare": "svelte-kit sync"
},
"devDependencies": {
"@changesets/cli": "^2.29.4",
"@iconify-json/lucide": "^1.2.48",
"@changesets/cli": "^2.29.6",
"@iconify-json/lucide": "^1.2.62",
"@rollup/plugin-dsv": "^3.0.5",
"@sveltejs/adapter-cloudflare": "^7.0.4",
"@sveltejs/kit": "^2.21.5",
"@sveltejs/package": "^2.3.11",
"@sveltejs/vite-plugin-svelte": "^5.1.0",
"@sveltejs/adapter-cloudflare": "^7.2.1",
"@sveltejs/kit": "^2.31.1",
"@sveltejs/package": "^2.4.1",
"@sveltejs/vite-plugin-svelte": "^6.1.2",
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
"@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.1.10",
"@tailwindcss/vite": "^4.1.12",
"@types/d3": "^7.4.3",
"@types/d3-array": "^3.2.1",
"@types/d3-color": "^3.1.3",
Expand All @@ -52,36 +52,35 @@
"@types/topojson-client": "^3.1.5",
"@types/topojson-simplify": "^3.0.3",
"@types/topojson-specification": "^1.0.5",
"marked": "^15.0.12",
"mdsvex": "^0.12.3",
"posthog-js": "^1.252.0",
"prettier": "^3.5.3",
"posthog-js": "^1.260.1",
"prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.4.0",
"rehype-slug": "^6.0.0",
"rollup-plugin-visualizer": "^6.0.3",
"shapefile": "^0.6.6",
"shiki": "^3.9.2",
"solar-calculator": "^0.3.0",
"svelte": "5.34.1",
"svelte-check": "^4.2.1",
"svelte": "^5.38.2",
"svelte-check": "^4.3.1",
"svelte-json-tree": "^2.2.0",
"svelte-ux": "2.0.0-next.17",
"svelte2tsx": "^0.7.39",
"tailwindcss": "^4.1.10",
"svelte2tsx": "^0.7.42",
"tailwindcss": "^4.1.12",
"topojson-client": "^3.1.0",
"topojson-simplify": "^3.0.3",
"tslib": "^2.8.1",
"typescript": "^5.8.3",
"typescript": "^5.9.2",
"unist-util-visit": "^5.0.0",
"unplugin-icons": "^22.1.0",
"unplugin-icons": "^22.2.0",
"us-atlas": "^3.0.1",
"vite": "^6.3.5",
"vite-plugin-devtools-json": "^0.2.0",
"vitest": "^3.2.3"
"vite": "^7.1.2",
"vite-plugin-devtools-json": "^1.0.0",
"vitest": "^3.2.4"
},
"type": "module",
"dependencies": {
"@dagrejs/dagre": "^1.1.4",
"@dagrejs/dagre": "^1.1.5",
"@layerstack/svelte-actions": "1.0.1-next.14",
"@layerstack/svelte-state": "0.1.0-next.19",
"@layerstack/tailwind": "2.0.0-next.17",
Expand All @@ -107,7 +106,7 @@
"d3-time": "^3.1.0",
"lodash-es": "^4.17.21",
"memoize": "^10.1.0",
"runed": "^0.28.0"
"runed": "^0.31.1"
},
"peerDependencies": {
"svelte": "^5.0.0"
Expand Down
16 changes: 7 additions & 9 deletions packages/layerchart/src/lib/utils/graph/dagre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,43 +109,41 @@ export function dagreGraph(
}

/**
* Get all upstream predecessors for dagre nodeId
* Get all upstream predecessors ids for dagre nodeId
*/
export function dagreAncestors(
graph: dagre.graphlib.Graph,
nodeId: string,
maxDepth = Infinity,
currentDepth = 0
): dagre.Node[] {
): string[] {
if (currentDepth === maxDepth) {
return [];
}

const predecessors = graph.predecessors(nodeId) ?? [];
return [
...predecessors,
// @ts-expect-error: Types from dagre appear incorrect
...predecessors.flatMap((pId) => dagreAncestors(graph, pId, maxDepth, currentDepth + 1)),
];
}

/**
* Get all downstream descendants for dagre nodeId
* Get all downstream descendants ids for dagre nodeId
*/
export function dagreDescendants(
graph: dagre.graphlib.Graph,
nodeId: string,
maxDepth = Infinity,
currentDepth = 0
): dagre.Node[] {
): string[] {
if (currentDepth === maxDepth) {
return [];
}

const predecessors = graph.successors(nodeId) ?? [];
const successors = graph.successors(nodeId) ?? [];
return [
...predecessors,
// @ts-expect-error: Types from dagre appear incorrect
...predecessors.flatMap((pId) => dagreDescendants(graph, pId, maxDepth, currentDepth + 1)),
...successors,
...successors.flatMap((pId) => dagreDescendants(graph, pId, maxDepth, currentDepth + 1)),
];
}
2 changes: 1 addition & 1 deletion packages/layerchart/src/lib/utils/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function stackOffsetSeparated(series, order) {

// Standard series
for (var i = 1, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
(s0 = s1), (s1 = series[order[i]]);
((s0 = s1), (s1 = series[order[i]]));
// @ts-expect-error
let base = max(s0, (d) => d[1]) + gap; // here is where you calculate the maximum of the previous layer
for (var j = 0; j < m; ++j) {
Expand Down
27 changes: 0 additions & 27 deletions packages/layerchart/src/routes/changelog/+page.svelte

This file was deleted.

7 changes: 0 additions & 7 deletions packages/layerchart/src/routes/changelog/+page.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/layerchart/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const config = {
},
},
}),
// @ts-expect-error
devtoolsJson(),
// Needs to be last
visualizer({
Expand Down
Loading