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

Skip to content

Conversation

@rgieseke
Copy link
Contributor

Error was

`/layercake/src/routes/_examples/Histogram.svelte:56:61
Error: Type '(d: any) => number' is not assignable to type '(d: any) => string'.
  Type 'number' is not assignable to type 'string'. (js)
		<Svg>
			<AxisX gridlines={false} baseline ticks={slimThresholds} format={d => +f(d)} />

/layercake/src/routes/_examples_ssr/Histogram.svelte:52:56
Error: Type '(d: any) => number' is not assignable to type '(d: any) => string'.
  Type 'number' is not assignable to type 'string'. (js)
		<Html>
			<AxisX gridlines={false} baseline ticks={slimSteps} format={d => +f(d)} />

This PR removes the conversion to number.

@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

@rgieseke
Copy link
Contributor Author

Seems it does make a difference in the formatting, e.g. 1.6 vs 1.60. I'll run the update snapshot workflow for this branch.

@mhkeller
Copy link
Owner

Let's do String(+f(d)) to preserve the formatting but keep it as a string type.

@rgieseke rgieseke force-pushed the remove-extra-conversion branch from 019eadc to a3437d2 Compare August 24, 2025 19:49
@rgieseke
Copy link
Contributor Author

Let's do String(+f(d)) to preserve the formatting but keep it as a string type.

Done!

@mhkeller mhkeller merged commit 3c1f591 into mhkeller:main Aug 25, 2025
6 checks passed
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