Skip to content

types: fix issues in lib/core and Mark + Plot#491

Merged
gka merged 1 commit into
mainfrom
types/fix-core-issues
Feb 23, 2026
Merged

types: fix issues in lib/core and Mark + Plot#491
gka merged 1 commit into
mainfrom
types/fix-core-issues

Conversation

@gka

@gka gka commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Fixes svelte-check errors in the core plot infrastructure files.

Changes

  • src/lib/Mark.svelteas any casts for dynamic channel/property indexing, structural type fix for Mark generic, null-safe record initialization, corrected resolveChannel and projectXY call signatures
  • src/lib/core/Plot.svelte(error as Error).message in catch blocks, null-coalescing for nullable numeric fields, casts for dynamic scale key indexing and mergeDeep args
  • src/lib/core/FacetAxes.sveltefxValues as string[] for scaleBand domain, casts for tickFormat and scaleFn, handle axis === 'both' anchor case
  • src/lib/core/FacetGrid.sveltefxValues as string[], fyValues as string[], facetX as string, facetY as string
  • src/lib/Plot.svelteprojection as any for .type access, casts for string scale key indexing, nullundefined for snippet props, (error as Error).message
  • src/lib/types/plot.ts — type improvements to support the above fixes

resolves #407
resolves #408
resolves #410
resolves #411
resolves #412

🤖 Generated with Claude Code

@netlify

netlify Bot commented Feb 23, 2026

Copy link
Copy Markdown

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 93c64e7
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/699cdda6e742e700081ac5f3
😎 Deploy Preview https://deploy-preview-491--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

📦 Preview package for this PR is published!

Version: 0.10.3-pr-491.0

Install it with:

npm install svelteplot@pr-491
# or install the specific version
npm install svelteplot@0.10.3-pr-491.0

@gka gka merged commit 7ffc1ca into main Feb 23, 2026
9 checks passed
@gka gka deleted the types/fix-core-issues branch February 23, 2026 23:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93c64e7268

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/core/Plot.svelte
Comment on lines +297 to +298
facetWidth: facetWidth ?? undefined,
facetHeight: facetHeight ?? undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep facet dimensions numeric in initial plot state

Coalescing facetWidth/facetHeight to undefined here makes the initial PlotState carry non-numeric dimensions until updateDimensions runs. Several mark components immediately do arithmetic with these fields (for example Math.round(plot.facetWidth / tickSpacing) in AxisX.svelte and coordinate sums like marginLeft + plot.facetWidth), so first render—and SSR where effects do not execute—can yield NaN ticks/coordinates and missing SVG output. Preserve numeric defaults (e.g. 0) in computePlotState instead of undefined.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant