超现代可视化的故事sankey chart

Data Science has been gaining momentum over the past couple of years. It’s undoubtedly one of the hottest fields in today’s time. In this article, I am going to discuss about an essential part of Data Science - Data Visualization.

过去几年中,数据科学一直在发展。 无疑,它是当今时代最热门的领域之一。 在本文中,我将讨论数据科学的重要部分-数据可视化。

Data Visualization is an integral part of the Data Science process which can help you to gain insights and comprehend your data better so that you can make optimum usage of the data while building machine learning models.

数据可视化是数据科学流程不可或缺的一部分,它可以帮助您获得见解并更好地理解数据,以便在构建机器学习模型时可以最佳地利用数据。

In this series, I am going to take you through some immensely useful yet unexplored charts. So let’s start with the:

在本系列中,我将带您浏览一些非常有用但尚未开发的图表。 因此,让我们开始:

桑基图 (Sankey Chart)

Sankey charts are like flow charts wherein the width of the arrows represent the amount of flow. The nodes are the values from which and to which the data flows, the width of the link represents the amount of data flowing. The source and the target are specified with respect to the node’s indices and the values which represent the amount of the data flowing should be mentioned.

Sankey图表类似于流程图,其中箭头的宽度表示流量。 节点是数据从中流向的值,链接的宽度表示数据流的量。 相对于节点的索引指定目标,并应提及代表流数据量的

Here, I have incorporated a very basic Sankey Chart which exhibits the flow of customers from Base, Silver and Gold tiers with respect to the first and second year. I have made it using Plotly so that it’s interactive. So feel free to hover over it to get more insights :)

在这里,我合并了一个非常基本的Sankey图表,该图表显示了第一年和第二年来自基础,白银和金级的客户流量。 我已经使用Plotly制作了它,使其具有交互性。 因此,随时将鼠标悬停在它上面以获得更多见解:)

Here, the nodes are Year 1 Base, Year 2 Base and the values to and from data is flowing, on hovering over the chart, the source, target and values would be displayed.

在这里,节点是Year 1 BaseYear 2 Base ,数据往返的值正在流动,将鼠标悬停在图表上时,将显示sourcetargetvalue

Image by Author
图片作者

You will find my entire source code here. On hovering, you’ll realize that it shows us how many customers have migrated from one tier to another tier.

您将在此处找到我的整个源代码 悬停时,您将意识到,它向我们显示了从一个层迁移到另一层的客户数量。

This chart is thus very useful when we are expected to visualize for huge datasets. I have recreated a chart using reference from Plotly which is a perfect example which reflects the usefulness of the Sankey Chart when we’re handling large data with lots of inter connectivity.The chart below shows the Energy Forecast for 2050. Make sure you hover over the chart to get better insights. The positioning of the nodes can be changed as per the user’s convenience.

因此,当我们期望可视化巨大的数据集时,此图表非常有用。 我已使用Plotly的参考重新创建了一个图表,这是一个完美的示例,它反映了Sankey图表在处理具有大量相互连接的大数据时的用处。下图显示了2050年的能源预测。请确保将鼠标悬停在图表以获得更好的见解。 可以根据用户的方便更改节点的位置。

P.S. You can play around with the chart and try experimenting with your own values here by clicking on the Edit Chart option :)

PS:您可以使用图表,然后单击“编辑图表”选项来尝试使用自己的值:)

Image by Author
图片作者

One additional feature here is that the colors of the nodes and the links can be customized according to preference. This Chart from Google Charts is a perfect example for the same.

这里的一个附加功能是可以根据喜好自定义节点和链接的颜色。 Google Charts的这张Chart就是一个完美的例子。

超现代可视化的故事sankey chart
Sankey Chart. Source: Google Charts
桑基图。 资料来源:Google图表

Conclusion:

结论:

Sankey Chart is easily one of the best charts that can be used to represent the flow of big data from the Source node to the Target node.

Sankey图表很容易是最好的图表之一,可用于表示从节点到目标节点的大数据流。

  1. It is especially useful when we are handling big data and we are expected to visualize the flow of data among a lot parameters.

    当我们处理大数据并且希望可视化大量参数之间的数据流时,此功能特别有用。
  2. The directed arrows in the Sankey Charts helps one understand the flow of data in the production environment which makes them so useful.

    Sankey Charts中的有向箭头可帮助您了解生产环境中的数据流,这使它们如此有用。
  3. Sankey Charts are majorly used for visualisation for materials or energy flows.

    Sankey图表主要用于可视化物料或能量流。
  4. They help to uncover the inconsistencies in the data very easily due to attractive and informative design.

    由于引人入胜且信息丰富的设计,它们可以非常轻松地发现数据中的不一致之处。

I will strongly recommend everyone to try it once!

我会强烈建议大家尝试一次!

Google Charts

Google图表

Plotly

密谋

Source Code for the 1st visualization

第一次可视化的源代码

翻译自: https://towardsdatascience.com/the-tale-of-ultra-modern-visualizations-sankey-chart-5da0885eee1c