feat: Adds the ECharts Histogram chart
SUMMARY
This PR creates the ECharts Histogram chart which is used to display the distribution of a dataset by representing the frequency or count of values within different ranges or bins. It helps visualize patterns, clusters, and outliers in the data and provides insights into its shape, central tendency, and spread.
This plugin uses numpy.histogram to compute the distribution on the server side. It supports a single numeric column and multiple dimensions. Aggregations are not supported.
The legacy Histogram is one of the plugins that are currently preventing us from upgrading to React 17. With this PR, we should be able to create a migration script for legacy charts and remove another blocker for the React upgrade.
Fixes https://github.com/apache/superset/issues/24064
TODO:
- Add more controls
- Optimize code
- Add tests
- Fix CI issues
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Check all features.
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
Codecov Report
Attention: Patch coverage is 43.75000% with 54 lines in your changes missing coverage. Please review.
Project coverage is 61.09%. Comparing base (
76d897e) to head (a90451a). Report is 1094 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #28652 +/- ##
==========================================
+ Coverage 60.48% 61.09% +0.60%
==========================================
Files 1931 1951 +20
Lines 76236 77568 +1332
Branches 8568 8744 +176
==========================================
+ Hits 46114 47388 +1274
- Misses 28017 28049 +32
- Partials 2105 2131 +26
| Flag | Coverage Δ | |
|---|---|---|
| hive | 48.94% <21.73%> (-0.23%) |
:arrow_down: |
| presto | 53.53% <21.73%> (-0.27%) |
:arrow_down: |
| python | 64.62% <91.30%> (+1.13%) |
:arrow_up: |
| unit | 59.01% <91.30%> (+1.38%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for the review @kgabryje! I think I addressed all your comments, including adding helpful tooltips. Thanks for pointing that out! It was a copy/paste from the legacy chart.
@michael-s-molina It looks like normalised histogram doesn't reach 1 for tallest bar - 1st screenshot is the new plugin, 2nd is the old one
1 more comment - why do we have a select component for num column instead of drag&drop? We could limit the accepted column by type in dnd
@michael-s-molina It looks like normalised histogram doesn't reach 1 for tallest bar - 1st screenshot is the new plugin, 2nd is the old one
@kgabryje I changed the normalize calculation and updated the tooltip. It should be correct now. Keep in mind that it will not match the legacy version because that was wrong too 😅 .
1 more comment - why do we have a select component for num column instead of drag&drop? We could limit the accepted column by type in dnd
@kgabryje I changed the control to use drag-and-drop as you suggested.
Ephemeral environment shutdown and build artifacts deleted.