Add SeqSee output format for charting#265
Conversation
Add a `SeqSeeBackend` implementing the charting `Backend` trait that emits JSON conforming to the SeqSee schema (https://github.com/JoeyBF/SeqSee). SeqSee is a generic spectral sequence visualizer that consumes such JSON and renders a self-contained interactive HTML chart. The backend buffers nodes and edges in memory (since the JSON groups all nodes and all edges, whereas the trait callbacks interleave them) and writes the document on drop, mirroring how the SVG/TikZ backends finalize output. Grid lines and axis labels are no-ops because SeqSee draws its own grid from the chart dimensions. Differentials (styles matching `d<page>`) are colored to match the other backends; every referenced style is registered as an attribute alias so the output validates against the schema. The `chart` example now prompts for the output format (svg/tikz/seqsee) and dispatches to the corresponding backend. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CHkHh9W7nnkiM2Z6fhdHPw
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe charting crate adds a ChangesSeqSee JSON charting
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ChartExample
participant SeqSeeBackend
participant Stdout
User->>ChartExample: choose output format
ChartExample->>SeqSeeBackend: construct backend for seqsee
ChartExample->>SeqSeeBackend: write graph nodes and edges
SeqSeeBackend->>Stdout: emit SeqSee JSON
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Move the `Drop` impl above the test module to satisfy `clippy::items_after_test_module`, and apply nightly rustfmt formatting to the chart example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CHkHh9W7nnkiM2Z6fhdHPw
- Derive node ids from `BidegreeGenerator`'s `Display` impl (`{:#}` →
`(x,y,idx)`) instead of a bespoke `node_id` helper, keeping node creation
and edge endpoints in sync.
- Make the `chart` example's format dispatch exhaustive with an explicit
`svg` arm and `unreachable!()`, since the format is already validated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CHkHh9W7nnkiM2Z6fhdHPw
The snapshot test compared the pretty-printed JSON as a string, which baked in a particular object key order. serde_json's `preserve_order` feature gets enabled through feature unification in the full-workspace test build (but not in an isolated `-p sseq` build), so the emitted key order — and thus the test outcome — differed between local and CI runs. Compare the parsed `serde_json::Value`s instead, which is independent of object key ordering. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CHkHh9W7nnkiM2Z6fhdHPw
Closes #191.
Summary
Adds a new charting backend that emits SeqSee-compatible JSON, alongside the existing SVG and TikZ backends. SeqSee is a generic spectral-sequence visualizer that consumes JSON conforming to its schema and renders a self-contained interactive HTML chart.
As #191 notes, this wasn't previously implementable because the
BackendAPI drew lines from raw coordinates rather than naming source/target nodes. The API has since gained a node-awarestructline(source, target, …)method, which this backend builds on.Changes
crates/sseq/src/charting/seqsee.rs— newSeqSeeBackend<T: Write>implementing theBackendtrait:Drop, since the schema groups all nodes together and all edges together whereas the trait callbacks interleave them (this mirrors how the SVG/TikZ backends finalize output)."x,y,idx", shared between node creation and edge endpoints.d<page>) are given a distinct color to match the other backends; every referenced style is registered as an attribute alias so the output validates against the schema.crates/sseq/src/charting/mod.rs— exportSeqSeeBackend.examples/chart.rs— prompt for the output format (svg/tikz/seqsee) and dispatch to the corresponding backend.Testing
cargo test -p sseqpasses, including a new snapshot test of the emitted JSON and a unit test for the differential-detection helper.cargo clippy -p sseqis clean.jsonschema.🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
New Features
Tests