dosubot[bot] commented on issue #36238:
URL: https://github.com/apache/superset/issues/36238#issuecomment-3574239494

   <!-- Answer -->
   Superset’s Sankey chart does treat 'source' and 'target' as two separate 
columns, but if a row has the same value for both, it creates a self-loop. The 
underlying ECharts library requires the data to form a Directed Acyclic Graph 
(DAG), so any self-loop (where source equals target) will cause the chart to 
fail to render—this is a technical limitation from ECharts, not something 
configurable in Superset itself[^1][^2].
   
   Superset does not automatically filter or handle these cases, so you’ll need 
to preprocess your data to exclude rows where source and target are equal 
before visualizing with a Sankey chart. There aren’t any built-in chart types 
or plugins in Superset that support self-loops or cyclic data for Sankey 
diagrams. If you need to visualize such relationships, you’d need to consider a 
custom visualization plugin[^3].
   
   If you want help with a SQL example or a data transformation to filter out 
self-loops, let me know!
   
   [^1]: [Sankey transformProps.ts 
code](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/transformProps.ts)
   [^2]: [Sankey chart control panel 
config](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/controlPanel.tsx)
   [^3]: [Custom visualization plugin 
PR](https://github.com/apache/superset/pull/36028)
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/69e0f760-5405-44e8-8e57-67ca94e1e1ff?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/69e0f760-5405-44e8-8e57-67ca94e1e1ff?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/69e0f760-5405-44e8-8e57-67ca94e1e1ff?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/69e0f760-5405-44e8-8e57-67ca94e1e1ff?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/69e0f760-5405-44e8-8e57-67ca94e1e1ff?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/69e0f760-5405-44e8-8e57-67ca94e1e1ff?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/69e0f760-5405-44e8-8e57-67ca94e1e1ff?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Superset%E2%80%99s%20Sankey%20chart%20does%20treat%20%27source%27%20and%20%27target%27%20as%20two%20separate%20columns%2C%20but%20if%20a%20row%20has%20the%20same%20value%20for%20both%2C%20it%20creates%20a%20self-loop.%20The%20underlying%20ECharts%20library%20requires%20the%20data%20to%20form%20a%20Directed%20Acyclic%20Graph%20%28DAG%29%2C%20so%20any%20self-loop%20%28where%20source%20equals%20target%29%20will%20cause%20the%20chart%20to%20fail%20to%20render%E2%80%94this%20is%20a%20technical%20limitation%20from%20ECharts%2C%20not%20something%20configurable%20in%20Superset%20itself%5B%5E1%5D%5B%5E2%5D.%0A%0ASuperset%20does%20not%20automatically%20filter%20or%20handle%20these%20cases%2C%20so%20you%E2%80%99ll%20need%20to%20preprocess%20your%20data%20to%2
 
0exclude%20rows%20where%20source%20and%20target%20are%20equal%20before%20visualizing%20with%20a%20Sankey%20chart.%20There%20aren%E2%80%99t%20any%20built-in%20chart%20types%20or%20plugins%20in%20Superset%20that%20support%20self-loops%20or%20cyclic%20data%20for%20Sankey%20diagrams.%20If%20you%20need%20to%20visualize%20such%20relationships%2C%20you%E2%80%99d%20need%20to%20consider%20a%20custom%20visualization%20plugin%5B%5E3%5D.%0A%0AIf%20you%20want%20help%20with%20a%20SQL%20example%20or%20a%20data%20transformation%20to%20filter%20out%20self-loops%2C%20let%20me%20know%21%0A%0A%5B%5E1%5D%3A%20%5BSankey%20transformProps.ts%20code%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/transformProps.ts%29%0A%5B%5E2%5D%3A%20%5BSankey%20chart%20control%20panel%20config%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/Sankey/controlPanel.tsx%29%0A%5B%5E3%5D%3A%20%5BCustom%20visual
 
ization%20plugin%20PR%5D%28https%3A//github.com/apache/superset/pull/36028%29)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36238)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to