Add Splom and Parcats trace types#424
Closed
jqnatividad wants to merge 1 commit into
Closed
Conversation
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>
Contributor
Author
|
Reopening as a stacked PR on top of #423 instead of a standalone branch off main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two typed traces to the
plotlycrate, following the established trace-struct recipe (FieldSetterderive +skip_serializing_none, mirroringsankey.rsand the other domain/matrix traces):Splom<V>— scatter-plot matrix.SplomDimension/SplomAxis/SplomDiagonalsub-structs,showupperhalf/showlowerhalfcontrols, reuses the commonMarker. Plotly.js auto-generates the N×N axis grid, so callers don't assign explicitxaxis/yaxisids.Parcats<V>— parallel categories.ParcatsDimension/ParcatsLinesub-structs,countsper-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 existingrename_all = "lowercase"(same asSankey, no explicit rename).traces/mod.rsandlib.rs;CHANGELOG.mdupdated.hovertemplateis trace-level, andarrangementacceptsperpendicular/freeform/fixed(all three included).Note for reviewers
SplomAxis::typereuses the sharedAxisTypeenum, 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 (includesto_json()round-trips and runnable doc examples for both traces)cargo clippy --features all -- -D warnings -A deprecated— cleancargo doc— no new warnings🤖 Generated with Claude Code