superset icon indicating copy to clipboard operation
superset copied to clipboard

Deck.gl's arc chart stroke width not updating

Open kyun99 opened this issue 1 year ago • 1 comments

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
# Enter the repository you just cloned
$ cd superset

# Fire up Superset using Docker Compose
$ docker compose -f docker-compose-image-tag.yml up
  1. Go to localhost:8088 and log in with admin/admin.
  2. Load the default Deck.gl Arcs chart.
  3. 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.

kyun99 avatar Oct 10 '24 09:10 kyun99

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.

dosubot[bot] avatar Oct 10 '24 09:10 dosubot[bot]

Seems like this is still an issue as of 4.1.2.

rusackas avatar Apr 16 '25 21:04 rusackas

Opening a PR...

rusackas avatar Apr 16 '25 21:04 rusackas