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(explore): Upgraded viz select gallery #15303

Merged
merged 20 commits into from
Jul 12, 2021
Merged

Conversation

suddjian
Copy link
Member

@suddjian suddjian commented Jun 22, 2021

SUMMARY

  • Organizes plugins by category
  • Displays chart descriptions and examples
  • Adds fuzzy search by name, tags, or description
  • Improves Add Chart page layout
  • Upgrades superset-ui version to populate lots of new plugin metadata
  • Improves the plugin context to provide metadata (along with updates to metadata i.e. dynamic plugins)
  • Fixes Dynamic plugin not showing up in VizTypeControl #15174
  • ✨ grid ✨

This feature branch had several PRs merged into it that were independently reviewed. Approving this should be pretty much a rubber stamp.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screen Shot 2021-07-02 at 5 32 43 PM

Initial Design:
Screen Shot 2021-06-11 at 3 38 58 PM

After:
Screen Shot 2021-07-02 at 5 31 42 PM

TESTING INSTRUCTIONS

  1. Create chart -> choose a viz type
  2. From explore, change viz type

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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
  • Introduces new feature or API
  • Removes existing feature or API

@suddjian suddjian changed the title Fancy viz select modal feat(explore): Upgraded viz select gallery Jun 22, 2021
* feat(viz): add categories to the viz picker

* fix test types

* add a catch-all category

* tweak layout

* upgrade superset-ui to get new metadata

* do i look like i know what a jpeg is

* fix tests

* lint

* remove script count test requirement

* fix e2e test
@codecov
Copy link

codecov bot commented Jun 24, 2021

Codecov Report

Merging #15303 (56dca6d) into master (2ebba51) will decrease coverage by 0.00%.
The diff coverage is 87.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15303      +/-   ##
==========================================
- Coverage   76.95%   76.94%   -0.01%     
==========================================
  Files         976      977       +1     
  Lines       51326    51852     +526     
  Branches     6912     7132     +220     
==========================================
+ Hits        39498    39899     +401     
- Misses      11607    11726     +119     
- Partials      221      227       +6     
Flag Coverage Δ
hive 81.29% <ø> (ø)
javascript 71.48% <87.90%> (+0.07%) ⬆️
mysql 81.56% <ø> (ø)
postgres 81.58% <ø> (ø)
presto 81.28% <ø> (-0.01%) ⬇️
python 82.10% <ø> (-0.01%) ⬇️
sqlite 81.19% <ø> (ø)

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

Impacted Files Coverage Δ
...nd/src/explore/components/ExploreViewContainer.jsx 2.15% <0.00%> (ø)
...c/visualizations/TimeTable/TimeTableChartPlugin.js 75.00% <ø> (ø)
...t-frontend/src/components/DynamicPlugins/index.tsx 37.28% <63.15%> (+18.13%) ⬆️
...plore/components/controls/VizTypeControl/index.tsx 86.04% <86.04%> (ø)
...perset-frontend/src/addSlice/AddSliceContainer.tsx 82.05% <90.00%> (+3.26%) ⬆️
...ponents/controls/VizTypeControl/VizTypeGallery.tsx 93.57% <93.57%> (ø)
superset-frontend/src/filters/components/common.ts 90.00% <0.00%> (-10.00%) ⬇️
...d/src/filters/components/Time/TimeFilterPlugin.tsx 88.88% <0.00%> (-3.42%) ⬇️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 72.23% <0.00%> (-1.42%) ⬇️
superset/db_engine_specs/presto.py 89.89% <0.00%> (-0.43%) ⬇️
... and 14 more

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 2ebba51...56dca6d. Read the comment docs.

* upgrade superset-ui, install fuse.js

* add metadata to plugin context

* get search working

* layout improvements

* fix tests

* Update superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* use typography size instead of grid unit

* comments

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
suddjian and others added 3 commits July 1, 2021 14:52
* feat(explore): add section for example images in viz type control

* fix jpg webpack config

* formatting
* separate viz gallery from the modal

* use gallery directly in add slice view

* more formatting on the add slice container

* restyle the thumbnail list

* explicit thumbnail width and height

* remove crappy hack

* remove useless line

* comment

* sort categories

* comments

* tweak search behavior

* fix tests

* open gallery to the currently selected viz type

* null safety

* show all plugins when searching empty string

* get the new metadatas

* adjust categories scrolling behavior

* add time series table metadata

* upgrade superset-ui

* attempt fixing tests

* upgrade descriptions

* fix unit test

* attempt fixing e2e again

* max width for viz gallery
@suddjian suddjian marked this pull request as ready for review July 3, 2021 00:36
@suddjian
Copy link
Member Author

suddjian commented Jul 3, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2021

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

@apache apache deleted a comment from github-actions bot Jul 3, 2021
@apache apache deleted a comment from github-actions bot Jul 3, 2021
@apache apache deleted a comment from github-actions bot Jul 3, 2021
@apache apache deleted a comment from github-actions bot Jul 3, 2021
@geido
Copy link
Member

geido commented Jul 4, 2021

First of all, this is looking great! Congrats

I wanted to do some manual testing out of curiosity and came up with the following feedback.

Selected viz type

When changing a viz type, the modal shows the correct title and description at the bottom. However, the selection of the category is incorrect and it is not showing the currently selected type.

Filter-Segments

Inconsistent search behaviour

When clicking on the search input, the category is automatically reset to the default. However, when clearing up the search the previously selected category gets selected back again. I think the behaviour should be consistent and clearing up should bring you to the default, not the previously selected category.

Filter-Segments-1

Default order

Do we have a default order when searching? Should it be alphabetical?

Screen Shot 2021-07-04 at 18 47 14

Unnecessary scroll bar

Just a minor thing. The scroll bar for the categories is showing up even though there are no other categories.

Filter-Segments-2

@rusackas
Copy link
Member

rusackas commented Jul 6, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2021

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

@EBoisseauSierra
Copy link
Contributor

Thank you for your brilliant work, it looks amazing! 🚀

Here are a some very minor details I've picked along the way:

Empty selection by default

When creating a new graph, the first chart type (here, Table) is selected by default (cf. lower half of the dialog). It would feel more natural (to me) that no chart is selected by default.

default_empty

Selection not cleared when changing category

In the same spirit, I'd like to be able to “clear” the selected visualization when changing category. Currently, the last selection “sticks” in the lower half of the dialog, even if that chart type isn't part of the currently selected Category (upper half). This can cause some confusion as I can have both “BigNumber” (selected chart type) and “Correlation” (selected category) at the same time…

sticky_selection

Charts categorization

I fully understand this is not a trivial task and that no solution might satisfy everyone. Here are just some of the chart categorisation that appeared unnatural to me:

  • Move deck.gl to Map: deck.gl charts are currently in Others. This seems intentional, yet it would feel more natural to me to find them in the Map category.
  • Move funnel to Flow: The funnel chart is currently listed in KPI, yet I understand that KPI charts should be more one single value, rather than the evolution of one value over a process/some given steps. In absolute terms “Evolution” would be a natural category as well, yet I understand that Funnel would contrast with the more TS-related chart that are currently in this category.
  • Horizon to Evolution?: Horizon is a tricky one, but because its abscissa is time, I'd put it in “Evolution”.
  • Ranking:
    • I see why WordCloud is there, but if I were to look for it, I wouldn't think it could be in the Ranking category (rather “Other”).
    • Nightingale would, for me, better fit in “Part of a whole” (if I understand that chart correctly) — or distribution.

I appreciate the ranking is coherent with D3's one (and I even voted in favour of that ranking in SIP-67)… but the categorization still feels a bit unnatural to me (i.e. if I were to look for a given chart, I'm not sure I would find it first time/I wouldn't struggle finding it — btw, the search bar is a must have, thanks!).

Browse through all charts at a glance

I am aware this defeats a large part of your work with the categorization, but something I like with D3's gallery is that I can have all chart types at a glance by scrolling through one single page. Here, when one clicks on a category, it filters out all the other charts.
Perhaps a presentation similar to Echarts gallery — where all charts are in one page, with categories as section headings and the list of categories on the left column allowing to “jump” to the right anchor (yet without “filtering out” any chart) — could help?

Add “deprecated” label

Some charts are due to be deprecated. This is detailed in their description, yet I feel this doesn't stand out enough. A grey “deprecated” tag (similar to tags in GitHub issues/PR) could help notice it more.
Introducing such tags could also serve in the future to identify “official” chart types from those developed by 3rd parties.

tag

Chart examples thumbnails scrollbar

On Firefox DevEd 90.0b12 (64-bit), with ×150% zoom, some “non-scrollable scrollbars” appear around the chart example thumbnails area. In general, I would expect the thumbnails to be more flexible in their sizing (as it's not such an issue if they are downscaled, unlike the description text), so that they adapt to their container instead of forcing it to display scrollbars.

Screenshot from 2021-07-07 10-08-04

Related to this, the chart description and thumbnail area are 2 separate components, with independent scrollbars. It would feel more natural to me to consider both elements as one unique “scrollable” entity. (I.e. have only one scrollbar on the far right, even if it's the text that overflows.)

Screenshot from 2021-07-07 10-58-58

This would mean that “Example” become a sub-heading of the chart type (here “Heatmap”) — one could either introduce the “Description” subheading as well for the left column, or get rid of the “Example” one?


All this being said, it's already such a huge step forward I'm very much looking forward to using in prod; thanks a lot!

@suddjian
Copy link
Member Author

suddjian commented Jul 7, 2021

Thank you both very much for the well-written feedback, paging @junlincc to get product eyes on this.

Some notes:

  • The edge case of non-scrollable scrollbars is pretty unavoidable in a grid-based design like this. At some point before things disappear off the edge of the container, the scrollbar has to appear. I don't think it would be worth the unsavory css margin hacks required to tweak when that occurs. A more responsive design could reduce the impact of this, maybe that would be a good follow-up.
  • The examples list in its current form is a temporary solution. Ultimately, we'd like to use a carousel or other solution. AntD has these components, but we will need to bump the version to get it working correctly.
  • I think a de-selected state makes sense. I've opened a PR to add that: feat(viz): Clear viz gallery when navigating between categories #15577

@junlincc junlincc added viz:gallery test:case doc:user User / Superset documentation labels Jul 7, 2021
* start viz gallery with null selection, clear when switching categories

* fix AddSliceContainer tests

* show a message when there is no viz type selected

* composition > inheritance

* clarify searching code
@rusackas
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

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

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

There are a lot of good ideas for iteration/improvement on the thread, but to my eyes, this thing looks like a huge improvement, and looks ready to merge!

Not for interested parties, that additional PRs in superset-ui to add metadata to the rest of the plugins, are underway right now

@@ -113,6 +113,7 @@
"emotion-rgba": "0.0.9",
"fontsource-fira-code": "^3.0.5",
"fontsource-inter": "^3.0.5",
"fuse.js": "^6.4.6",
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR, but I'll bet there are at least a few other places in Superset it would be awesome to apply this.

value: ChartMetadata;
};

const DEFAULT_ORDER = [
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how much value this DEFAULT_ORDER has anymore, but that discussion shouldn't block this PR.

() => selectedVizMetadata?.category || categories[0],
);

const fuse = useMemo(
Copy link
Member

Choose a reason for hiding this comment

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

Nit, but this might warrant a comment to explain it's using this Fuse component for fuzzy-search here, to save folks a googling.

@suddjian suddjian merged commit 257385e into master Jul 12, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* add modal layout with description, rework styles

* thirty percent

* test correctly

* avoid any changes in modal height

* typescriptify

* feat(viz): add categories to the viz picker (apache#15304)

* feat(viz): add categories to the viz picker

* fix test types

* add a catch-all category

* tweak layout

* upgrade superset-ui to get new metadata

* do i look like i know what a jpeg is

* fix tests

* lint

* remove script count test requirement

* fix e2e test

* feat(explore): Viz picker search improvements (apache#15399)

* upgrade superset-ui, install fuse.js

* add metadata to plugin context

* get search working

* layout improvements

* fix tests

* Update superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* use typography size instead of grid unit

* comments

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* feat(explore): Examples image gallery in the viz type control (apache#15489)

* feat(explore): add section for example images in viz type control

* fix jpg webpack config

* formatting

* feat(Explore): Viz gallery component tweaks (apache#15520)

* separate viz gallery from the modal

* use gallery directly in add slice view

* more formatting on the add slice container

* restyle the thumbnail list

* explicit thumbnail width and height

* remove crappy hack

* remove useless line

* comment

* sort categories

* comments

* tweak search behavior

* fix tests

* open gallery to the currently selected viz type

* null safety

* show all plugins when searching empty string

* get the new metadatas

* adjust categories scrolling behavior

* add time series table metadata

* upgrade superset-ui

* attempt fixing tests

* upgrade descriptions

* fix unit test

* attempt fixing e2e again

* max width for viz gallery

* update package lock

* undo unnecessary webpack changes

* don't show search results until something is entered

* force modal to open to selected viz type

* tweaks to search behavior

* gallery layout tweaks

* enshrine pivot table v2 in a place of honor

* feat(viz): Clear viz gallery when navigating between categories (apache#15577)

* start viz gallery with null selection, clear when switching categories

* fix AddSliceContainer tests

* show a message when there is no viz type selected

* composition > inheritance

* clarify searching code

* comment

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* add modal layout with description, rework styles

* thirty percent

* test correctly

* avoid any changes in modal height

* typescriptify

* feat(viz): add categories to the viz picker (apache#15304)

* feat(viz): add categories to the viz picker

* fix test types

* add a catch-all category

* tweak layout

* upgrade superset-ui to get new metadata

* do i look like i know what a jpeg is

* fix tests

* lint

* remove script count test requirement

* fix e2e test

* feat(explore): Viz picker search improvements (apache#15399)

* upgrade superset-ui, install fuse.js

* add metadata to plugin context

* get search working

* layout improvements

* fix tests

* Update superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* use typography size instead of grid unit

* comments

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* feat(explore): Examples image gallery in the viz type control (apache#15489)

* feat(explore): add section for example images in viz type control

* fix jpg webpack config

* formatting

* feat(Explore): Viz gallery component tweaks (apache#15520)

* separate viz gallery from the modal

* use gallery directly in add slice view

* more formatting on the add slice container

* restyle the thumbnail list

* explicit thumbnail width and height

* remove crappy hack

* remove useless line

* comment

* sort categories

* comments

* tweak search behavior

* fix tests

* open gallery to the currently selected viz type

* null safety

* show all plugins when searching empty string

* get the new metadatas

* adjust categories scrolling behavior

* add time series table metadata

* upgrade superset-ui

* attempt fixing tests

* upgrade descriptions

* fix unit test

* attempt fixing e2e again

* max width for viz gallery

* update package lock

* undo unnecessary webpack changes

* don't show search results until something is entered

* force modal to open to selected viz type

* tweaks to search behavior

* gallery layout tweaks

* enshrine pivot table v2 in a place of honor

* feat(viz): Clear viz gallery when navigating between categories (apache#15577)

* start viz gallery with null selection, clear when switching categories

* fix AddSliceContainer tests

* show a message when there is no viz type selected

* composition > inheritance

* clarify searching code

* comment

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* add modal layout with description, rework styles

* thirty percent

* test correctly

* avoid any changes in modal height

* typescriptify

* feat(viz): add categories to the viz picker (apache#15304)

* feat(viz): add categories to the viz picker

* fix test types

* add a catch-all category

* tweak layout

* upgrade superset-ui to get new metadata

* do i look like i know what a jpeg is

* fix tests

* lint

* remove script count test requirement

* fix e2e test

* feat(explore): Viz picker search improvements (apache#15399)

* upgrade superset-ui, install fuse.js

* add metadata to plugin context

* get search working

* layout improvements

* fix tests

* Update superset-frontend/src/explore/components/controls/VizTypeControl/index.tsx

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* use typography size instead of grid unit

* comments

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

* feat(explore): Examples image gallery in the viz type control (apache#15489)

* feat(explore): add section for example images in viz type control

* fix jpg webpack config

* formatting

* feat(Explore): Viz gallery component tweaks (apache#15520)

* separate viz gallery from the modal

* use gallery directly in add slice view

* more formatting on the add slice container

* restyle the thumbnail list

* explicit thumbnail width and height

* remove crappy hack

* remove useless line

* comment

* sort categories

* comments

* tweak search behavior

* fix tests

* open gallery to the currently selected viz type

* null safety

* show all plugins when searching empty string

* get the new metadatas

* adjust categories scrolling behavior

* add time series table metadata

* upgrade superset-ui

* attempt fixing tests

* upgrade descriptions

* fix unit test

* attempt fixing e2e again

* max width for viz gallery

* update package lock

* undo unnecessary webpack changes

* don't show search results until something is entered

* force modal to open to selected viz type

* tweaks to search behavior

* gallery layout tweaks

* enshrine pivot table v2 in a place of honor

* feat(viz): Clear viz gallery when navigating between categories (apache#15577)

* start viz gallery with null selection, clear when switching categories

* fix AddSliceContainer tests

* show a message when there is no viz type selected

* composition > inheritance

* clarify searching code

* comment

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
@mistercrunch mistercrunch deleted the fancy-viz-select-modal branch March 26, 2024 16:11
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 doc:user User / Superset documentation preset-io size/XXL test:case viz:gallery 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic plugin not showing up in VizTypeControl
6 participants