Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rgieseke
Copy link
Contributor

@rgieseke rgieseke commented Aug 19, 2025

An attempt to handle some D3 related type errors, for the Radar component I didn't find a solution but found other projects silencing it like below with ts-expect-error as well.

layercake/src/_components/Sankey.svelte:41:5
Error: Property 'nodeWidth' does not exist on type '{ (...args: any[]): { nodes: any; links: any; }; update(graph: any): any; nodeId(_: any, ...args: any[]): ... | ((d: any) => any); nodeAlign(_: any, ...args: any[]): ... | ((node: any, n: any) => any); ... 8 more ...; iterations(_: any, ...args: any[]): number | ...; } | ((node: any, n: any) => any)'.
  Property 'nodeWidth' does not exist on type '(node: any, n: any) => any'. (js)
			.nodeAlign(nodeAlign)
			.nodeWidth(nodeWidth)
--

layercake/src/_components/Sankey.svelte:55:21
Error: Property 'links' does not exist on type '{}'. (js)
	<g class="link-group">
		{#each sankeyData.links as d}
			<path
--

layercake/src/_components/Sankey.svelte:66:21
Error: Property 'nodes' does not exist on type '{}'. (js)
	<g class="rect-group">
		{#each sankeyData.nodes as d}
			<rect x={d.x0} y={d.y0} height={d.y1 - d.y0} width={d.x1 - d.x0} fill={colorNodes(d)} />
--

/layercake/src/_components/Radar.svelte:40:17
Error: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. (js)
			.curve(curveCardinalClosed)
			.x((d, i) => d * Math.cos(angleSlice * i - Math.PI / 2))
			.y((d, i) => d * Math.sin(angleSlice * i - Math.PI / 2))
--

/layercake/src/_components/Radar.svelte:41:17
Error: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. (js)
			.x((d, i) => d * Math.cos(angleSlice * i - Math.PI / 2))
			.y((d, i) => d * Math.sin(angleSlice * i - Math.PI / 2))
	);
--
/layercake/src/_components/CirclePack.html.svelte:74:12
Error: Argument of type 'Function' is not assignable to parameter of type '(a: HierarchyNode<HierarchyNode<any>>, b: HierarchyNode<HierarchyNode<any>>) => number'.
  Type 'Function' provides no match for the signature '(a: HierarchyNode<HierarchyNode<any>>, b: HierarchyNode<HierarchyNode<any>>): number'. (js)
					})
					.sort(sortBy)

@github-actions
Copy link
Contributor

🎭 Playwright tests failed

The Playwright tests failed on this PR. Please check the test results and fix any issues.

📊 View full test report

@mhkeller mhkeller merged commit 18da555 into mhkeller:main Aug 19, 2025
6 checks passed
@rgieseke rgieseke deleted the silence-d3-type-errors branch August 19, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants