-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix data labels too dense with large single series #42985
Fix data labels too dense with large single series #42985
Conversation
Codenotify: Notifying subscribers in CODENOTIFY files for diff 2c1333e...60f4344.
|
|
frontend/src/metabase/visualizations/echarts/cartesian/option/series.ts
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.
a0a5c8e
to
35a8b6d
Compare
0f8331d
to
9ece4d5
Compare
9ece4d5
to
9d1c2c2
Compare
frontend/src/metabase/visualizations/echarts/cartesian/model/types.ts
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.
Looks good, I left two minor comments, please have a look before merging
index a75f606..57bec85 100644 | ||
--- a/node_modules/echarts/lib/label/labelLayoutHelper.js | ||
+++ b/node_modules/echarts/lib/label/labelLayoutHelper.js | ||
@@ -256,6 +256,13 @@ export function hideOverlap(labelList) { |
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.
It would be possible to get this behavior without patching ECharts by using labelLayout and shifting empty labels to one single place outside of the chart but it would be quite hackish. So I agree that ECharts should ignore empty labels when computing layout
@JesseSDevaney Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
* remove unused variable * conditionally render labels sparsely if large amount of data points * update loki snapshots * refactor data label formatter conditions * setup intelligent label plotting * handle the case when there are no labels * add sparse data label rendering to bar charts * do not compute if no labels need to be shown or hidden * add sparse data labeling to waterfall charts * adjustment for large series waterfall labels * revert change * refactor name * add sparse labels to stacked bar and area * improve scaleFactor * fix type errors * remove unused labelFormatter * update snapshots * patch ECharts - labels with no text, i.e. "", were still being considered as plot-able labels which was causing labels with real text "asdfec.." to be hidden because of overlap. - This patch makes it so that labels with no text, i.e. "", are not considered to be candidates for overlap checking. * update loki snapshots * only loop over dataset once for getWaterfallChartDataDensity * improve performance of chart data density calculations * update loki snapshots * update E2E spec * update E2E spec * increase cartesian label density allotment * update loki snapshots * update loki snapshots * comment out node_modules cache since it cannot be skipped by commit and is breaking CI * fix type errors * Reset node modules if patches are changed * refactor type naming --------- Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com> Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
* remove unused variable * conditionally render labels sparsely if large amount of data points * update loki snapshots * refactor data label formatter conditions * setup intelligent label plotting * handle the case when there are no labels * add sparse data label rendering to bar charts * do not compute if no labels need to be shown or hidden * add sparse data labeling to waterfall charts * adjustment for large series waterfall labels * revert change * refactor name * add sparse labels to stacked bar and area * improve scaleFactor * fix type errors * remove unused labelFormatter * update snapshots * patch ECharts - labels with no text, i.e. "", were still being considered as plot-able labels which was causing labels with real text "asdfec.." to be hidden because of overlap. - This patch makes it so that labels with no text, i.e. "", are not considered to be candidates for overlap checking. * update loki snapshots * only loop over dataset once for getWaterfallChartDataDensity * improve performance of chart data density calculations * update loki snapshots * update E2E spec * update E2E spec * increase cartesian label density allotment * update loki snapshots * update loki snapshots * comment out node_modules cache since it cannot be skipped by commit and is breaking CI * fix type errors * Reset node modules if patches are changed * refactor type naming --------- Co-authored-by: Jesse Devaney <22608765+JesseSDevaney@users.noreply.github.com> Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com> Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Demo (updated)
2024-05-24.19-58-57.mp4