Skip to content

React 19, @dracor/react, sigma v3#80

Open
cmil wants to merge 13 commits into
mainfrom
v3
Open

React 19, @dracor/react, sigma v3#80
cmil wants to merge 13 commits into
mainfrom
v3

Conversation

@cmil

@cmil cmil commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

Bumps ezlinavis to a modern stack:

  • React 16 → 19, class components → function components + TypeScript.
  • Bootstrap 3 / react-bootstrap → Tailwind v4 + @dracor/react + Headless UI.
  • react-sigma 1.x → sigma v3 + graphology + @react-sigma/core with four layouts (NOverlap, ForceAtlas2, Force, Circular).
  • Pure logic extracted to src/lib/ with Vitest coverage; ESLint + typecheck + tests wired up.
  • CI switched to node-version: lts/*.

ForceLink is gone (no direct equivalent); Force is the closest replacement.

Test plan

  • Load each entry from the Examples menu; graph renders immediately.
  • Switch between all four graph layouts.
  • Type into the textarea; parse and graph update after ~500 ms.
  • Download CSV; verify content on a known example.
  • Open the About dialog; close via button, backdrop, and Esc.
  • Zoom / pan the graph, then load a different example — camera resets.

@cmil cmil changed the title v3.0.0: React 19, @dracor/react, sigma v3 React 19, @dracor/react, sigma v3 Jul 11, 2026
cmil and others added 13 commits July 12, 2026 12:43
Green baseline for the v3.0.0 migration: introduce TS + Vitest without
touching any runtime code. Converts vite.config and eslint.config to TS,
adds tsconfig.json, wires up jsdom-based Vitest with jest-dom matchers.
Fixes two pre-existing lint errors surfaced by the updated globals
package.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move getCharacters, getCooccurrences, makeCsv, and the nearley parser
wrapper out of EzlinavisComponent into src/lib/ as strictly-typed TS,
with unit tests. Add ambient declaration for the generated grammar.js
and @types/nearley for parser types. The parseList tests also smoke-run
every bundled example under public/examples/. EzlinavisComponent still
class-based and still wired to react-sigma — component refactor comes
in the next step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
All components moved from class-based JSX to function-based TSX with
hooks (useState, useCallback, useMemo). Entrypoint renamed
src/index.jsx to src/main.tsx and referenced from index.html. The stale
CRA smoke test (src/App.test.jsx) is deleted; prop-types is no longer
imported anywhere.

Staying on React 16 for now: react-bootstrap 0.31 and react-sigma 1.x
are still in place. Ambient module declarations in src/legacy-shims.d.ts
cover those untyped libs until they are removed in the next step.

Tooling: TypeScript pinned to 6.0 (7.x breaks typescript-estree),
typescript-eslint added, @types/react{,-dom} pinned to 16 to match
runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Big consolidated step for the v3.0.0 track:

- React 16 to 19; main.tsx now uses createRoot.
- Drop react-bootstrap 0.31 + Bootstrap 3 CDN. Adopt Tailwind v4 via
  @tailwindcss/vite and @dracor/react's dracor.css theme. Delete
  App.css / EzlinavisComponent.css — all layout is now inline Tailwind.
- Info modal reimplemented with Headless UI Dialog. Examples/Graph
  dropdowns rewritten with Headless UI Menu (skipping @dracor/react's
  NavBar since it requires @tanstack/react-router which we do not need).
- CSV download uses @dracor/react's DownloadButton.
- react-debounce-input replaced by a small useDebouncedValue hook, and
  ListInputComponent is now a plain controlled textarea; debouncing
  lives in the parent so the parse/graph pipeline reacts on a settled
  value.
- react-sigma 1.x replaced by sigma v3 + graphology + @react-sigma/core,
  with worker-based ForceAtlas2 and Noverlap layouts. ForceLink dropped
  (no direct equivalent in the graphology ecosystem).
- legacy-shims.d.ts removed; eslint-plugin-react-hooks added.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Anchor the app to the dynamic viewport height (h-dvh) on the outer
  container instead of chaining height: 100% through html/body/#root.
- Add min-h-0 + overflow-hidden on the columns row so the sigma canvas
  (which rounds up by 1-2px on high-DPR displays) can't push the flex
  parent past the viewport.
- overscroll-behavior: none on html/body kills the macOS/iOS rubber-band
  bounce.
- Drop the redundant wrapper in App.tsx.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch the CSV column from absolute positioning to a flex-col layout so
the DraCor DownloadButton sits on its own row above the CSV preview.
Shrink the button's icon from w-14 to w-8 via a descendant selector and
add a "Download CSV" tooltip.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both worker-based layouts kept spinning forever, leaving nodes jittering
even after the graph had converged. Auto-stop each after a fixed
duration (2s for both) and re-trigger on scene changes so new example
loads still animate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Selecting an example was letting the old graph linger for 500ms while
the debounce hook caught up. Replace the useDebouncedValue hook with an
inline setTimeout so example loads (and any other programmatic text
change) can flush immediately while user typing stays debounced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sigma preserves camera state across loadGraph calls, so zoom and pan
persisted when switching examples. Reset to the default view whenever
scenes change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Shrink padding and font size, raise the max height to 80vh so the full
list of examples is visible without scrolling on a typical viewport.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bring back a spring-embedded option (Force, the modern equivalent of
the old ForceLink) and add a Circular layout for small networks where
you want every pairwise edge visible.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <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.

1 participant