• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • Visio Shape Report Converter
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Using Visio in Education for GIS
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Visualize Complex Processes with Microsoft Visio
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network
You are here: Home / Visio / Using Visio and PowerBI with GraphDatabase in SQLServer

Published on February 9, 2018 by David Parker

Using Visio and PowerBI with GraphDatabase in SQLServer

I went to a very interesting inaugural meeting of the South East UK Power BI Group last week. Whilst the presentation by Dr. Subramani Paramasivam was impressive for its ambition, it was the presentation by Andrew Fryer of Microsoft that particularly intrigued me. He introduced us to the world of Graph Databases, such as Neo4J and CosmosDB, but also demonstrated SQL Server 2017’s new Graph table types, called Node and Edge.  He used the latter because solution because he could use example in Power BI using the Force-Directed visual. Well, this SQL Server feature was new to me, and so I was inspired to see if I could use my favourite tool, Visio, to input data into a graph database, and to selectively display parts.

  • Graph Schema
  • Node Master
  • Edge Master


This is something that I have often grappled with because, great as Visio is for diagramming, it is not the answer in all situations. It is brilliant at connecting shapes together, and adding data to each shape, including the connector, but it would not be fantastic at displaying all the millions of data points and relationships in any graph database worth its salt. However, what if another application, such as PowerBI, could be used to analyse and filter the information down to a more manageable scale, and then export the filtered data set to Visio where it can display the relationships, and be enhanced for inclusion in reports? Although I really like PowerBI, I do not think it generally provides an output that is report quality.  Especially when reviewing the links between many nodes.
It is possible to insert data into SQL Server graph tables from csv files, but this is not always the most intuitive manner. Indeed, Andrew Fryer, whom I know to be a brilliant artist, resorts to sketching relationships freehand, and then creates tables or scripts from the diagram manually. So, what if you can use Visio to drag and drop nodes, and connect relationships between them, adding names and properties on the fly, as you go? Then, what if you could review your diagram, and then upload all of the nodes and edges to the database automatically? This process could be repeated on many pages, so that the data gets merged together in the graph database. The Visio pages can also be saved and remain available as a record of input, should any questions arise.
These new graph tables contain special column types that cannot be used directly by either PowerBI or Visio, so it is necessary to create views of the tables, thus effectively hiding them. I have a slight issue with the graphdemo database in the Microsoft article because it has extra columns on some Node and Edge tables. To me, this seems a little impure, and I think that the Node tables should only have an ID, Name and Properties column in addition to the Node columns, and the Edge tables should only have a Properties column in addition to the Edge columns. Ideally, the Properties columns in both tables should hold JSON data as text.
Anyway, I decided to create a proof of concept with just the basic Node and Edge attributes first. I also extended the sample database a little so I could have a bit more complexity. I decided to forget about using nice icons for now, and just keep it simple!

The Master Shapes

There are just two enhanced Visio shapes required, a Node master and an Edge master. The latter is the only connector that should be used, so I renamed it as Dynamic connector. This is a trick used in several of the Microsoft supplied templates too, because this is a reserved name, and is the default used by all of the automatic connection commands in Visio.
The Node master shape is a simple ellipse that can be resized, if necessary, and in the future that sizing could be controlled from data. It has a variable list Node property, text Name and Properties shape data rows that can be automatically prompted for on drop. The ID shape data row will be automatically updated if the shape is linked to the database. The page has a Prompt Input shape data row, which changes the experience when dropping shapes on to the page, and hides the shape data rows that can be linked to the database. There is also a Lock Resize shape data row in the page that can be toggled on to prevent unintentional re-sizing.
The Dynamic connector/Edge master shape is a curved connector, which can be straightened if desired, and only the Edge variable list shape data row to be completed on drop, as the rest will updated automatically if the shape is linked to the database. These may be hidden later, but for now, I left them visible. This shape also responds to the page Prompt Input shape data value, but also responds to the Connector Error Display Mode. This controls the display of Action Tags if the shape is not connected at either end. See my earlier article about this at Adding More Smartness to Visio Connectors.
In addition to these two master shapes, I also created a DataGraphic Node that colours by the Node text, and displays the Name. Similarly, I created a DataGraphic Edge that colours by the Edge text. Both of these data graphics can be modified easily to include the Properties shape data values in the future.

Capturing Nodes and Edges

So, the user can simply drag and drop a couple of Node shapes, completing the Node and Name shape data values for each, and then connect the two together with the Dynamic connector/Edge shape, and complete the Edge shape data value. Easy! This can be repeated for a page, and then some custom code, currently a snippet in the ubiquitous and excellent LinqPad, adds the Nodes and Edges to the database.

CreatingNodesAndEdges
Creating Nodes & Edges in Visio

Nodes can be easily duplicated in Visio, and the Name shape data row edited.

DuplicatingNodes
Duplicating Node shapes in Visio

Then the Node shapes can be connected to others using the Dynamic connector/Edge shape, and the relevant relationship type entered.

ConnectingNodes
Connecting Nodes in Visio

Once the Nodes have been connected, then the graph database can be updated with a little code, providing a visual feedback by applying the Data Graphics to the shapes.

UpdatingDatabase
Updating the graph database from Visio

Subsequently, the data can be analysed and filtered in PowerBI, from where the resultant list can be exported to Excel. This Excel table can then be used generate a new page in Visio. … but that will be in the next episode!

ViewingInPowerBI
Analysing & filtering graph in PowerBI

Using #Visio and #PowerBI with #GraphDatabase in #SQLServer – Part 2


Related

Filed Under: Graph Database, PowerBI, SQL Server, Visio, Visio 2016, Visio Online Tagged With: GraphDatabase

About David Parker

David Parker has 25 years' experience of providing data visualization solutions to companies around the globe. He is a Microsoft MVP and Visio expert.

Reader Interactions

Comments

  1. Aaron Nighelli says

    July 18, 2022 at 5:20 pm

    do you have the source code you can share?

    Log in to Reply
    • David Parker says

      July 28, 2022 at 12:21 pm

      Not yet ….

      Log in to Reply

Trackbacks

  1. Using #Visio and #PowerBI with #GraphDatabase in #SQLServer – Part 2 | bVisual - for people interested in Microsoft Visio says:
    February 12, 2018 at 12:15 pm

    […] I described how Visio can be used to input Nodes & Edges into a SQL Server graph tables (see Using #Visio and #PowerBI with #GraphDatabase in #SQLServer). In this article, I show how PowerBI can be used to create an Excel table that can then be used to […]

    Log in to Reply
  2. [Reference] Power BI blog posts – the (almost) complete list 2018 – Bonjour Joël says:
    February 12, 2018 at 9:58 pm

    […] Using Visio and Power BI with GraphDatabase in SQL Server […]

    Log in to Reply
  3. Using #JSON text in #Visio shapes | bVisual - for people interested in Microsoft Visio says:
    February 13, 2018 at 9:29 pm

    […] Using #Visio and #PowerBI with #GraphDatabase in #SQLServer […]

    Log in to Reply
  4. Creating #Visio #Validation Rules for #GraphDatabase template | bVisual - for people interested in Microsoft Visio says:
    February 14, 2018 at 9:36 pm

    […] Using #Visio and #PowerBI with #GraphDatabase in #SQLServer […]

    Log in to Reply
  5. Using #Visio with SQL Server #Graph Databases – April Update | bVisual - for people interested in Microsoft Visio says:
    April 10, 2018 at 7:58 pm

    […] Using #Visio and #PowerBI with #GraphDatabase in #SQLServer […]

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • Co-authoring and Commenting with Visio Documents
  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio

Categories

Tags

Accessibility Add-Ins Connectors Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript LayerManager Layers Legend Link Data to Shapes Lists MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Setup and Deployment Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Validation VBA Video Visio Visio 2007 Visio for the Web Visio Online Visio Services Visio Viewer Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • Amazon
  • E-mail
  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

Search this website

Recent posts

  • Co-authoring and Commenting with Visio Documents
  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio

Copyright © 2025 · Executive Pro on Genesis Framework · WordPress · Log in