-
-
Notifications
You must be signed in to change notification settings - Fork 13
Fix/axis types #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/axis types #121
Conversation
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.0 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.1 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.2 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.3 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.4 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.5 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.6 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.7 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.8 |
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-121
# or install the specific version
npm install svelteplot@0.3.5-pr-121.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes TypeScript import paths, adds a utility to enforce .js
extensions, and refines axis-related typings and styling.
- Updated all
$lib/types.js
imports to$lib/types/index.js
and added missing.js
extensions for relative imports - Adjusted
autoTimeFormat
to use thePlotScale
type and added explicit date casts - Added
tickFontSize
props inFacetAxes.svelte
and introduced a newcheck-js-extensions.js
script with a package.json command
Reviewed Changes
Copilot reviewed 20 out of 234 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
various src/lib/helpers/*.ts |
Fixed import paths from types.js to types/index.js |
various src/lib/helpers/*.test.ts |
Added .js to relative import statements |
src/lib/helpers/autoTimeFormat.ts | Changed parameter type to PlotScale and added date casts |
src/lib/core/FacetAxes.svelte | Introduced hardcoded tickFontSize={11} for both axes |
scripts/check-js-extensions.js | New script to detect missing .js extensions in imports |
package.json | Registered check-js-extensions in NPM scripts |
Comments suppressed due to low confidence (1)
scripts/check-js-extensions.js:1
- This new script currently has no test coverage; adding unit tests for its import-path matching logic would help catch edge cases and ensure consistent behavior in CI.
#!/usr/bin/env node
const daysPer100Px = | ||
((toNumber(x.domain[1]) - toNumber(x.domain[0])) / plotWidth / 864e5) * 100; | ||
((toNumber(x.domain[1] as Date) - toNumber(x.domain[0] as Date)) / plotWidth / 864e5) * 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using inline as Date
casts on x.domain
, consider parameterizing PlotScale
with a Date
generic (e.g., PlotScale<Date>
) to avoid type assertions and improve type safety.
Copilot uses AI. Check for mistakes.
@@ -36,6 +36,7 @@ | |||
scaleType="band" | |||
ticks={fxValues} | |||
tickFormat={(d) => d} | |||
tickFontSize={11} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The hardcoded font size (11
) is a magic number; consider making this configurable via a prop or theme token to improve flexibility and maintainability.
tickFontSize={11} | |
tickFontSize={tickFontSize} |
Copilot uses AI. Check for mistakes.
Uh oh!
There was an error while loading. Please reload this page.