-
Notifications
You must be signed in to change notification settings - Fork 1
feat: support violin plot #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sition on violin switch
…xt, violinKde, and audio files
|
This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:
|
|
This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements comprehensive support for violin plots in maidr by introducing a new ViolinKdeTrace class and enhancing the BoxTrace class to handle violin box plots. Violin plots combine kernel density estimation (KDE) curves with box plot statistics, requiring specialized navigation that allows users to explore both the density distribution and statistical summaries.
Key changes include:
- New
ViolinKdeTraceclass that extendsSmoothTracewith swapped navigation (left/right switches between violins, up/down traverses the density curve) - Enhanced
BoxTracewith violin-specific behavior for layer switching with Y-value preservation - Dynamic volume control in audio service using
volumeScalebased on density values - Context layer switching logic that preserves both X and Y positions when moving between violin layers
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/model/violinKde.ts | Implements new ViolinKdeTrace class with specialized navigation, audio (density-based pitch/volume), and layer switching with Y-value preservation |
| src/model/box.ts | Adds violin box plot detection and behavior, including Y-value preservation during layer switches and bottom-point reset when changing violins |
| src/model/smoothtraceFactory.ts | Adds violin plot detection logic to create ViolinKdeTrace when BOX + SMOOTH layers are present |
| src/model/factory.ts | Passes allLayers parameter to enable violin plot detection in trace factories |
| src/model/context.ts | Implements onSwitchFrom pattern for custom layer switching behavior with Y-value preservation |
| src/model/plot.ts | Adds optional onSwitchFrom method to Trace interface for custom layer switching |
| src/service/audio.ts | Adds volumeScale and volumeMultiplier parameters for dynamic volume control based on data characteristics |
| src/service/text.ts | Excludes cross value announcement for violin box plots during layer switches |
| src/type/state.ts | Adds volumeMultiplier and volumeScale properties to AudioState for dynamic volume control |
… methods for Y value handling
|
This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:
|
|
This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:
|
|
In context: src/model/factory.ts There are quite lot of conditionals in boxplot. Would extending that and creating new Violin Boxplot look good? Please resolve merge conflicts after refactoring. Thanks |
…layer switching in subplots
…roving separation of concerns
|
This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:
|
|
This PR contains changes to files that affect the model layer and unit tests. Before merging, please ensure:
|
|
I have addressed the comments and solved the merge conflict. |
|
🎉 This PR is included in version 3.39.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request
Description
Adds violin plot support in maidr, enabling accessible navigation and exploration of violin plot visualizations. Violin plots combine kernel density estimation (KDE) curves with box plot statistics. This implementation provides specialized navigation for both layers and maintains architectural consistency by removing plot-specific metadata from the general data structure.
Changes Made
This PR implements comprehensive support for violin plots in maidr, enabling accessible navigation and exploration of violin plot visualizations. Violin plots combine kernel density estimation (KDE) curves with box plot statistics, and this implementation provides specialized navigation behavior for both layers.
Core Features
Violin Plot Navigation: Specialized navigation for violin plots with swapped directional controls:
KDE Layer: Left/Right arrows switch between violins (row changes), Up/Down arrows traverse along the density curve (col changes)
Box Layer: Standard navigation with support for preserving Y values when switching between layers
Layer Switching: Seamless switching between KDE and box layers while preserving X and Y values for context continuity
Screenshots (if applicable)
Checklist
ManualTestingProcess.md, and all tests related to this pull request pass.