Custom Javascript editing/parser in deck.gl visualisations seems to be broken

See original GitHub issue

Firstly, thanks for such an awesome project!

When trying to add Javascript to customise onClick, Tooltips, etc. in the deck.gl visualisations, the text box in which you enter the code text behaves erratically. It is also unclear what is actually persisted onto the visualisation, it doesn’t appear to be the code as entered.

How to reproduce the bug

(I’ve given instructions for the deck.gl Scatterplot, but seems to apply to all deck.gl visualisations)

  1. Go to Charts, Add new chart
  2. Select a dataset with spatial attributes, choose deck.gl Scatterplot, click on Create New Chart
  3. Configure Chart to display some data (i.e. configure the Lat-Long values)
  4. Under Data configuration pane on left of screen, expand the “Advanced” collapse. Attempt to enter text in the “Javascript Tooltip Generator”. It should enter duplicate values.
  5. In the browser console, there should be Uncaught TypeError: (validationErrors || []).forEach is not a function

Expected results

Text typed in the Javascipt fields in deck.gl visualisations to appear as typed. For the code entered to be executed in the context of the visualisation.

Actual results

Text appearing in field does not match what was typed. Custom JS code doesn’t appear to be executed in map.

Following error appearing in browser console per character typing:

explore.fd9dbc001a8d2b732fc9.entry.js:624 Uncaught TypeError: (validationErrors || []).forEach is not a function
    at Object.SET_FIELD_VALUE (explore.fd9dbc001a8d2b732fc9.entry.js:624:32)
    at exploreReducer (explore.fd9dbc001a8d2b732fc9.entry.js:694:39)
    at combination (vendors.866d9853ec9ca701f3b8.entry.js:198222:29)
    at dispatch (vendors.866d9853ec9ca701f3b8.entry.js:197988:22)
    at 3236.54993c7b99382ace8b98.entry.js:242:12
    at 1844.8922f8dcb86356245bf9.entry.js:1075:16
    at vendors.866d9853ec9ca701f3b8.entry.js:198240:12
    at Object.onChange (7173.0ceb268407a17642e1ec.entry.js:12551:61)
    at ReactAce.push.93946.ReactAce.onChange (437abb94798b28dd8787.chunk.js:25959:24)
    at Editor.EventEmitter._signal (600b0291f89941e46ffa.chunk.js:3870:21)

Screenshots

This is what appeared after typing a single d character:

image

This is after typing d =>:

image

Environment

  • browser type and version:
    • Mozilla Firefox 98.0 (64-bit)
    • Google Chrome Version 99.0.4844.51 (Official Build) (64-bit)

(built off apache/superset:1.4.0 Docker image tag)

  • superset version: 1.4.0
  • python version: python 3.8.12
  • node.js version: sorry, not sure how to get the node version inside the running docker container?
  • any feature flags active:
    • ENABLE_TEMPLATE_PROCESSING
    • ALERT_REPORTS
    • THUMBNAILS
    • LISTVIEWS_DEFAULT_CARD_VIEW
    • DASHBOARD_NATIVE_FILTERS
    • ENABLE_JAVASCRIPT_CONTROLS (in tooltips config section)

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

Additional context

I’m aware this functionality is fairly old (#4173), so I wonder if maybe a subsequent change has broken the in-browser JS parsing?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
riazarbicommented, May 3, 2022

This works on v1.5

1reaction
stephenLYZcommented, Apr 5, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance Optimization - deck.gl
You would need to break up your data into chunks and use multiple deck.gl layers to ... using the dataComparator prop to supply...
Read more >
Using Layers - deck.gl
A deck.gl layer is a packaged visualization type that takes a collection of datums, associate each with positions, colors, extrusions, etc., and renders...
Read more >
Views and Projections - deck.gl
To show views from multiple viewpoints (cameras), e.g. in a split screen setup. To show a detail view (e.g, first person), and an...
Read more >
What's New - deck.gl
Custom Indexing System in TileLayer. The TileLayer is fundamental when it comes to visualizing datasets so big that they cannot fit in the...
Read more >
Adding Interactivity - deck.gl
The easiest way to enable pan/zoom/rotate of the visualization is to set the controller prop on Deck or <DeckGL> to true along with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found