Skip to content

Add Splom and Parcats trace types - #425

Merged
andrei-ng merged 2 commits into
plotly:mainfrom
dathere:feature/splom-parcats-traces
Jul 27, 2026
Merged

Add Splom and Parcats trace types#425
andrei-ng merged 2 commits into
plotly:mainfrom
dathere:feature/splom-parcats-traces

Conversation

@jqnatividad

Copy link
Copy Markdown
Contributor

Stacked on #423. This PR targets main but is built on top of #423's branch, so until #423 merges the diff below also shows its commits (Indicator/Histogram2d/Icicle + attribute backfill). Once #423 lands in main, this PR's diff auto-narrows to just the two new trace modules. Review the last commit (feat(traces): add Splom + Parcats trace types) for this PR's contribution.

Summary

Adds two typed traces to the plotly crate, following the established trace-struct recipe (FieldSetter derive + skip_serializing_none, mirroring sankey.rs):

  • Splom<V> — scatter-plot matrix. SplomDimension/SplomAxis/SplomDiagonal sub-structs, showupperhalf/showlowerhalf controls, reuses the common Marker. Plotly.js auto-generates the N×N axis grid, so callers don't assign explicit xaxis/yaxis ids.
  • Parcats<V> — parallel categories. ParcatsDimension/ParcatsLine sub-structs, counts per-path weighting (aggregated tuples instead of one row per record), domain-based like Sankey. Enums: ParcatsLineShape, ParcatsArrangement, ParcatsHoverOn, ParcatsSortPaths.

Both are additive, non-breaking public API.

Details

  • PlotType::{Splom, Parcats} serialize to "splom"/"parcats" via the existing rename_all = "lowercase" (same as Sankey).
  • Module + top-level re-exports wired through traces/mod.rs and lib.rs; CHANGELOG.md updated.
  • Every attribute was cross-checked against the bundled Plotly.js 3.7.0 schema. Notably: parcats hovertemplate is trace-level, and arrangement accepts perpendicular/freeform/fixed (all three included).

Note for reviewers

SplomAxis::type reuses the shared AxisType enum, which is slightly wider than splom's documented set (linear/log/date/category) — it also carries -/multicategory. This follows the crate's "reuse common types" convention; happy to introduce a narrower splom-specific enum if you'd prefer.

Testing

  • cargo test -p plotly --features all — all unit + doctests pass (includes to_json() round-trips and runnable doc examples for both traces)
  • cargo clippy --features all -- -D warnings -A deprecated — clean
  • cargo doc — no new warnings

🤖 Generated with Claude Code

Add typed scatter-plot-matrix (splom) and parallel-categories (parcats)
traces following the established trace-struct recipe.

- Register PlotType::{Splom, Parcats} (serialize to "splom"/"parcats"),
  re-export modules + traces from traces/mod.rs and lib.rs.
- All attributes verified against bundled plotly.js 3.7.0 schema.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
@andrei-ng
andrei-ng force-pushed the feature/splom-parcats-traces branch from d9bd828 to e593cdb Compare July 27, 2026 13:34
 - add extra png's for book TOC

Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
@andrei-ng
andrei-ng merged commit 3f73612 into plotly:main Jul 27, 2026
30 of 32 checks passed
@andrei-ng
andrei-ng deleted the feature/splom-parcats-traces branch July 27, 2026 13:54
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