Bug description
Javascript Tooltip Generator error in deck.gl heatmap in superset version 4.1.1, extraProps is undefined.
But it works fine in the deck.gl scatterplot.
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.11
Node version
I don't know
Browser
Chrome
Additional context
- I install superset by pip.
- https://github.com/apache/superset/issues/25871 I referred to this question, but no solution was found.
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hi @lgz192,
I'm here to help you with any bugs, questions, or contribution guidance you may need. Let's solve this together!
The issue you're encountering with the extraProps
being undefined in the deck.gl heatmap tooltip generator might be related to differences in how data is processed or passed between the heatmap and scatterplot layers. Unfortunately, I couldn't find specific information about the extraProps
property in the Superset repository.
However, you might want to check the following:
-
Data Structure: Ensure that the data structure used for the heatmap includes all necessary properties, including
extraProps
. Compare it with the data structure used in the scatterplot to identify any discrepancies. -
Tooltip Function: Review the implementation of the tooltip generation function for the heatmap. The function
setTooltipContent
is responsible for generating the tooltip content. Ensure that it handles cases where certain properties might be undefined to prevent errors. -
Configuration and Dependencies: Verify that all required dependencies and configurations for the deck.gl heatmap are correctly set up. This includes ensuring that the
HeatmapLayer
is properly configured with the necessary properties and data.
If the issue persists, consider checking for any recent changes in the Superset codebase that might affect the heatmap or tooltip generation. Additionally, reviewing the error messages in the developer console might provide more insights into the root cause of the problem.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report
Comment From: lgz192
d=> {
console.log('d',d)
return `
<div><strong>Area:</strong>${ d.object.extraProps.area3_name}</div>
`}
This is the tooltips function I wrote.
Comment From: hainenber
I made a deep dive into the deck.gl
rabbit hole. It appears that due to the aggregation nature of Heatmap
chart type, the granular data for each layer such as referred object.extraProps
got dropped. In fact, there's no object
as well.
Compared to Layer
of Scatterplot.
At least, this is what my investigation leads to.
Comment From: moabits
+1 with deck.gl Grid
Comment From: lhd-lang
YES. deck.gl scatterplot. OK! deck.gl heatmap not OK! The same JS :
function aa(d){
const{object} = d
return <div>
<strong>机构名称:</strong> ${object.extraProps.机构名称}<br>
</div>
;
}
Comment From: lhd-lang
+1 with deck.gl Grid
YES deck.gl Grid also not OK
Comment From: rusackas
We'd welcome PRs to fix this, but the JS tooltips are effectively deprecated and awaiting a SIP for a replacement (i.e. handlebars templating). If anyone is interested in providing a fix or working toward replacing JS tooltips with something simpler/safer, we'd welcome it. Otherwise this may be closed as "not planned" before long.