powerbi绘制地图

In the article How to plot a SQL Server 2017 graph database using SQL Server R, I highlighted the lack of built-in graph data visualisation as one major limitation of the SQL Server 2017 graph database feature. In the same article, I went on to suggest making use of SQL Server R as one workaround that could be utilised in order to successfully plot and visualise diagrams out of SQL Server 2017 graph database objects. However, whilst 3rd party graph database vendors such as Neo4j provide an interactive and hyperlinked graph diagrams that allows you to – amongst other things – easily drilldown and identify node-relationships as indicated in Figure 1, the graph plotted using SQL Server R is not very interactive in fact it is simply a static image file as shown in Figure 2.

如何使用SQL Server R绘制SQL Server 2017图形数据库一文中 ,我强调了缺少内置图形数据可视化是SQL Server 2017图形数据库功能的主要局限性。 在同一篇文章中,我继续建议使用SQL Server R作为一种变通办法,以便成功地绘制和可视化SQL Server 2017图形数据库对象中的图表。 然而,尽管第三方图形数据库厂商如Neo4j的提供,让您的互动性和超链接的图形图表-除其他事项外-轻松地钻到并确定节点的关系如图1所示,使用SQL Server R不是图形绘制实际上,它非常具有交互性,它只是一个静态图像文件, 如图2所示。

Although the perceived lack of animation in graphs plotted using SQL Server R might not be a deal breaker for data scientists and R developers alike, you may find it hard to convince business end-users to abandon an interactive data visualisation for a static image file. Fortunately, the Microsoft Power BI tool is designed to provide interactive data visualisations for business end-users and it just so happens that it also supports visualisations based off SQL Server 2017 graph database. Therefore, in this article, we take a look at the integration of Power BI and SQL Server 2017 graph database.

尽管使用SQL Server R绘制的图形中缺乏动画的感觉可能对数据科学家和R开发人员来说都不是一件容易的事,但您可能很难说服业务最终用户放弃对静态图像文件的交互式数据可视化。 幸运的是,Microsoft Power BI工具旨在为业务最终用户提供交互式数据可视化,而且恰好它还支持基于SQL Server 2017图形数据库的可视化。 因此,在本文中,我们将研究Power BI和SQL Server 2017图形数据库的集成。

获取数据:SQL Server 2017图形数据库 (Get Data: SQL Server 2017 Graph Database)

Continuing to use our sample SocialGraph graph database created in this article, we begin by importing our sample nodes and edges tables into Power BI Desktop client. The first thing that you will notice is that as you attempt to load these tables, you will run into an error message similar to the one shown in Figure 3.

继续使用本文创建的示例SocialGraph图形数据库,我们首先将示例节点和边表导入Power BI Desktop客户端。 您会注意到的第一件事是,当您尝试加载这些表时,您将遇到类似于图3所示的错误消息。

At first glance, one might assume that there is a software bug in the Power BI Desktop tool which causes internal graph columns to be inaccessible. However, regardless of the client tool you may be using, internal graph columns in SQL Server 2017 are not meant to be accessible by applications external to the SQL Server engine. For instance, Figure 4 shows the properties of node table dbo.Club.

乍一看,可能会认为Power BI Desktop工具中存在一个软件错误,该错误导致内部图形列无法访问。 但是,无论您可能使用的是哪种客户端工具,SQL Server 2017中的内部图形列都不意味着可由SQL Server引擎外部的应用程序访问。 例如, 图4显示了节点表dbo.Club的属性。

Using SQL Server Management Studio (SSMS) as my T-SQL client, I attempted to read the value of the graph_id_* column by executing the code shown in Script 1.

我使用SQL Server Management Studio(SSMS)作为T-SQL客户端,试图通过执行脚本1中显示的代码来读取graph_id_ *列的值。

SELECT
graph_id_94FADC773CB2462DB180F6BCD8456123
FROM [SocialGraph].[dbo].[Club];

However, the execution of Script 1 led to the error message shown below – which is actually similar to the error message returned in Figure 3 by Power BI Desktop.

但是, 脚本1的执行导致了如下所示的错误消息–实际上类似于Power BI Desktop在图3中返回的错误消息。

Msg 13908, Level 16, State 1, Line 9
Cannot access internal graph column ‘graph_id_94FADC773CB2462DB180F6BCD8456123’.

消息13908,第16层,状态1,第9行
无法访问内部图形列'graph_id_94FADC773CB2462DB180F6BCD8456123'。

So how do we get around an error like this one?

那么,如何解决这种错误呢?

Well, it looks like the following steps do the trick:

好吧,看起来以下步骤可以解决问题:

  1. Write a SELECT statement against graph database table specifying a list of column names that you are looking for (excluding internal graph columns) 针对图数据库表编写SELECT语句,以指定要查找的列名列表(内部图列除外)
  2. Wrap the above SELECT statement in a SQL Server view object 将上面的SELECT语句包装在SQL Server视图对象中
  3. Point Power BI to the newly created SQL Server view object 将Power BI指向新创建SQL Server视图对象

Figure 5 shows a SQL Server view (i.e. getgraph) created using the aforementioned steps being successfully imported into Power BI Desktop.

图5显示了使用上述步骤创建SQL Server视图(即getgraph ),该视图已成功导入Power BI Desktop。

Now that we have found a mechanism to extract a graph database table into Power BI without any errors, we next modify the definition of our sample getgraph view to include joins to dbo.Player, dbo.Club and dbo.playedFor graph database tables as shown in Script 2.

现在,我们已经找到了一种将图形数据库表提取到Power BI中而没有任何错误的机制,接下来我们修改示例getgraph视图的定义,以包括对dbo.Playerdbo.Clubdbo.playedFor图形数据库表的联接,如图所示。在脚本2中

ALTER VIEW getgraph
ASSELECT a.name,'playedFor' playedFor,b.name AS ClubFROM player a,playedFor,Club bWHERE MATCH(a-(playedFor)->b);

导入自定义Power BI Visual (Import Custom Power BI Visual)

Whilst writing this article, I was using the December 2017 release of Microsoft Power BI Desktop and the release did not readily provide visualisations that supported effective plotting of graph databases. Thus, I had to download and import a Power BI custom visual to successfully plot an interactive graph database. One such custom visual, is the Force-Directed Graph which is an open source custom visual developed by Microsoft and designed for visualising connections between two or more entities. Although my demo is based off the desktop version of Power BI, the Force-Directed Graph visual also works with the web version of Power BI.

在撰写本文时,我正在使用Microsoft Power BI Desktop的2017年12月版,该版本无法轻松提供支持图形数据库有效绘图的可视化效果。 因此,我必须下载并导入Power BI自定义视觉对象才能成功绘制交互式图形数据库。 一种这样的自定义视觉是Force-Directed Graph ,它是Microsoft开发的一种开源自定义视觉,用于可视化两个或多个实体之间的连接。 尽管我的演示基于Power BI的桌面版本,但是Force-Directed Graph视觉效果也可以与Power BI的Web版本一起使用。

Regardless of the version of Power BI you may be using, the installation of the Force-Directed Graph is straightforward; simply click the ellipsis button under the Visualisation pane and choose the import type – in my case, I chose to Import from file. Once the import has been completed, the Force-Directed Graph visual will appear in the list of your visualisations as shown in Figure 6.

不管您使用的Power BI是什么版本, 强制导向图的安装都很简单。 只需单击“可视化”窗格下的省略号按钮,然后选择导入类型-就我而言,我选择了“ 从文件导入” 。 导入完成后, Force-Directed Graph视觉效果将出现在您的视觉效果列表中, 如图6所示。

使用Power BI生成图形数据库 (Generate Graph Database Using Power BI)

Having imported data off a SQL Server 2017 graph database and successfully installed a custom Force-Directed Graph visual, we are only left with the easiest yet interesting part and that is to plot and generate an interactive Power BI graph. Just like in most Power BI visuals, the Force-Directed Graph visual has several properties that can be configured according to user preference. In terms of configuring data fields, the custom visual is likely to auto-detect what dataset fields goes where but just to be certain, Figure 7 indicates the allocation of fields from the getgraph view according to Source, Target and Link Type properties.

从SQL Server 2017图形数据库导入数据并成功安装了自定义的Force-Directed Graph视觉效果后,我们只剩下最简单但有趣的部分,即绘制并生成交互式Power BI图。 就像大多数Power BI可视化一样, Force-directed Graph可视化具有多个属性,可以根据用户偏好进行配置。 在配置数据字段方面,自定义视图可能会自动检测哪些数据集字段将流向何处,但可以肯定的是, 图7根据SourceTargetLink Type属性指示了getgraph视图中字段的分配。

Figure 8 shows that the Force-Directed Graph visual further providers a Format option that can be used to configure properties such as the background appearance of the graph to be plotted, specify data labels and turn on/off graph animations. You can further represent your nodes in the graph using custom images.

图8显示了“ 力向图”视觉效果进一步提供了“格式”选项,该选项可用于配置属性,例如要绘制的图的背景外观,指定数据标签以及打开/关闭图动画。 您可以使用自定义图像进一步在图中表示节点。

Figure 9 shows a basic graph database that we have managed to plot using Power BI. However, the graph can further be improved by spending some time playing around with the “look and feel” properties displayed in Figure 8.

图9显示了我们已经使用Power BI设法绘制的基本图形数据库。 但是,可以通过花一些时间玩图8中显示的“外观”属性来进一步改善图形。

摘要 (Summary)

In addition to using SQL Server R for plotting SQL Server 2017 graph database as discussed in this article, I have used this article to demonstrate a Power BI mechanism for plotting and visualising graph databases. Although, it relies on custom visual, Power BI provides an interactive option for business end-users to utilise in order to visually make sense of their SQL Server 2017 graph database.

除了使用SQL Server R的密谋SQL Server作为讨论2017年图形数据库这篇文章中 ,我用这篇文章来证明用于绘图和可视化图形数据库进行双向电力机制。 尽管Power BI依赖于自定义视觉,但是Power BI提供了一个交互式选项,供业务最终用户使用,以直观地理解其SQL Server 2017图形数据库。

参考资料 (References)

  • MATCH (SQL Graph) 匹配(SQL图)
  • What is Power BI 什么是Power BI
  • Force-Directed Graph 力导向图

翻译自: https://www.sqlshack.com/plot-sql-server-2017-graph-database-using-powerbi/

powerbi绘制地图

powerbi绘制地图_如何使用PowerBI绘制SQL Server 2017图形数据库相关推荐

  1. sql 2017 机器学习_使用R和SQL Server 2017进行机器学习

    sql 2017 机器学习 The primitive Business Intelligence (BI) methodology has its primary focus on data sou ...

  2. apexsql使用方法_使用ApexSQL审核执行SQL Server审核

    apexsql使用方法 This is the last article, but not least, in the SQL Server Audit series. In this series ...

  3. mysql2005备份_创建完整数据库备份 - SQL Server | Microsoft Docs

    完整数据库备份Create a Full Database Backup 09/12/2019 本文内容 适用于:Applies to: SQL ServerSQL Server(所有支持的版本)SQ ...

  4. sql server 监视_使用动态管理对象监视SQL Server –会话和连接

    sql server 监视 A fundamental task of Database Administrators is monitoring SQL Server performance. Wh ...

  5. python绘制等值线图_利用Python插值绘制等值线图

    最近需要根据有限的站位点绘制插值等值线图,在网上中文搜索一通,只发现了这货Matplot Basemap 画湖北地图.插值.等值线,要么就是对这货的转载,这货不提供数据的形式,但是基本的代码思路还是不 ...

  6. 绘制半圆_超细致:Ai绘制萌蠢可爱卡通形象

    来源:Envato艺云台 原文作者:Amanda Tepie    翻译:Yimin Zhou 完成效果 在这篇教程中,我将展示如何在Adobe Illustrator中使用基本图形工具.路径查找器. ...

  7. python蟒蛇绘制步骤_如何用python绘制蟒蛇移动的样子-百度经验

    保存好之后,我们就可以开始编辑了,蟒蛇代码如下图. 其中第一段import turtle是导入python的turtle函数.(import turtle) 第二段是定义一个drawSnake函数,d ...

  8. python绘制多边形_在python-matplotlib中绘制3D多边形

    我无法通过网络浏览以下简单问题的解决方案: 如何使用顶点值绘制3D多边形(例如,填充的矩形或三角形)?我尝试了很多想法,但都失败了,请参阅: from mpl_toolkits.mplot3d imp ...

  9. java绘制铁路线_铁路站场简图绘制软件源码

    [实例简介]绘制站场简图 [实例截图] [核心代码]  private void pictureBox2_Click(object sender, EventArgs e) { if (this.ge ...

最新文章

  1. jQuery的选择器中的通配符使用介绍
  2. xshell查询日志命令_Polysh命令实现多日志查询的方法示例
  3. MPB:窖泥样品采集与核酸提取
  4. propertychange 属性说明
  5. python 获取行列号两个数组相等_python – 寻找在numpy中找到两个相等长度数组之间精确重叠的最快方法...
  6. Android NDK开发之 arm_neon.h文件ABI说明
  7. java interruptedexception_如何正确的处理InterruptedException
  8. javascript 时间格式输出FormatDate函数
  9. 在 Web 浏览器中运行(PowerApps)应用
  10. es6学习推荐网址(阮一峰)
  11. 网易云ios android 自定义消息,网易云信快速集成定制以及消息类型自定义
  12. 电脑快捷键大全 Ctrl
  13. Java - mian()
  14. java获得文件的md5码_java获取文件md5码
  15. 使用WLW 写博客的测试
  16. 易语言制作提示类对话框
  17. linux服务脚本书写,编写一个服务脚本的示例
  18. powerbi使用说明_PowerBI动态报告嵌入到PPT中,这个方法推荐给你
  19. 80后大学生在沪创业出奇招:扮小丑送快递
  20. 工控软件/PLC的信息远传的简单解决方案

热门文章

  1. 洛谷P2144 bzoj1002 [FJOI2007]轮状病毒 (高精度板子)
  2. 玩一下易语言 和字有多种读音,注定了它的重要性!!
  3. c#利用zlib.net对文件进行deflate流压缩(和java程序压缩生成一样)
  4. JS:ES6-3 解构赋值与模板字符串
  5. JavaScript数据结构——栈(Stack)
  6. 计算机网络学习笔记(9. 报文交换与分组交换③)
  7. Vue报错:‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。
  8. 【博客项目】—项目坏境搭建(一)
  9. 前端—每天5道面试题(十二)
  10. 2引擎帮助文档_ANSA快速入门指南中文帮助文档浅析(上)