Skip to content

Feat/part 2 878 - #883

Open
lee00678 wants to merge 6 commits into
mainfrom
feat/part-2-878
Open

Feat/part 2 878#883
lee00678 wants to merge 6 commits into
mainfrom
feat/part-2-878

Conversation

@lee00678

@lee00678 lee00678 commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

What & why

part 2 of #878

All code has been reviewed

Checklist

  • Dev examples
  • Dev gallery examples (pnpm dev:gallery)
  • Wrappers (regenerated via pnpm generate)
  • Gallery example
  • Docs
  • Lint passes on the files I changed
  • Builds locally (pnpm build)
  • All commands pass (pnpm cmds-report) -- report passes

Screenshots / recordings

rokotyan and others added 6 commits August 13, 2026 13:15
setData assigned the new data to the data model before comparing, so the
change check compared the data with itself and never fired: the tooltip and
crosshair were never hidden on data updates. The previous reference is now
captured before assignment and compared by reference, which also removes a
full deep-equality walk of the dataset on every setData call.

isEqual() also gained a reference short-circuit for identical inputs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…urce leaks

ComponentCore.destroy() now invokes a protected _onDestroy() hook (and is
idempotent), giving components a place to release timers, animation frames,
observers and global listeners:

- Graph: stop the 35ms link-flow interval timer (previously it kept firing
  forever after destroy, retaining the whole component); remove the window
  keydown/keyup listeners and namespace them per instance uid so multiple
  graphs no longer override each other's shift-brush handlers
- Crosshair: cancel the pending render animation frame and detach container
  mouse/wheel listeners
- Axis: cancel the pending tick label collision detection frame
- TopoJSONMap, LeafletMap: convert destroy() overrides that skipped
  super.destroy() (leaving isDestroyed() false and DOM attached) into
  _onDestroy() implementations
- LeafletFlowMap: destroy the internal LeafletMap instance, which was
  previously never cleaned up

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dratic scans

Processing data in the setter previously ran several O(n^2) passes: multi-link
detection filtered all links per link, per-node link lists filtered all links
per node, state transfer scanned previous items per item, and link endpoint
resolution scanned all nodes per endpoint (with a deep-equality comparison for
object identifiers). Large graphs spent seconds of main-thread time in setData.

All passes are now linear: links are grouped by canonical node-pair key,
node link lists and previous-state lookups use maps, and string/object node
identifiers resolve through id and reference indexes (keeping the deep-equality
scan only as a fallback for value-equal object identifiers).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Component event dispatch collected the matched elements with selection.nodes()
inside every event handler invocation; the elements are now snapshotted once
at bind time (events are re-bound after every render, so the snapshot stays
in sync).

The tooltip's delegated mousemove handler queried all trigger elements for
every configured trigger on every mouse movement; it now only queries them
after an event-path match, when the element index is actually needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…er of configs

updateComponents matches configs to components positionally, so reordering or
inserting a component silently mis-assigns configs. A console warning now
surfaces the mismatch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SingleContainer hid the tooltip on every setData call (even with
preventRender), while XYContainer only hid it on data changes and never on
resize. Both containers now hide the tooltip (and XYContainer the crosshair)
when the data actually changes and when the container is resized.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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