Skip to content

fix(Link): remove validity bypass that renders invalid coordinates#546

Merged
gka merged 1 commit into
mainfrom
copilot/fix-link-mark-invalid-coordinates
Apr 8, 2026
Merged

fix(Link): remove validity bypass that renders invalid coordinates#546
gka merged 1 commit into
mainfrom
copilot/fix-link-mark-invalid-coordinates

Conversation

Copilot AI commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Link.svelte had {#if d.valid || true} — the || true made the guard a no-op, rendering all links unconditionally. When coordinates are NaN (e.g. during hierarchy layout transitions), d3 produces invalid SVG paths, flooding the console with Expected number errors.

Change

  • Link.svelte:187: {#if d.valid || true}{#if d.valid}, matching the guard pattern already used by Dot and Text marks.

@netlify

netlify Bot commented Apr 8, 2026

Copy link
Copy Markdown

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 64ab19f
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/69d65bfd70dd75000834a18e
😎 Deploy Preview https://deploy-preview-546--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.

Copilot AI changed the title [WIP] Fix link mark rendering with invalid coordinates fix(Link): remove validity bypass that renders invalid coordinates Apr 8, 2026
Copilot finished work on behalf of gka April 8, 2026 13:43
Copilot AI requested a review from gka April 8, 2026 13:43
@gka gka marked this pull request as ready for review April 8, 2026 13:45
@gka gka force-pushed the copilot/fix-link-mark-invalid-coordinates branch from 561926f to 64ab19f Compare April 8, 2026 13:45

@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: 64ab19fd36

ℹ️ 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/marks/Link.svelte
<g class={['link', className]} data-use-x={usedScales.x ? 1 : 0}>
{#each scaledData as d, i (i)}
{#if d.valid || true}
{#if d.valid}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve projected links while validity uses wrong channels

This new guard drops valid projected Link data that uses x1/y1/x2/y2 (the normal API, including src/routes/examples/link/spherical-link.svelte). In Mark.svelte's projection path, out.valid for suffixed coordinates is still evaluated against row.x/row.y rather than row.x1/row.y1/row.x2/row.y2, so these records evaluate as invalid even when their link endpoints are valid; previously the || true bypass allowed them to render. With this change, those links disappear entirely, so the validity logic needs to be corrected (or this guard relaxed for projected links) before removing the bypass.

Useful? React with 👍 / 👎.

@gka gka merged commit 0ede724 into main Apr 8, 2026
10 checks passed
@gka gka deleted the copilot/fix-link-mark-invalid-coordinates branch April 8, 2026 13:53
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.

Link mark renders with invalid coordinates due to validity bypass

2 participants