Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Echarts Graph chart #13111

Merged
merged 20 commits into from
Feb 24, 2021
Merged

feat: add Echarts Graph chart #13111

merged 20 commits into from
Feb 24, 2021

Conversation

mayurnewase
Copy link
Contributor

@mayurnewase mayurnewase commented Feb 14, 2021

SUMMARY

Replace legacy force directed chart with new graph echart
See pr apache-superset/superset-ui#918

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov-io
Copy link

codecov-io commented Feb 14, 2021

Codecov Report

Merging #13111 (5a2e099) into master (974f447) will decrease coverage by 0.21%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13111      +/-   ##
==========================================
- Coverage   77.14%   76.92%   -0.22%     
==========================================
  Files         865      865              
  Lines       44961    44980      +19     
  Branches     5415     5421       +6     
==========================================
- Hits        34686    34603      -83     
- Misses      10152    10254     +102     
  Partials      123      123              
Flag Coverage Δ
cypress 58.51% <ø> (-0.03%) ⬇️
javascript 62.20% <ø> (+0.02%) ⬆️
python 80.39% <ø> (-0.42%) ⬇️

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

Impacted Files Coverage Δ
...-frontend/src/visualizations/presets/MainPreset.js 100.00% <ø> (ø)
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/db_engine_specs/hive.py 74.23% <0.00%> (-16.54%) ⬇️
superset/db_engine_specs/presto.py 81.62% <0.00%> (-6.42%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/db_engine_specs/base.py 85.57% <0.00%> (-0.49%) ⬇️
superset/models/core.py 88.55% <0.00%> (-0.28%) ⬇️
superset-frontend/src/views/CRUD/types.ts 100.00% <0.00%> (ø)
superset/views/core.py 75.39% <0.00%> (+0.01%) ⬆️
...-frontend/src/views/CRUD/welcome/ActivityTable.tsx 72.36% <0.00%> (+6.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 974f447...5a2e099. Read the comment docs.

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the chart type has been renamed, I'm wondering whether we should add a tooltip (or something else) to help old users find the graph chart option:

renamed-chart-type

But I'm sure people will eventually find it even without this tooltip.

…d_to_echart.py

Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
@junlincc
Copy link
Member

@ktmud agreed. I wanted to add tooltips + powered by Echarts to all the new Echarts and reorganize the gallery page.
tagged design-sys-revist. @mayurnewase if it's not much of work, please do add as suggested, we will redesign this page soon.

@mayurnewase
Copy link
Contributor Author

mayurnewase commented Feb 15, 2021

Cool!!!,
How to do it?
Migration to put notification in some table?
@ktmud

@ktmud
Copy link
Member

ktmud commented Feb 15, 2021

Since the chart type has been renamed, I'm wondering whether we should add a tooltip (or something else) to help old users find the graph chart option:

renamed-chart-type

But I'm sure people will eventually find it even without this tooltip.

Cool,how to do it?

Migration to put notification some table?

@ktmud

The tooltip is just a suggestion. We can hard-code a closable one-time tooltip if we want to implement it. It should satisfy following requirements:

  1. It should only display once for users who have not viewed it.
  2. Remember the viewed status in cookie or localStorage.
  3. The tooltip is open by default and the persistent viewed status will only be updated when it is scrolled into viewport.

If this is too much work, feel free to wait for the gallery modal redesign work.

@junlincc
Copy link
Member

@mayurnewase Mayur, let's not worry about the tooltip for now. Could you get the check pass? thanks!

@mayurnewase
Copy link
Contributor Author

@mayurnewase Mayur, let's not worry about the tooltip for now. Could you get the check pass? thanks!

Sorry didn't see superset-ui release.

@ktmud ktmud added the risk:db-migration PRs that require a DB migration label Feb 21, 2021
Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also getting this error on db upgrade:

  File "/Users/jesse_yang/opt/anaconda3/envs/superset/lib/python3.7/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/Users/jesse_yang/opt/anaconda3/envs/superset/lib/python3.7/site-packages/alembic/runtime/migration.py", line 522, in run_migrations
    step.migration_fn(**kw)
  File "/Users/jesse_yang/projects/incubator-superset/superset/migrations/versions/1412ec1e5a7b_legacy_force_directed_to_echart.py", line 64, in upgrade
    del params["collapsed_fieldsets"]
KeyError: 'collapsed_fieldsets'

I tested by creating a new Force Directed graph, change the link length, save it, check out the PR, then run superset db upgrade.

@mayurnewase
Copy link
Contributor Author

mayurnewase commented Feb 22, 2021

Hi, @ktmud according to your suggestions for tooltip I have few changes ready locally, which can help adding tooltip to any new chart.
changes below,
master...mayurnewase:chart-tooltip
apache-superset/superset-ui@master...mayurnewase:chart-tooltip

let me know if this can work until this modal gets rewritten, I will clean them up for pr.

Screencast.from.22-02-21.07.47.57.PM.IST.mp4

@junlincc

@ktmud
Copy link
Member

ktmud commented Feb 22, 2021

@mayurnewase Let's save it for another PR. Could you resolve the conflicts so we can merge this PR?

@rusackas
Copy link
Member

rusackas commented Feb 22, 2021

Agreed on merging this PR. I have some thoughts about the tooltip (and related work) but have been pocketing the ideas for a later date. Sneak preview of things I'd like to bring up soon-ish:
• Displaying the tooltip, and having it defined by the plugin as part of a metadata object
• Adding MORE (pre-defined) metadata fields to viz plugins (i.e. tags (realtime support, library used, annotations supported, crossfilters supported, etc)
• Adding the viz category, per SIP-34 or something like it (design needed)
• Adding collapsibles and tag filters to the viz gallery to take advantage of the above metadata
... but all that can wait :)

@ktmud
Copy link
Member

ktmud commented Feb 23, 2021

@rusackas Those are all great ideas! Would love to see them happen.

@ktmud
Copy link
Member

ktmud commented Feb 23, 2021

@mayurnewase your lock file was still using lockfileversion: 1 but we have recently upgraded to npm 7. Please upgrade your node and npm.

I've pushed a new commit to your branch to fix this and update the migration script to always override other params even if groupby or source/target is not present. No action needed if the CI passes.

cc @junlincc if you want to do a testing/product sign-off.

@junlincc junlincc self-requested a review February 24, 2021 00:41
Copy link
Member

@junlincc junlincc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as product sign-off.
This is really great, a million thanks for your contribution and collaborating with us! @mayurnewase

Screen Shot 2021-02-23 at 4 40 42 PM

My only feedback is. let's remove the directed-force sample chart from the list. do you mind opening another PR? 🙏

Screen Shot 2021-02-23 at 4 37 25 PM

@junlincc junlincc merged commit 6954114 into apache:master Feb 24, 2021
@ktmud
Copy link
Member

ktmud commented Feb 24, 2021

It seems there are still directed_force in both test fixtures and example charts. Let's cleaning them all up.

It'd also be great replace directed_force with graph_chart in viz type order list so that Graph Chart can appear in the same place where Force Directed used to be.

@junlincc
Copy link
Member

@guhan
flagging this PR for risk in db-migration and sample chart/dashboard break.

@ktmud
Copy link
Member

ktmud commented Feb 24, 2021

@junlincc Existing sample chart should not break if you run superset db upgrade, but if we don't fix the test scripts, newly populated sample charts after db migration may break.

@villebro
Copy link
Member

Let's address the sample charts in a follow up PR

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels risk:db-migration PRs that require a DB migration size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants