Skip to content

Add Splom and Parcats trace types#424

Closed
jqnatividad wants to merge 1 commit into
plotly:mainfrom
dathere:upstream-splom-parcats
Closed

Add Splom and Parcats trace types#424
jqnatividad wants to merge 1 commit into
plotly:mainfrom
dathere:upstream-splom-parcats

Conversation

@jqnatividad

Copy link
Copy Markdown
Contributor

Summary

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

  • 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 (so aggregated tuples can be passed 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, no explicit rename).
  • 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.

- Splom<V>: SplomDimension/SplomAxis/SplomDiagonal sub-structs,
  showupperhalf/showlowerhalf controls, reuses common Marker.
- Parcats<V>: ParcatsDimension/ParcatsLine sub-structs, counts weighting,
  and ParcatsLineShape/ParcatsArrangement/ParcatsHoverOn/ParcatsSortPaths
  enums. arrangement includes the runtime-supported "fixed" value.
- 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>
@jqnatividad

Copy link
Copy Markdown
Contributor Author

Reopening as a stacked PR on top of #423 instead of a standalone branch off main.

@jqnatividad jqnatividad deleted the upstream-splom-parcats branch July 12, 2026 20:26
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