fix(Link): remove validity bypass that renders invalid coordinates#546
Conversation
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Agent-Logs-Url: https://github.com/svelteplot/svelteplot/sessions/499416d6-f85d-42f7-8036-55fc7fbfcdfc Co-authored-by: gka <617518+gka@users.noreply.github.com>
561926f to
64ab19f
Compare
There was a problem hiding this comment.
💡 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".
| <g class={['link', className]} data-use-x={usedScales.x ? 1 : 0}> | ||
| {#each scaledData as d, i (i)} | ||
| {#if d.valid || true} | ||
| {#if d.valid} |
There was a problem hiding this comment.
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 👍 / 👎.
Link.sveltehad{#if d.valid || true}— the|| truemade 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 withExpected numbererrors.Change
Link.svelte:187:{#if d.valid || true}→{#if d.valid}, matching the guard pattern already used byDotandTextmarks.