diff --git a/package.json b/package.json index 993b2ff8..7edd672f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,10 @@ "@sveltejs/package": "^2.5.7", "@sveltejs/vite-plugin-svelte": "^7.2.0", "@types/d3": "^7.4.3", + "@types/d3-hierarchy": "^3.1.7", "@types/d3-sankey": "^0.12.4", + "@types/d3-scale": "^4.0.9", + "@types/d3-shape": "^3.1.8", "@types/markdown-it": "^14.1.2", "@types/node": "^26.1.1", "d3-collection": "^1.0.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd9a2d09..813a2102 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,9 +42,18 @@ importers: '@types/d3': specifier: ^7.4.3 version: 7.4.3 + '@types/d3-hierarchy': + specifier: ^3.1.7 + version: 3.1.7 '@types/d3-sankey': specifier: ^0.12.4 version: 0.12.5 + '@types/d3-scale': + specifier: ^4.0.9 + version: 4.0.9 + '@types/d3-shape': + specifier: ^3.1.8 + version: 3.1.8 '@types/markdown-it': specifier: ^14.1.2 version: 14.1.2 diff --git a/src/_components/CirclePack.html.svelte b/src/_components/CirclePack.html.svelte index 82836567..9b01d7d1 100644 --- a/src/_components/CirclePack.html.svelte +++ b/src/_components/CirclePack.html.svelte @@ -12,7 +12,7 @@ const { width, height, data } = getContext('LayerCake'); - /** @typedef {import('d3-hierarchy').HierarchyNode} HierarchyNode */ + /** @typedef {import('d3-hierarchy').HierarchyNode} HierarchyNode */ /** * @typedef {Object} Props diff --git a/src/_components/Sankey.svelte b/src/_components/Sankey.svelte index cc281a69..9e3ee6fd 100644 --- a/src/_components/Sankey.svelte +++ b/src/_components/Sankey.svelte @@ -17,11 +17,11 @@ * )} SankeyAlignment */ - /** @typedef {import('d3-sankey').SankeyGraph} SankeyGraph */ + /** @typedef {import('d3-sankey').SankeyGraph} SankeyGraph */ - /** @typedef {import('d3-sankey').SankeyNodeMinimal} SankeyNodeMinimal */ + /** @typedef {import('d3-sankey').SankeyNodeMinimal} SankeyNodeMinimal */ - /** @typedef {import('d3-sankey').SankeyLinkMinimal} SankeyLink */ + /** @typedef {import('d3-sankey').SankeyLinkMinimal} SankeyLink */ /** * @typedef {((a: SankeyLink, b: SankeyLink) => (number | undefined | null))} LinkSortFunction @@ -35,7 +35,7 @@ * @property {number} [nodeWidth=5] - The width of each node, in pixels, passed to [`sankey.nodeWidth`](https://github.com/d3/d3-sankey#sankey_nodeWidth). * @property {number} [nodePadding=10] - The padding between nodes, passed to [`sankey.nodePadding`](https://github.com/d3/d3-sankey#sankey_nodePadding). * @property {LinkSortFunction|undefined} [linkSort] - How to sort the links, passed to [`sankey.linkSort`](https://github.com/d3/d3-sankey#sankey_linkSort). - * @property {(SankeyNodeMinimal) => number | string} [nodeId=(d) => d.id] - The ID field accessor, passed to [`sankey.nodeId`](https://github.com/d3/d3-sankey#sankey_nodeId). + * @property {(d: SankeyNodeMinimal) => number | string} [nodeId=(d) => d.id] - The ID field accessor, passed to [`sankey.nodeId`](https://github.com/d3/d3-sankey#sankey_nodeId). * @property {SankeyAlignment} [nodeAlign=Sankey.sankeyLeft] - An alignment function to position the Sankey blocks. See the [d3-sankey documentation](https://github.com/d3/d3-sankey#alignments) for more. */ diff --git a/test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-Sankey-svelte-1.aria.yml b/test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-Sankey-svelte-1.aria.yml index 121fc018..a7777285 100644 --- a/test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-Sankey-svelte-1.aria.yml +++ b/test/e2e/component-properties-table.spec.js-snapshots/Property-table-content-for-components-Sankey-svelte-1.aria.yml @@ -73,11 +73,11 @@ - /url: https://github.com/d3/d3-sankey#sankey_linkSort - code: sankey.linkSort - text: "" - - row "nodeId ((SankeyNodeMinimal) => number | string) d => d.id no The ID field accessor, passed to sankey.nodeId.": - - cell "nodeId ((SankeyNodeMinimal) => number | string)": + - 'row "nodeId ((d: SankeyNodeMinimal) => number | string) d => d.id no The ID field accessor, passed to sankey.nodeId."': + - 'cell "nodeId ((d: SankeyNodeMinimal) => number | string)"': - strong: nodeId - text: "" - - code: (SankeyNodeMinimal) => number + - code: "(d: SankeyNodeMinimal) => number" - text: "" - code: string - text: ""