-
Notifications
You must be signed in to change notification settings - Fork 8
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
Additional attribute plot types (dot, strip, density) #366
Conversation
✅ Deploy Preview for upset2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Added jitter for dot plots in 94a7205 note that rows under or equal to size 5 will have no jitter. Jitter is seeded based on row size and dot index. This ensures that re-renders do not trigger any jitter updates. This makes the jitter consistent for a row, no matter the context, addressing one of my main gripes about jitter in dot plots. |
cf1e8c1
to
94a7205
Compare
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.
See comments. I've also raised #368 after some thought on this PR; I don't think that's necessary to address here but it may be possible to ease future work.
packages/upset/src/components/Columns/Attribute/AttributeBar.tsx
Outdated
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributeBar.tsx
Outdated
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributeBar.tsx
Outdated
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributeBar.tsx
Outdated
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributePlots/StripPlot.tsx
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributePlots/StripPlot.tsx
Outdated
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributePlots/StripPlot.tsx
Outdated
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributePlots/StripPlot.tsx
Outdated
Show resolved
Hide resolved
packages/upset/src/components/Columns/Attribute/AttributePlots/StripPlot.tsx
Outdated
Show resolved
Hide resolved
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.
One documentation change is still needed from last PR, otherwise LGTM.
StripPlot = 'Strip Plot', | ||
} | ||
|
||
export type AttributePlots = Record<string, `${AttributePlotType}`>; |
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.
Sorry, my original comment wasn't clear: I think you should note that the string
is the name of the attribute. So this record maps attribute names to their plot types.
/** | ||
* Generates a y offset for the provided index. | ||
* Seeded based on row size so that jitter is consistent between renders, and also varies between rows. | ||
* Rows of the same size will have the same jitter. |
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.
That looks pretty good. ATM I also have a util function in my backselection PR that can hash a string, but probably not necessary here.
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.
LGTM. Couple of very minor adjustments to comments
@@ -83,6 +83,13 @@ export const Upset: FC<UpsetProps> = ({ | |||
]; | |||
} | |||
|
|||
// for every visible attribute other than deviaiton and degree, add 'Box Plot' to their attribute plot type |
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.
// for every visible attribute other than deviaiton and degree, add 'Box Plot' to their attribute plot type | |
// for every visible attribute other than deviaiton and degree, set their initial attribute plot type to 'Box Plot' |
}; | ||
|
||
export const ATTRIBUTE_DEFAULT_COLOR = '#d3d3d3'; |
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.
Is this not already accounted for with the grey for the bars?
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.
Vega doesn't know what fill color to use for this, so I believe it will default to black if nothing is provided.
Does this PR close any open issues?
Closes #249
Give a longer description of what this PR addresses and why it's needed
This PR adds the ability to change the plot displayed in the attribute columns for a given attribute.
The options are: Box Plot, Strip Plot, Dot Plot
Question: For dot plots, should jitter be introduced? As is, there is not jitter and so these behave very similarly to the strip plot option. See photo in comments for jitter example.
Provide pictures/videos of the behavior before and after these changes (optional)
Example of dot plot, strip plot, and box plot on three different attributes:

Have you added or updated relevant tests?
Have you added or updated relevant documentation?
Are there any additional TODOs before this PR is ready to go?
No