在Azure Data Studio中探索SandDance可视化扩展

Azure Data Studio is an open-source, cross-platform and lightweight data management tool. We can use it for on-premise SQL Server, Azure SQL database and Azure SQL data warehouse. Previously we knew this tool as SQL Operations Studio.

Azure Data Studio是一个开源,跨平台,轻量级的数据管理工具。 我们可以将其用于本地SQL Server,Azure SQL数据库和Azure SQL数据仓库。 以前,我们将该工具称为SQL Operations Studio。

  • General Availability release date: 24th September 2018 (v1.0)

    正式发布日期:2018年9月24日(v1.0)
  • Current release : October Release (v 1.12.2)

    当前版本:10月版本(v 1.12.2)

Download and install Azure Data studio using the link on a suitable platform.

使用链接在合适的平台上下载并安装Azure Data Studio。

在Azure Data Studio中探索SandDance可视化扩展

Azure Data Studio introduces new features using extensions in the marketplace. You can follow SQLShack for useful extensions for developers and DBA. This article explores the well known and influential visualization tool SandDance using extensions in this tool.

Azure Data Studio使用市场中的扩展引入了新功能。 您可以遵循SQLShack获得对开发人员和DBA有用的扩展。 本文使用此工具中的扩展功能,探索了著名的有影响力的可视化工具SandDance。

SandDance可视化简介 (Introduction to SandDance Visualization)

SandDance is a useful data visualization extension from a Microsoft research project. We can use it to identify data patterns, trends and insights. An interactive chart can be customized easily. It also provides decision-making capability. We can display individual and aggregate data as well in this chart:

SandDance是Microsoft研究项目提供的有用的数据可视化扩展。 我们可以使用它来识别数据模式,趋势和见解。 交互式图表可以轻松自定义。 它还提供决策能力。 我们也可以在此图表中显示单个和汇总数据:

在Azure Data Studio中探索SandDance可视化扩展

Let’s install SandDance visualization in Azure Data Studio. Navigate to Extension on the left vertical menu bar and search it using keyword Sand:

让我们在Azure Data Studio中安装SandDance可视化。 导航到左侧垂直菜单栏上的扩展,并使用关键字Sand搜索它:

在Azure Data Studio中探索SandDance可视化扩展

Click on Install. It quickly installs SandDance visualization as shown below:

点击安装 。 它可以快速安装SandDance可视化文件,如下所示:

在Azure Data Studio中探索SandDance可视化扩展

准备用于SandDance可视化的数据 (Prepare data for SandDance visualization)

In this example, we use Big Mart Sales Data for visualization. You can download it from this link.

在此示例中,我们使用Big Mart销售数据进行可视化。 您可以从此链接下载它。

Download the CSV file and save it into a folder. In Azure Data Studio, navigate to File | Open Folder:

下载CSV文件并将其保存到文件夹中。 在Azure Data Studio中,导航到“文件| 打开文件夹:

在Azure Data Studio中探索SandDance可视化扩展

Browse to the folder that contains the CSV file and click on Select Folder:

浏览到包含CSV文件的文件夹,然后单击“ 选择文件夹”

在Azure Data Studio中探索SandDance可视化扩展

It loads all files present in this folder, and you can see them in the EXPLORER section as shown below:

它会加载此文件夹中存在的所有文件,您可以在EXPLORER部分中看到它们,如下所示:

在Azure Data Studio中探索SandDance可视化扩展

Right-click on this CSV and select the View in SandDance option:

右键单击此CSV,然后选择“ 在SandDance中查看”选项:

在Azure Data Studio中探索SandDance可视化扩展

Once you click on View in SandDance, it launches the default visualization as shown below:

单击“ SandDance中的视图”后,它将启动默认的可视化效果,如下所示:

在Azure Data Studio中探索SandDance可视化扩展

By default, it shows the column chart type. We can drag this chart and place it as the desired location. For example, I moved the chart in the bottom part of the page:

默认情况下,它显示柱形图类型。 我们可以拖动此图表并将其放置在所需的位置。 例如,我将图表移至页面底部:

在Azure Data Studio中探索SandDance可视化扩展

It is an interactive chart, and once we hover the mouse over any column bar, it shows detailed information in the tooltip:

它是一个交互式图表,一旦我们将鼠标悬停在任何栏上,它就会在工具提示中显示详细信息:

在Azure Data Studio中探索SandDance可视化扩展

Once we click on View in SandDance, it automatically selects the column mapping as per predefined algorithms. In the above screenshot, we can see X-Axis column mapping for Item_Fat_Content.

一旦我们单击“ SandDance中的视图”,它就会根据预定义的算法自动选择列映射。 在上面的屏幕截图中,我们可以看到Item_Fat_Content的X轴列映射。

In the drop-down of column mapping, it shows all columns. Choose the required column, and it changes the chart immediately as per the selection. For example, the following screenshot, it shows X-axis for Item_type column:

在列映射的下拉列表中,它显示所有列。 选择所需的列,它会根据选择立即更改图表。 例如,以下屏幕截图显示了Item_type列的X轴:

在Azure Data Studio中探索SandDance可视化扩展

Similarly, change the columns for color by and sort by for representing data in a better way:

同样,更改列的颜色,并按更好的方式排序以表示数据:

在Azure Data Studio中探索SandDance可视化扩展

We will cover more chart options in another part of the article. Let’s first explore other chart types available in SandDance.

我们将在本文的另一部分介绍更多图表选项。 首先让我们探索SandDance中可用的其他图表类型。

密度图 (Density chart )

Let’s change the chart type as Density and choose the required columns in the X and Y-axis. We get different chart options for each chart type:

让我们将图表类型更改为“密度”,然后在X和Y轴上选择所需的列。 对于每种图表类型,我们都有不同的图表选项:

在Azure Data Studio中探索SandDance可视化扩展

Change the required columns for the x and y-axis for the density chart for reflecting the change:

更改密度图表的x和y轴所需的列,以反映更改:

在Azure Data Studio中探索SandDance可视化扩展

Azure Data Studio中的散点图 (Scatter chart in Azure Data Studio)

Scatter graph is the most commonly used Sandance visualization. Click on Scatter and choose the required mappings.

散点图是最常用的Sandance可视化。 单击分散,然后选择所需的映射。

In this scatter chart, we use the following mappings:

在此散点图中,我们使用以下映射:

  • X-axis: Item-type

    X轴:项目类型
  • Y-Axis: Item_visibility

    Y轴:Item_visibility
  • Color by: Item_Fat_Content

    颜色:Item_Fat_Content
  • Sort by: Item_MRP

    排序依据:Item_MRP

It also shows different data point colors for the Item_Fat_Content column for values LF, Low fat, regular, low fat, and reg:

它还为LF,低脂,常规,低脂和reg值的Item_Fat_Content列显示了不同的数据点颜色:

在Azure Data Studio中探索SandDance可视化扩展

Click on the data point column (right side corner box), and it gives you a list of available columns. Let’s change the column to outlet_identifier:

单击数据点列(右侧角框),它会为您提供可用列的列表。 让我们将列更改为outlet_identifier:

在Azure Data Studio中探索SandDance可视化扩展

We can see changes in the scatter chart, as shown below:

我们可以在散点图中看到更改,如下所示:

在Azure Data Studio中探索SandDance可视化扩展

SandDance for Azure Data Studio中的树状图 (Treemap chart in SandDance for Azure Data Studio)

Treemap data visualization is useful for displaying hierarchical data using the nested rectangles. Choose the chart type as a treemap. In the following screenshot, we can see different rectangles group by the outlet_location column. These rectangle sizes vary according to the column Item_visibility:

树状图数据可视化对于使用嵌套矩形显示层次结构数据非常有用。 选择图表类型作为树形图。 在以下屏幕截图中,我们可以通过outlet_location列看到不同的矩形组。 这些矩形大小根据列Item_visibility的不同而有所不同:

在Azure Data Studio中探索SandDance可视化扩展

Let’s group by rectangles as per the Item_type column. You can see different rectangles groups in the screenshot:

让我们按照Item_type列按矩形分组。 您可以在屏幕截图中看到不同的矩形组:

在Azure Data Studio中探索SandDance可视化扩展

In the tooltip, you can see group 1 belongs to Fruits and vegetables:

在工具提示中,您可以看到第1组属于水果和蔬菜:

在Azure Data Studio中探索SandDance可视化扩展

Group2 belongs to Snacks food:

组2属于零食食品:

在Azure Data Studio中探索SandDance可视化扩展

Azure Data Studio的条形图 (Bar type chart for Azure Data Studio)

The following screenshot refers to a bar-type chart with configured column mapping and color-coding:

以下屏幕快照是指具有配置的列映射和颜色编码的条形图:

在Azure Data Studio中探索SandDance可视化扩展

Azure Data Studio的网格类型图表 (Grid type chart for Azure Data Studio)

The following screenshot refers to a grid type chart with configured column mapping and color-coding:

以下屏幕快照引用了具有配置的列映射和颜色编码的网格类型图表:

在Azure Data Studio中探索SandDance可视化扩展

Each grid refers to an item as per the column mapping. You can get the details using the tooltip on a particular grid:

每个网格根据列映射引用一个项目。 您可以使用特定网格上的工具提示来获取详细信息:

在Azure Data Studio中探索SandDance可视化扩展

探索SandDance菜单栏 (Exploring SandDance menu bar)

We explored various types of Sanddance charts. In this option, we explore a few options available in the configuration menu bar, as shown below:

我们探索了各种类型的Sanddance图表。 在此选项中,我们探索配置菜单栏中的一些可用选项,如下所示:

在Azure Data Studio中探索SandDance可视化扩展
  1. Chart: We explored various charts type available under this option in previous sections

    图表:我们在前面的部分中探讨了此选项下可用的各种图表类型
  2. Chart color: We can choose a color scheme from a variety of available color schemes for all SandDance charts. By default, it uses a color scheme: category 20, as shown below:

    在Azure Data Studio中探索SandDance可视化扩展

    In the following example, we can see color scheme ascent for SandDance charts:

    We also have an option – Color reverse. If you turn it on, it reverses the colors in the charts as shown below:

    在Azure Data Studio中探索SandDance可视化扩展

    图表颜色:我们可以从所有SandDance图表的各种可用颜色方案中选择一种颜色方案。 默认情况下,它使用一种配色方案:类别20,如下所示:

    在以下示例中,我们可以看到SandDance图表的配色方案上升:

    在Azure Data Studio中探索SandDance可视化扩展

    我们还有一个选项–反转色。 如果将其打开,它将反转图表中的颜色,如下所示:

  3. Data browser: In the data browser, we can check the data row by row. You can also notice a hyperlink for searching the item in the Bing search console:

    在Azure Data Studio中探索SandDance可视化扩展

    Click on Bing, and it gives the following pop up message:

    Click on Open Link, and it opens a web browser and searches the item:

    在Azure Data Studio中探索SandDance可视化扩展

    数据浏览器:在数据浏览器中,我们可以逐行检查数据。 您还可以注意到在Bing搜索控制台中用于搜索项目的超链接:

    单击Bing ,它会显示以下弹出消息:

    在Azure Data Studio中探索SandDance可视化扩展

    单击“ 打开链接” ,它将打开一个网络浏览器并搜索以下项目:

  4. Select by Search: We can use Select by Search feature in SandDance for Azure Data Studio for filter data set by specifying various conditions. We can also use expressions in the search. For example, in the below screenshot, it searches for item type baking goods. It highlights the required portion in the chart:

    在Azure Data Studio中探索SandDance可视化扩展

    按搜索选择:通过指定各种条件,我们可以将SandDance for Azure Data Studio中的按搜索选择功能用于筛选器数据集。 我们还可以在搜索中使用表达式。 例如,在下面的屏幕截图中,它搜索项目类型的烘焙食品。 它突出显示了图表中的必需部分:

  5. SnapShots: It also allows you to create chart snapshot so that we can view it later. Click on Create Snapshot:

    在Azure Data Studio中探索SandDance可视化扩展

    Provide a snapshot description and again click on Create Snapshot:

    It shows the snapshots with a thumbnail. You also get an option for deleting it:

    在Azure Data Studio中探索SandDance可视化扩展

    SnapShots:它还允许您创建图表快照,以便我们以后查看。 单击创建快照

    提供快照描述,然后再次单击Create Snapshot

    在Azure Data Studio中探索SandDance可视化扩展

    它以缩略图显示快照。 您还可以选择删除它:

  6. Mark Options: We can use mark options for customizing SandDance in Azure Data Studio. The available configurations are as follows:

    • Mark Opacity
    • Text options such as increasing, decreasing font size
    • Adjusting text angles
    • Show axes or legend
    • Z scale proportion to Y

    标记选项:我们可以使用标记选项在Azure Data Studio中自定义SandDance。 可用的配置如下:

    • 标记不透明度
    • 文本选项,例如增加,减小字体大小
    • 调整文字角度
    • 显示轴或图例
    • Z比例与Y的比例

在Azure Data Studio中探索SandDance可视化扩展

在SandDance for Azure Data Studio中筛选数据 (Filter data in SandDance for Azure Data Studio)

You might have noticed a section in the SandDance that shows the following fields:

您可能已经注意到SandDance中显示以下字段的部分:

  • All Rows

    所有行
  • Filtered

    已过滤
  • Selected

    已选

在Azure Data Studio中探索SandDance可视化扩展

By default, it shows all data in the chart and does not use any filter. You can see the value of All rows (8.5k) that depicts our data row. We are not using any filters; therefore, it shows the zero for the filtered.

默认情况下,它显示图表中的所有数据,并且不使用任何过滤器。 您可以看到描述我们的数据行的所有行(8.5k)的值。 我们没有使用任何过滤器; 因此,它显示了过滤后的零。

Let’s specify a filter to search only item type equals to hard drinks. You can see now that the chart highlights the section satisfying the condition. You can also see a value 210 for the selected column:

让我们指定一个过滤器,以仅搜索等于烈性酒的商品类型。 现在您可以看到图表突出显示了满足条件的部分。 您还可以看到所选列的值210:

在Azure Data Studio中探索SandDance可视化扩展

In the above screenshot, it also enables the option – Isolate and Exclude.

在上面的屏幕截图中,它还启用了选项-隔离和排除。

Click on Isolate and notice the change in the chart. It isolates the filtered data and shows the chart only for the filtered data. In the filtered column, you can see value 210:

单击隔离,并注意图表中的更改。 它隔离过滤的数据并仅显示过滤数据的图表。 在过滤的列中,您可以看到值210:

在Azure Data Studio中探索SandDance可视化扩展

Click on Stop filtering to revert to the original chart. Now, filter the chart again and click on Exclude. It excludes filtered data from the chart and shows a chart for the remaining data. In the filtered column, you can see value 8.3k after excluding data:

单击停止过滤以还原为原始图表。 现在,再次过滤图表,然后单击排除。 它从图表中排除过滤后的数据,并显示剩余数据的图表。 在过滤的列中,排除数据后,您可以看到值8.3k:

在Azure Data Studio中探索SandDance可视化扩展

在Azure Data Studio中查看3D沙图 (View 3D SandChart in Azure Data Studio)

By default, you can see 2D SandChart. It provides you to view the 3D chart as well. Click on the highlighted 3D chart option:

默认情况下,您可以看到2D SandChart。 它也使您可以查看3D图表。 单击突出显示的3D图表选项:

在Azure Data Studio中探索SandDance可视化扩展

It changes the SandDance from 2D to 3D format, as shown below. It enhances data visualizations for SandDance charts:

它将SandDance从2D格式更改为3D格式,如下所示。 它增强了SandDance图表的数据可视化效果:

在Azure Data Studio中探索SandDance可视化扩展

In the 3D format, you can click on the same spot to convert chart back to 2D visualization:

在3D格式中,您可以单击同一位置将图表转换回2D可视化:

结论 (Conclusion)

In this article, we explored SandDance charts in Azure Data Studio. This extension enables you to visualize data quickly and easily with various chart options. You should explore these charts for representing your data in an efficient way.

在本文中,我们探讨了Azure Data Studio中的SandDance图表。 通过此扩展,您可以使用各种图表选项快速轻松地可视化数据。 您应该探索这些图表以有效地表示数据。

翻译自: https://www.sqlshack.com/exploring-the-sanddance-visualizations-extension-in-azure-data-studio/