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

Box plot does not filter in dashboard #9130

Closed
2 of 3 tasks
eugeniamz opened this issue Feb 13, 2020 · 9 comments · Fixed by #11199
Closed
2 of 3 tasks

Box plot does not filter in dashboard #9130

eugeniamz opened this issue Feb 13, 2020 · 9 comments · Fixed by #11199
Labels
.pinned Draws attention

Comments

@eugeniamz
Copy link

When applying filters in the dashboard the box plot does not filter, not even when force refresh.
However, the filter does apply when select Edit Dashboard.

Expected results

When applying filters in the filter box, box plot should also filter.

Actual results

When applying filters all the charts get filter, except the box plot; but if you click Edit Dashboard the box plot gets updated.

Screenshots

If applicable, add screenshots to help explain your problem.
image

How to reproduce the bug

  1. Go to "World Bank's Data" dashboard
  2. Select a region in Filter
  3. See Box Plot does not get updated
  4. Force Refresh in Box Plot
  5. See Box Plot does not get updated
  6. Edit Dashboard
  7. Box Plot get updated

Environment

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

I am using Superset version installed in Preset Alpha.

@elaragon
Copy link

I am experiencing the exact same problem, surprisingly, I just found that box plots refresh when:

  • zooming in/out in the web browser.
  • clicking on "Explore Chart" and then returning to the dashboard

I hope this helps to fix this bug soon 🙏

@carstenkolve
Copy link

This might be related (or a separate issues), but when editing a chart of type 'box plot', I find that any updated in the 'Group by' field of the 'Query' section are only being reflected when I 'run query' and reload the browser page; the auto-update behaviour I see with the other viz types does not seem to work here.

@stale
Copy link

stale bot commented Jul 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Jul 25, 2020
@stale stale bot closed this as completed Aug 1, 2020
@mistercrunch mistercrunch added the .pinned Draws attention label Aug 2, 2020
@mistercrunch mistercrunch reopened this Aug 2, 2020
@stale stale bot removed the inactive Inactive for >= 30 days label Aug 2, 2020
@mistercrunch
Copy link
Member

Re-opening until we get clear confirmation that this is actually fixed.

@gtg472b
Copy link
Contributor

gtg472b commented Sep 6, 2020

I am experiencing the exact same problem, surprisingly, I just found that box plots refresh when:

  • zooming in/out in the web browser.
  • clicking on "Explore Chart" and then returning to the dashboard

I hope this helps to fix this bug soon 🙏

This is exactly what I'm noticing too. Spent over an hour thinking it was something weird with the data causing a problem. Did you find a fix @elaragon?

I've also noticed that changing the browser window size will also force an update, so this must be on the javascript side of things.

@gtg472b
Copy link
Contributor

gtg472b commented Sep 7, 2020

OK if anyone is just dying for a quick workaround (that's ugly as hell):

index c3839f46..10d2822e 100644
--- a/superset-frontend/node_modules/@superset-ui/preset-chart-xy/esm/BoxPlot/legacy/transformProps.js
+++ b/superset-frontend/node_modules/@superset-ui/preset-chart-xy/esm/BoxPlot/legacy/transformProps.js
@@ -21,7 +21,10 @@ exports.default = transformProps;
  * specific language governing permissions and limitations
  * under the License.
  */
+var widthToggleValue = 1;
 function transformProps(chartProps) {
+  chartProps.width += widthToggleValue;
+  widthToggleValue *= -1;
   const {
     width,
     height,

This forces a resize event which causes the Box Plot to actually update on-screen. The toggling seems important (it didn't trigger with just always subtracting one). Plus, I think it might minimize the odds of runaway chart resizing.

I give up trying to find the root cause, and this will work well enough for me. I tried tracing it and can't find what's missing.

@villebro
Copy link
Member

villebro commented Sep 8, 2020

@gtg472b we have started introducing ECharts as the new official chart library as part of SIP-50, with Pie chart currently being migrated: apache-superset/superset-ui#772. The plan is to migrate Boxplot to ECharts, too, but I haven't gotten around to doing it yet. If someone wants to take the lead on migrating Boxplot, I'd be happy to collaborate. Check the ECharts gallery for example Boxplot charts: https://echarts.apache.org/examples/en/index.html#chart-type-boxplot

@gtg472b
Copy link
Contributor

gtg472b commented Sep 8, 2020

Thanks for the info @villebro . I know a lot of these visualizations are being deprecated. I just needed to get that Box Plot to work for now, so it'll hold me over till something replaces it. I've made a lot of mild tweaks to several of the visualizations but it appears the project (sensibly) isn't accepting PRs on any of the deprecated ones. I started looking at building a plugin last night, but...the new Superset code deleted my custom Markup visualizations (I added the ability to reference data via Jinja as per #6771). So, if I start on a plugin, that'll be the one I work on first. If it goes well then I will try to look at these Echart ones!

@villebro
Copy link
Member

villebro commented Sep 8, 2020

Sounds good 👍 please feel free to reach out on Slack if/when you start working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.pinned Draws attention
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants