superset icon indicating copy to clipboard operation
superset copied to clipboard

Sankey diagram with loops doesn't work

Open svdimchenko opened this issue 3 years ago • 13 comments

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Add sankey diagram with loops using instructions https://www.npmjs.com/package/@superset-ui/legacy-plugin-chart-sankey-loop
  2. Write test query:
SELECT "a" AS e1,
"b" as e2,
7 as counts
UNION ALL 
SELECT "b" AS e1,
 "c" as e2,
5 as counts
UNION ALL 
SELECT "c" AS e1,
 "a" as e2,
2 as counts
UNION ALL 
SELECT "c" AS e1,
 "b" as e2,
1 as counts
  1. Create chart using Sankey Diagram with Loops
  2. See error image

Expected results

Build sankey diagram with loop like in examples image

Actual results

Received error (screenshot added above)

Environment

(please complete the following information):

  • browser type and version:
  • superset version: 1.3.2
  • python version: python3.8
  • node.js version: node 14
  • any feature flags active: {"ALERT_REPORTS": True}

Checklist

Make sure to follow these steps before submitting your issue - thank you!

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

svdimchenko avatar Jan 20 '22 07:01 svdimchenko

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[bot] avatar Apr 17 '22 19:04 stale[bot]

Any resolution for this?

mlmaverick avatar Jul 27 '22 08:07 mlmaverick

The PR was closed automatically. I'm using patch on my installation and it works.

svdimchenko avatar Jul 27 '22 17:07 svdimchenko

@svdimchenko Hi, what kind of patch is it? Available somewhere on github?

mlmaverick avatar Jul 27 '22 21:07 mlmaverick

Here it is https://github.com/apache/superset/pull/18110

svdimchenko avatar Jul 28 '22 05:07 svdimchenko

Oh, sorry the stale bot closed that, and sorry it didn't get more attention. If you have any interest in re-opening that PR, we can try to get more support for it this time around.

In general, the looped sankey doesn't see a lot of use that I'm aware of. While it's not a high priority to fix compared to other issues/plugins, I'm happy to try to help any PR get reviews!

rusackas avatar Dec 13 '22 22:12 rusackas

Hi everyone, I think this feature is important 💯 I hope it will be implemented in the future 🙏

bonamim avatar Mar 27 '23 16:03 bonamim

+1 for fixing this issue. Loops are a regular thing when it comes to user flows.

JelenaKitanovic avatar May 27 '23 09:05 JelenaKitanovic

+1 hope there is a soltuion, can we ignore the loop at least instead of throwing the chart ?

nicomoya123 avatar Feb 12 '24 19:02 nicomoya123

Ideally, we'd move this to a new ECharts sankey diagram, but it seems cycles/loops not yet implemented there either. Here's a thread to chime in on if you want to see this feature: https://github.com/apache/echarts/issues/19505

rusackas avatar Jun 10 '24 19:06 rusackas

Otherwise, this chart type is seriously at risk of being deprecated. If anyone wants to step up with a fix, that'd be great, but this thread is otherwise at risk of being closed as stale.

rusackas avatar Jun 10 '24 19:06 rusackas

Hello, I also want to see more than 2 source/targets on this chart but it doesn't work.

image

worthy7 avatar Jun 25 '24 05:06 worthy7

@worthy7 I'd recommend starting a topical thread if you want to get into the modeling of a sankey (since it's not related to the issue reported), but that's not how it works, though. The data should be structured to have a source/target, like so:

source target value
animal reptile 123
animal primate 644
animal insect 2343
primate human 13
primate orangutan 123
primate chimp 234
reptile snake 123
reptile lizard 432
lizard iguana 23
lizard gila monster 12

rusackas avatar Jun 25 '24 15:06 rusackas