-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Heatmap y-axis sorting and rendering of 0 value #33105
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
Comments
Hey @fzhengTT! I'm Dosu, a bot here to help you with bugs, answer questions, and guide you on your journey to becoming a contributor. I'm ready to assist while you wait for a human maintainer. Let's tackle this together! A similar issue was previously reported in GitHub issue #31318, which discussed problems with the Y-axis sorting logic and rendering of zero values in the heatmap chart. This issue was closed with a fix provided in PR #31752 [1]. For the Y-axis sorting, the logic is defined by the Regarding the rendering of zero values, the heatmap chart handles null or empty values based on the If the issue persists despite these configurations, it might be related to the specific fork or version you are using. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
I haven't had a chance to try to replicate this, but if you are able to do so with existing datasets/examples, that might help us out, so we have easier repro steps. Just noting, that you have some Y axis sort controls. I see you're using Axis Ascending (the logic of which I haven't looked into), but I'm curious if Metric works better for you.: Also noting that as per the docs, it is inadvisable to deploy using docker compose. ![]() |
I submitted a fix for the bug. I think fixing the sort order is beyond what I can do but I agree it's a bug, it's evident in the example screenshots in the PR I just linked above. |
@sfirke Thanks for submitting a fix for the zeros.
@fzhengTT If you have both x-axis and y-axis sorting set, x-axis sorting will be applied first and that's why the y-axis might not follow an order. If you want to sort by the y-axis only, you need to clear the x-axis sorting. |
@michael-s-molina prior to v 4.1 you could have both axes sort in order. I have a heatmap where one axis is hours of the day from 0 to 23 and the other is days of the week from 1 to 7. It only works as a visual if they are both sorted in order. |
@sfirke The new Heatmap chart uses server-side ordering which is more correct given the limit restrictions that might be imposed by the query. The order controls are translated to ORDER BY clauses in the generated SQL. So, if you set X and Y, you will have something like ORDER BY X ASC, Y ASC. The previous fix gave the flexibility to order by just one axis. If this logic does not work for a specific use case, we might need additional controls and a contribution is welcome. |
Bug description
Observed on Superset 5.0.0, the deployment relies on a fork of Superset OSS version 5.0.0rc1. It's deployed in a EC2 instance using docker compose.
The Heatmap chart seems to sort the Y-axis through some unknown logic.
A similar issue was raised before for Heatmap chart at #31318 and was stated to be fixed in PR #31752.
Another similar issue: #32591 still open, but the issue reporter has a different Superset version.
Regardless of whether there is a string or numeric value on the Y-axis, sorting does not seem to make sense as it does not seem to be in alphabetical or numeric order.
In addition, it renders all the 0 values as on both the x and y axis, and possibly also on the heatmap grids.
Screenshots/recordings
In this screenshot:
0 values rendered as
<NULL>
on axes:ret_col
andret_row
is displayed as<NULL>
on the X and Y axes.Y-axis sorting is inconsistent:
ret_row
is what on the y-axis, and it's order in the Results is the same as the order on the heatmap.In this screenshot:
test_value
is 0, it's not being displayed on the plot. It doesn't have a grid with 0 in it, as the grids for test_value=1. I also don't see anything when hover over it.Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: