-
Notifications
You must be signed in to change notification settings - Fork 370
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
Improve automatic bin determination for histograms via start, end, and step attributes #285
Conversation
Co-authored-by: Dominik Moritz <domoritz@gmail.com>
you're very welcome. Your latest changes definitely produce better results but require Vega-Lite to do the data transformation. It should work well for small to medium-sized data. |
Just to note, the last commit reverts the improvement (for potentially better performance). |
Thanks @micahtyong! There is some custom bar size determination that we had to do since Lux delegate the binning to the executor side. The new implementation looks good for We could look into reimplementing something along the lines of Vega-Lite's bin.js. Thanks for pointing this out @domoritz! |
As a first step, I would suggest passing the step size explicitly to Vega-Lite so that the bars are sized correctly. Then as a next step, you could improve how Lux determines the bin offset and step size. |
Example Test SuiteThe following are examples for reviewers to try. There are also additional tests in
Olympic Dataset
Now, let's add a filter.
Car Dataset
COVID Dataset
|
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.
The results look good to me. I left a few small comments for improvements.
Thanks @micahtyong! The results look much better now for histograms in both Distribution and Filter. |
Thanks @micahtyong, the new histograms look great! I think the cutoff that you included for the bin width really helped with the low number of datapoints filter examples. |
Thank you @micahtyong for the improvements to binning. |
Thank you @domoritz for all the helpful feedback, both technical and from your HCI expertise! I really enjoyed the initiated conversations from this PR. Thank you @dorisjlee for the feedback, review, and pointer to the executor! I learned a lot from this enhancement. |
In this PR
Closes #265 and #217 by modifying
Histogram.py
and providing astart
,end
, andstep
bin for the Altair renderer. The bin width,step
, is stored in the Vis object duringPandasExecutor.py#execute_binning()
.Changes
vislib/altair/Histogram.py
andexecutor/PandasExecutor.py
.__bin_size
, inVis.py
Example Output
Here is an updated screenshot for histogram binning along the x-axis. As an example,
This yields the following output for Distribution histograms:
Then, we can specify intent to view Filter histograms.
Here is another screenshot to show histogram binning along the y-axis, which remains unchanged.