Open Mattc1221 opened 9 months ago
Thanks for the SIP (and the PR!). We're holding the PR while the SIP settles out. The next step here is to start a [DISCUSS] thread on the mailing list. Let me know if you want any assistance with that, you can just DM me on slack.
One faced of the discussion here would be about the features we add to Superset's Calendar Heatmap. I don't have any push-back on any of your proposal in that regard.
I think the biggest fork in the road we'll have to contend with is which plugin we want to support going forward. I have no problem updating the current "legacy" plugin, but we would need to make moves to remove it's "legacy" status - namely upgrading to the newer chart data endpoint, supporting additional features (drill by, cross filters, etc) and sprucing it up overall.
Alternatively, we could go forward with an ECharts-based calendar heatmap plugin. That might be smaller/lighter/maintainable, but it probably won't be able to reach feature parity with what you're proposing here.
I'm personally OK with either direction, but nervous about adding more features to a legacy plugin without giving it the proper evolution/upgrades it needs to survive the next major version(s) of Superset.
Alternatively, we could go forward with an ECharts-based calendar heatmap plugin. That might be smaller/lighter/maintainable, but it probably won't be able to reach feature parity with what you're proposing here.
I would vote for moving to the ECharts plugin unless there's a really good reason that blocks us from moving into that direction. I even have a Heatmap PR (not calendar) that will land soon and may help with the calendar version. We need to think about UI/UX consistency and code complexity and try to always move to ECharts to materialize SIP-50.
@rusackas @michael-s-molina
Right now, the calendar heatmap in Superset has some severe limitations, particularly around consistency when multiple heatmaps are on the same dashboard that this SIP would address. We can wait until the ECharts one is implemented but that could literally be a year or more away whereas this and the corresponding pull request could address that issue in months or less making the platform significantly more robust.
I realize you really want to move everything to ECharts but I personally think feature enhancements that allow Superset to be a viable alternative to other business intelligence platforms should come before trying to get everything on one Javascript library. ECharts has some good features but it also has some areas that aren't as evolved as controls like the one calendar heatmap is based on. I would vote for implementing the best library for a particular visualization.
I realize you really want to move everything to ECharts
Not at all the case... We prefer using it when it makes sense, but there are plenty of plugins where it might not be the best choice.
I would vote for implementing the best library for a particular visualization.
100% agreed.
The main worry in my book is extending the features of a legacy plugin that doesn't use the current data endpoint or provide other first-class features like drilling. I just hope that gets prioritized sometime before the legacy endpoint is deprecated.
I would vote for implementing the best library for a particular visualization.
Any technical decision is always a trade-off. Any time you introduce a new library you need to consider all base logic that needs to be supported consistently throughout the app. Think about theming, tooltip handling, legend interaction, zooming, data transformation, etc. If you introduce a new library you need to implement these behaviors in a consistent manner with the rest of the plugins to avoid decreasing UX. At times, you want to introduce a new library because it provides many important features that are not supported by the common library and the cost of implementing the base logic pays off. I generally use the principle where if you can provide the plugin in a satisfactory manner using ECharts, that should be the preferred way. Only when this is not an option, I would introduce a new library.
What are the next steps on this? We have dashboards deployed for customers that could leverage the work that Mattc1221 has already completed and would like to be able to use his updates without trying to fork and maintain concurrency with the official releases.
Re-numbering this one to SIP-113, since another Issue was also numbered as 111, and went up for a DISCUSS thread on the official mailing list. Please proceed with opening a DISCUSS thread for this one when you want to move it forward.
Discuss thread opened officially on the dev@ list :)
@Mattc1221 I can carry this forward for a vote, if you're still hoping to implement it :)
@rusackas that would be great! I would plan on just updating this PR
Just got another piece of feedback that one of the major complaints with this chart is the orientation. It would be less confusing to users if there was a way to orient the calendar horizontally (like a wall calendar), or at least provide a control with the option for that sort of layout.
The problem
Calendar Heatmaps in Superset don't allow users to select the start and end of the heatmap range even though the calendar heatmap library that we use has this functionality. Documentation is here
The Motivation
Full Motivation
Data with specific thresholds
If your data has specific thresholds or boundaries that are meaningful for your analysis, manually setting the range allows you to highlight these thresholds accurately. For example, in a temperature heat map, you might want to distinguish between temperatures above and below freezing point with different colors.
Highlighting anomalies
When you want to focus on anomalies or outliers in your data, manually setting the range can help make these anomalies more apparent. For instance, in a sales data heat map, you might want to highlight exceptionally high or low sales figures.
Comparing different time periods
When comparing data across different time periods, setting a consistent range ensures that the color scale is uniform. This is especially important when comparing multiple calendar heat maps side by side.
Emphasizing specific values
To emphasize specific values or a particular range of values that are particularly relevant to your analysis, manually setting the range allows you to create a visualization that aligns with your objectives.
Ensuring consistent color representation
When working with multiple heat maps or sharing them with others, manually setting the range helps maintain consistency in color representations, making it easier for viewers to interpret the data.
Accommodating user preferences
Depending on your audience or user preferences, manually setting the range can allow for customization. Users may have different color perception or need to see the data in a specific way, and manual range setting provides flexibility.
Sensitivity to small changes
In certain scientific or engineering applications, you might want to create heat maps that are sensitive to even small changes in data values. Manually setting the range allows for fine-grained control to detect subtle variations.
Clarity and readability
For educational or presentation purposes, manually setting the range can enhance the clarity and readability of the heat map, making it easier for the audience to understand and interpret the information.
Highlighting specific events or patterns
Manually setting the range can be used to emphasize specific events or patterns in the data. For example, in a calendar heat map showing website traffic, you might want to highlight days with significant spikes in traffic.
Adherence to domain-specific standards
In some domains, there may be established standards or conventions for color-coding data in heat maps. Manually setting the range allows you to adhere to these standards accurately.
TLDR
An example of why we would want to specify the calendar heatmap range:
Proposed Solution
Metric Range
Metric Range
would beAutomatic
,Manual
Automatic
and use the same strategy we use nowManual
would display 2 new inputs:Metric Range Start
andMetric Range End
that would be integer inputshttps://github.com/apache/superset/assets/36670322/af22eda0-aab7-4b3d-8e98-57166966db68