Skip to content

feat(traces): add Splom + Parcats trace types#5

Closed
jqnatividad wants to merge 1 commit into
feature/trace-type-additionsfrom
feature/splom-parcats-traces
Closed

feat(traces): add Splom + Parcats trace types#5
jqnatividad wants to merge 1 commit into
feature/trace-type-additionsfrom
feature/splom-parcats-traces

Conversation

@jqnatividad

Copy link
Copy Markdown

Summary

Adds two typed traces to the fork, following the established trace-struct recipe (mirroring sankey.rs and histogram2d.rs). Stacked on plotly#423 — base is feature/trace-type-additions; retarget to main once that merges.

  • 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 no explicit xaxis/yaxis assignment.
  • Parcats<V> (parallel categories) — ParcatsDimension/ParcatsLine sub-structs, counts per-path weighting, domain-based (like Sankey). Enums: ParcatsLineShape, ParcatsArrangement, ParcatsHoverOn, ParcatsSortPaths.

Details

  • PlotType::{Splom, Parcats} serialize to "splom"/"parcats" via the existing rename_all = "lowercase" (no explicit rename needed, same as Sankey).
  • Module + top-level re-exports wired through traces/mod.rs and lib.rs; CHANGELOG.md updated under [Unreleased] → Added.
  • Every attribute was verified against the bundled Plotly.js 3.7.0 schema, including the two details the design doc flagged as unconfirmed: parcats hovertemplate is genuinely trace-level, and arrangement also accepts "fixed" (included for schema completeness).

Note for reviewers

SplomAxis::type reuses the shared AxisType enum, which is slightly wider than splom's allowed set (linear/log/date/category) — it also carries -/multicategory. This follows the "reuse common types" convention; Plotly.js coerces invalid values. Happy to swap in a narrower splom-specific enum if preferred.

Testing

  • cargo test -p plotly --features all — 371 unit + 36 doctests pass (includes to_json() round-trip + 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
Author

Superseded by the standalone upstream PR plotly#424 (based directly on main, independent of plotly#423). Branch feature/splom-parcats-traces is kept as the git-dependency source for qsv until the upstream trace additions are released.

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