Since PR #34276 we have the ability to adjust the tooltip of a deck.gl GeoJson Polygon charts through a unified interface:
- a) how to determine each polygons color, via the
Metric selector (avialable before the PR)
- b) which metrics to include, via the list of
Tooltip contents
- c) how to style them, via the
Customize tooltips template
However, achieving a simple tooltip that shows an aggregated metric (say computed_metric) along with some corresponding meta data (say time and location) is currently not possible.
Desired outcome
*CSP needs to be disabled
Isolation
- To use custom sytling (c), CSP has to be disabed or adjusted (e.g.
TALISMAN_ENABLED = False).
- Without anything added to (b), the default template includes the
computed_metric.
- When adding meta data by including them in (b), the default style does not include the
computed_metric. This does not require adjusting CSP.
- The ui does not permit adding
computed_metric in (b): Only real data columns can be selected, no custom sql and no predefined dataset-level metrics.
Conclusion
- In combination, it is currently not possible, to get tooltip with a custom metric and metadata, without disabeling CSP.
Proposed solution
- The default template that is used when columns are added into (b) should include the defined
Metric (a)
- The UI should inform the user that (c) does not use handlebars (but a javascript render), which requires disableing CSP.
Screenshots
default template without columns added to (b)

default template with columns added to (b)

no computed metrics can be selected in (b)

Additional context
Tested in Superset v6.1.0
Related Issues and PRs
Insights from Dosu:
- (c) is processed as JavaScript using a sandboxed
vm.runInNewContext() execution environment [1]. Internally, this calls sandboxedEval() which uses dynamic code evaluation — and that's exactly what triggers the CSP 'unsafe-eval' violation you're seeing [2].
Checklist
Since PR #34276 we have the ability to adjust the tooltip of a deck.gl GeoJson Polygon charts through a unified interface:
Metricselector (avialable before the PR)Tooltip contentsCustomize tooltips templateHowever, achieving a simple tooltip that shows an aggregated metric (say
computed_metric) along with some corresponding meta data (say time and location) is currently not possible.Desired outcome
*CSP needs to be disabled
Isolation
TALISMAN_ENABLED = False).computed_metric.computed_metric. This does not require adjusting CSP.computed_metricin (b): Only real data columns can be selected, no custom sql and no predefined dataset-level metrics.Conclusion
Proposed solution
Metric(a)Screenshots
default template without columns added to (b)

default template with columns added to (b)

no computed metrics can be selected in (b)

Additional context
Tested in Superset v6.1.0
Related Issues and PRs
Insights from Dosu:
vm.runInNewContext()execution environment [1]. Internally, this callssandboxedEval()which uses dynamic code evaluation — and that's exactly what triggers the CSP'unsafe-eval'violation you're seeing [2].Checklist