superset icon indicating copy to clipboard operation
superset copied to clipboard

feat(plugin-chart-echarts): add Gantt Chart plugin

Open Quatters opened this issue 6 months ago • 7 comments

SUMMARY

This PR introduces a new "Gantt Chart" plugin built using Apache ECharts. This chart addresses the current lack of timeline-based visualizations, enabling users to effectively analyze event sequences and durations across a horizontal time axis.

Key features include:

  • Representation of event durations as horizontal bars on a continuous time axis.
  • Support for category-based vertical grouping with nested subcategories, facilitating detailed analysis within larger contexts.
  • Functionality for fixed left/right time boundaries to compare intervals.
  • Native ECharts zoom and scroll support for interactive data exploration.

The expected input data format includes start_time and end_time, a main category for the Y-axis, and an optional dimension for subcategories. Additional fields are supported for tooltips, enhancing data context upon interaction.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

https://github.com/user-attachments/assets/138482b3-decc-4861-894d-000a14aa173b

TESTING INSTRUCTIONS

Import demo: Chart Export Jun 07 2025.zip It uses dataset of examples database. data.csv

ADDITIONAL INFORMATION

  • [x] Has associated issue: Closes #33349
  • [ ] Required feature flags:
  • [x] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)   - [ ] Migration is atomic, supports rollback & is backwards-compatible   - [ ] Confirm DB migration upgrade and downgrade tested   - [ ] Runtime estimates and downtime expectations provided
  • [x] Introduces new feature or API
  • [ ] Removes existing feature or API

Quatters avatar Jun 07 '25 09:06 Quatters

Thanks for the PR @Quatters. Could you add a video, demonstrating the new plugin?

michael-s-molina avatar Jun 09 '25 17:06 michael-s-molina

Thanks for the PR @Quatters. Could you add a video, demonstrating the new plugin?

Sure! I've replaced gif with demo video.

Quatters avatar Jun 12 '25 04:06 Quatters

@rusackas Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

github-actions[bot] avatar Jun 12 '25 15:06 github-actions[bot]

So cool, thank you! Spinning up an ephemeral env so we can all play with it.

rusackas avatar Jun 12 '25 15:06 rusackas

@rusackas Ephemeral environment spinning up at http://35.88.138.93:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jun 12 '25 16:06 github-actions[bot]

My only immediate suggestion is that I feel like "Gantt chart" is a more common name for this than "Timeline chart."

I was going to comment that typically Gantt charts include a graph of dependencies and arrows to visualize them, but GPT seems to think it's not a strict requirement -> https://chatgpt.com/share/684b5885-26c0-8010-b92e-74248625313c

mistercrunch avatar Jun 12 '25 22:06 mistercrunch

Ok, I don't see any issues with renaming chart to Gantt. A quick search shows that Gantt chart much more often used with this type then Timeline (which is more generic to me). I also thought dependencies visualisation is mandatory for Gantt, but it's not.

Good suggestion!

Quatters avatar Jun 14 '25 05:06 Quatters

@mistercrunch Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

github-actions[bot] avatar Jun 27 '25 15:06 github-actions[bot]

@mistercrunch Ephemeral environment spinning up at http://52.41.10.189:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jun 27 '25 15:06 github-actions[bot]

Trying to test in ephenv, would be nice to add an example in "Featured Chart" to showcase the chart, help validate now, and prevent regressions as we typically do visual reviews of example dashboards for each release.

mistercrunch avatar Jun 27 '25 19:06 mistercrunch

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.84%. Comparing base (e3cbbca) to head (7339ee6). Report is 39 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #33716       +/-   ##
===========================================
+ Coverage        0   72.84%   +72.84%     
===========================================
  Files           0      559      +559     
  Lines           0    40426    +40426     
  Branches        0     4247     +4247     
===========================================
+ Hits            0    29448    +29448     
- Misses          0     9874     +9874     
- Partials        0     1104     +1104     
Flag Coverage Δ
hive 47.20% <ø> (?)
postgres 71.93% <ø> (?)
presto 50.96% <ø> (?)
python 72.80% <ø> (?)
sqlite 71.45% <ø> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 27 '25 23:06 codecov[bot]

Trying to test in ephenv, would be nice to add an example in "Featured Chart" to showcase the chart, help validate now, and prevent regressions as we typically do visual reviews of example dashboards for each release.

Added chart to the "Featured charts" dashboard.

Quatters avatar Jun 28 '25 00:06 Quatters

@mistercrunch Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

github-actions[bot] avatar Jun 30 '25 16:06 github-actions[bot]

@mistercrunch Ephemeral environment spinning up at http://35.91.161.145:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jun 30 '25 17:06 github-actions[bot]

Getting this in the "Featured Charts" dashboard -> Screenshot 2025-07-02 at 9 17 38 AM

mistercrunch avatar Jul 02 '25 16:07 mistercrunch

Getting this in the "Featured Charts" dashboard -> Screenshot 2025-07-02 at 9 17 38 AM

Seems that sqlite does not support ... as data(col1, col2, ...) column naming. I rewrote SQL query so it should work now.

Quatters avatar Jul 03 '25 14:07 Quatters

@mistercrunch Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

github-actions[bot] avatar Jul 03 '25 15:07 github-actions[bot]

@mistercrunch Ephemeral environment spinning up at http://18.236.253.130:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Jul 03 '25 16:07 github-actions[bot]

Works! Screenshot 2025-07-03 at 2 22 19 PM

mistercrunch avatar Jul 03 '25 21:07 mistercrunch

In what release can we start using this chart?

iliakasianov avatar Aug 05 '25 12:08 iliakasianov

In what release can we start using this chart?

Probably in 6.0

sadpandajoe avatar Aug 05 '25 21:08 sadpandajoe

Probably in 6.0

Thanks for the answer. Is there any way to use this chart now, maybe as an external plugin?

iliakasianov avatar Aug 06 '25 08:08 iliakasianov

Probably in 6.0

Thanks for the answer. Is there any way to use this chart now, maybe as an external plugin?

If it's on master, you can just pull master now and deploy that somewhere and start using it. There just isn't pypi support for it now, but I believe even docker gets created with master branch too.

sadpandajoe avatar Aug 06 '25 16:08 sadpandajoe

Hello @sadpandajoe, do you know the approximate release date of 6.0.0? Because I tried many different master images, and unfortunately, they have different bugs, and very often, some of the functionality does not work. And since we really need this chart, I would like to understand the release dates. Thank you very much in advance for your answer.

iliakasianov avatar Aug 12 '25 10:08 iliakasianov

I advise against running a deployment based on a specific master commit, it may make it hard to migrate later and as you note master branch can be unstable.

@iliakasianov the timelines for Superset releases are hard to pin down. My understanding is that folks are working on stabilizing master branch right now for the 6.0.0 release. My best guess would be a 6.0.0 release candidate being cut in the next few weeks for testing. Then depending on how the testing and voting goes, maybe another month or so for the official release (that part is highly variable).

sfirke avatar Aug 13 '25 17:08 sfirke

do you know the approximate release date of 6.0.0

We'll be cutting the branch this week I'm hoping, and from there we'll need all the help we can get to stabilize the release.

Noting that you could probably take 5.0.0 and add the plugin if it's self-standing. Might be able to cherry-pick the commit in master for this PR

mistercrunch avatar Aug 13 '25 18:08 mistercrunch

Also longer term we'd love to get master to be more releasable and/or increase release velocity in general. Both these goals are highly related.

mistercrunch avatar Aug 13 '25 18:08 mistercrunch

Hello @sadpandajoe, do you know the approximate release date of 6.0.0? Because I tried many different master images, and unfortunately, they have different bugs, and very often, some of the functionality does not work. And since we really need this chart, I would like to understand the release dates. Thank you very much in advance for your answer.

The other method you can do is to create a branch you are using and cherry-pick the commit in. It could be pretty brutal though. But to get 6.0 out the door faster, it might be good for you to create issues you might have already seen, that way if they are blockers they'll get addressed and hopefully will get 6.0 stabilized quicker.

sadpandajoe avatar Aug 13 '25 18:08 sadpandajoe

Hello - I tested 6.0.0rc1 and don't see any customization for the y-axis which appears to be hardcoded to 8 characters with center alignment of text. I need to have the ability to show at least 30 characters with left alignment and wrapping. Also, is there a way to have a custom SQL to display a hyperlink?

koolanit avatar Aug 24 '25 15:08 koolanit