apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.53k stars 13.77k forks source link

Deck.gl's arc chart stroke width not updating #30570

Open kyun99 opened 3 weeks ago

kyun99 commented 3 weeks ago

Bug description

While working with Deck.gl's arc chart, I encountered an issue where adjusting the stroke width via a form doesn't seem to update the arc's width.

How to reproduce: (As per quick start guide)

  1. git clone https://github.com/apache/superset
  2. 
    # Enter the repository you just cloned
    $ cd superset

Fire up Superset using Docker Compose

$ docker compose -f docker-compose-image-tag.yml up


3. Go to localhost:8088 and log in with admin/admin.
4. Load the default Deck.gl Arcs chart.
5. A change in the stroke width in the form is not reflected in the preview of the chart even after update. 

I am uncertain if this is the root cause but I noticed that the code that set's the stroke width property is from a previous version (v5.2) of deck.gl which is no longer used.
- https://github.com/apache/superset/blob/318eff732764f89e49c6eb699238c8950f533726/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/Arc.tsx#L80
### Screenshots/recordings

https://github.com/user-attachments/assets/d76d40b4-45bc-4d62-b2e0-d6658a977cd0

### Superset version

master / latest-dev

### Python version

I don't know

### Node version

I don't know

### Browser

Chrome

### Additional context

_No response_

### 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.
- [ ] 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.
dosubot[bot] commented 3 weeks ago

Hey @kyun99, I'm here to assist you with any bugs, questions, or contributions you have. Let's work on resolving the issue together!

To resolve the issue with the stroke width not updating in Deck.gl's arc chart, ensure the following:

  1. Check fd.stroke_width: Verify that fd.stroke_width is correctly set in the form data. It should not be undefined or null. The strokeWidth is set using fd.stroke_width in the ArcLayer:

    strokeWidth: fd.stroke_width ? fd.stroke_width : 3,
  2. Form Data Configuration: Ensure that the stroke_width is configured correctly in the form data and that the selected value is being saved and passed properly. The controlPanel.ts file should have stroke_width as a SelectControl with options like [1, 2, 3, 4, 5].

  3. Re-rendering: Make sure the component re-renders when fd.stroke_width changes. The renderTrigger: true setting in the control configuration should facilitate this.

  4. Deck.gl Version: Confirm that the latest version of Deck.gl is being used to avoid compatibility issues. The current setup in Arc.tsx aligns with the latest Deck.gl API [1][2].

If these steps don't resolve the issue, there might be a problem elsewhere in the data flow or rendering logic.

To continue talking to Dosu, mention @dosu.