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: Adds drill to detail context menu for ECharts visualizations #20891

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Adds drill to detail (drill-through) context menu for ECharts visualizations. The context menu is triggered when right-clicking an EChart series. Upon selecting a drill to detail option, an alert is displayed with the selected values.

The linking between the context menu and the actual feature will be handled in a future PR.

The context menu was added to all ECharts with the exception of the Tree Chart.

The feature is behind the DRILL_TO_DETAIL feature flag.

This first iteration focuses on providing a minimal set of interaction possibilities for the ECharts. More advanced interactions like clicking on legends, subheaders, etc will be handled in follow-up PRs. Drilling to detail using metrics is not supported as well.

@kasiazjc @lauderbaugh @rusackas @codyml

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2022-07-27.at.2.40.50.PM.mov

TESTING INSTRUCTIONS

1 - Make sure the feature does not introduce any regression when disabled. This is the default value for the feature flag.

2 - Enable the DRILL_TO_DETAIL feature flag and check:

  • Check if there are no regressions when right-clicking the series for different charts
  • Check if the right-click works with different chart control values (dimensions, time grain, customizations, etc)
  • Check if the correct values are displayed in the context menu
  • Check if the correct values are displayed when selecting a context menu option
  • Check if other dashboard interactions are not affected by the new feature such as cross-filtering, drag-and-drop, tooltips, etc

Below is the import file for the dashboard shown in the video:
dashboard_export_20220727T144027.zip

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: DRILL_TO_DETAIL
  • 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

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #20891 (e68262b) into master (9114175) will decrease coverage by 0.08%.
The diff coverage is 64.50%.

❗ Current head e68262b differs from pull request most recent head 5adb031. Consider uploading reports for the commit 5adb031 to get more accurate results

@@            Coverage Diff             @@
##           master   #20891      +/-   ##
==========================================
- Coverage   66.35%   66.26%   -0.09%     
==========================================
  Files        1767     1769       +2     
  Lines       67353    67464     +111     
  Branches     7145     7168      +23     
==========================================
+ Hits        44691    44708      +17     
- Misses      20834    20926      +92     
- Partials     1828     1830       +2     
Flag Coverage Δ
javascript 52.01% <64.48%> (-0.10%) ⬇️

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

Impacted Files Coverage Δ
...packages/superset-ui-core/src/query/types/Query.ts 100.00% <ø> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <ø> (ø)
...rts/src/BigNumber/BigNumberTotal/transformProps.ts 0.00% <0.00%> (ø)
...lugin-chart-echarts/src/BigNumber/BigNumberViz.tsx 0.00% <0.00%> (ø)
...lugin-chart-echarts/src/BoxPlot/EchartsBoxPlot.tsx 0.00% <0.00%> (ø)
.../plugins/plugin-chart-echarts/src/BoxPlot/types.ts 0.00% <ø> (ø)
.../plugin-chart-echarts/src/Funnel/EchartsFunnel.tsx 0.00% <0.00%> (ø)
...d/plugins/plugin-chart-echarts/src/Funnel/types.ts 100.00% <ø> (ø)
...ns/plugin-chart-echarts/src/Gauge/EchartsGauge.tsx 0.00% <0.00%> (ø)
...ns/plugin-chart-echarts/src/Graph/EchartsGraph.tsx 0.00% <0.00%> (ø)
... and 36 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@zhaoyongjie
Copy link
Member

@michael-s-molina Looking at the screenshot, there is one thing that needs to be added. When a time dimension is clicked with time grain applied, the time grain needs to be passed at the same time.

BTW, why needs a formattedVal in the filter?

@michael-s-molina
Copy link
Member Author

michael-s-molina commented Jul 28, 2022

@michael-s-molina Looking at the screenshot, there is one thing that needs to be added. When a time dimension is clicked with time grain applied, the time grain needs to be passed at the same time.

Good point! I'll work on it.

BTW, why needs a formattedVal in the filter?

Currently, the logic for formatting the values is contained in each plugin. Depending on the plugin type the values can be formatted differently. When exhibiting these values in the context menu and also later in the modal, we need to present the values with the exact formatting used by the plugin. At the same time, we need the original value for the endpoint. Some examples are dates, currencies, decimals, etc.

@michael-s-molina
Copy link
Member Author

@zhaoyongjie Added the time grain for Timeseries and MixedTimeseries.

@michael-s-molina michael-s-molina added the need:qa-review Requires QA review label Jul 28, 2022
@jinghua-qa
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

@jinghua-qa Ephemeral environment spinning up at http://54.68.14.156:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@jinghua-qa
Copy link
Member

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DRILL_TO_DETAIL=true

@github-actions
Copy link
Contributor

@jinghua-qa Ephemeral environment spinning up at http://34.219.213.123:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@michael-s-molina
Copy link
Member Author

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DRILL_TO_DETAIL=true

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

@michael-s-molina Ephemeral environment spinning up at http://54.148.127.0:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@jinghua-qa
Copy link
Member

I found that in treemap, if i move my mouse to the white edge and it will show drill to details too, is that expected?

Screen.Recording.2022-08-02.at.9.11.42.AM.mov

@michael-s-molina
Copy link
Member Author

I found that in treemap, if i move my mouse to the white edge and it will show drill to details too, is that expected?

No, it's not 😆. I'll fix it.

@michael-s-molina
Copy link
Member Author

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DRILL_TO_DETAIL=true

@michael-s-molina
Copy link
Member Author

michael-s-molina commented Aug 4, 2022

I found that in treemap, if i move my mouse to the white edge and it will show drill to details too, is that expected?

Fixed

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2022

@michael-s-molina Ephemeral environment spinning up at http://35.89.204.156:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@jinghua-qa jinghua-qa left a comment

Choose a reason for hiding this comment

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

tested regression and feature flag on, LGTM

@@ -62,6 +64,13 @@ type BigNumberVisProps = {
trendLineData?: TimeSeriesDatum[];
mainColor: string;
echartOptions: EChartsCoreOption;
onContextMenu?: (
filters: QueryObjectFilterClause[],
offsetX: number,

This comment was marked as resolved.

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

thanks for the new feature, quick first pass review.

Comment on lines +123 to +125
if (!isEqual(this.state, nextState)) {
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (!isEqual(this.state, nextState)) {
return true;
}
return !isEqual(this.state, nextState)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to return unless the state changes. If the state is the same, it should execute the code below these lines.

if (!isEqual(this.state, nextState)) {
   return true;
}

this.hasQueryResponseChange = nextProps.queriesResponse !== this.props.queriesResponse;
...

@@ -84,6 +86,25 @@ export default function EchartsTreemap({
handleChange([name]);
}
},
contextmenu: eventParams => {

This comment was marked as resolved.

@codyml
Copy link
Member

codyml commented Aug 9, 2022

Tested each viz type and left 2 notes for issues I found, otherwise looks great!

@geido
Copy link
Member

geido commented Aug 9, 2022

/testenv up FEATURE_DASHBOARD_CROSS_FILTERS=true FEATURE_DRILL_TO_DETAIL=true

@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2022

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

@geido
Copy link
Member

geido commented Aug 9, 2022

First of all, this looks great!

A few minor issues that I found:

  • Not a big deal, but you can click way after the number in the Big Number

Screenshot 2022-08-09 at 19 50 27

  • Another small one. It would be great if the dropdown could be shown in the upper side when it does not have enough visible space to save some of the scrolling

Screenshot 2022-08-09 at 19 59 34

  • In a graph chart we can only click on the line but not on the node, is that normal?

  • One more thing about the graph is that when right-clicking the animation is triggered and it creates confusion as the nodes start moving. Not sure if there is a way to stop the chart animation when right-clicking

  • For some reasons, when trying to close the dropdown by clicking 2 or 3 px from its left side, it won't close. I found it annoying for the user as I ended up clicking a few times to try closing it up. For some reasons, it does not happen if you click on any other side, even 1 px away from its side. This is an Antdesign issue though. Just pointing out if there is a quick fix.

I believe the above are all minor issues that we can handle in separate PRs.

@michael-s-molina
Copy link
Member Author

@codyml @geido Great comments! Thanks again for testing the feature.

My last commit fixed:

If you right-click on the dimension label for Treemap v2, the menu looks like it has a broken option:

Not a big deal, but you can click way after the number in the Big Number

I decided to follow @geido's suggestion and tackle the remaining comments in follow-up PRs so that @codyml can rebase his PR on top of this one. I'll create tickets for them.

Copy link
Member

@codyml codyml left a comment

Choose a reason for hiding this comment

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

LGTM!

@michael-s-molina michael-s-molina merged commit 3df8335 into apache:master Aug 9, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2022

Ephemeral environment shutdown and build artifacts deleted.

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 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 need:qa-review Requires QA review size/XL 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants