Skip to main content

Map Visualization using Graphite in Silverlight

Have you ever seen how boardrooom connections page of WotNews, Australia (http://wotnews.com.au/boardroom_connections/) works? Few days back, I was working on a similar requirement where we had Silverlight 3/4 to implement the same feature. While searching for Silverlight feature to implement this, we discovered Graphite (a product from Orbifold) which could give similar features as required.

If you are new to Graphite then for you, Graphite is a diagramming control with a (auto-layout) spring-embedder algorithm for Silverlight. The control is designed to display a small set of data without having to define a particular layout or without much customization. The Silverlight version of it can be used for website navigation, inside SharePoint, to visualize CRM/Dynamics relationships etc.

Conceptually, Graphite control works managing components at 2 levels - one at Visual level and another at Non-Visual level. Visual level ensures creation and maintenance of visual parts (node, connector etc.) and Non-visual level ensures information attached to each node is maintained in the background. Graphite control represents the visual part in the form of GraphCanvas and the non-visual part in the form of Graph classes.

Adding a new Node could be represented as -

Courtesy : http://visualizationtools.net/

To use it in the application, we need/may implement the following steps.
1) Add Graphite control to the XAML code (download Graphite control from http://visualizationtools.net/)
2) On the click of parent Node, get the data from database using a RIA service (can use other methods of communication like WCF Services, ASP.NET Web Services, Sockets calls, REST calls to fetch data from the database)
3) Create child nodes using the data fetched from the database and set the Info property of the Node if you want to display anything on MouseOver or Click of the node as a tooltip or in a separate panel.

Now, I will take you through a sample code implementing Graphite control for visualization.

1) In XAML code, put the following code to include Graphite control in the page


2) Then we need to put the code to load data from the database using a WCF service and populate data by adding nodes to the Graphite control. Use AddNode and AddEdge methods of Graphite control to add nodes and links between nodes respectively.

In this code, I have tried to call a WCF service (be default asynchronous) and populate data on the completion of service call. Here I will not talk about how to build a WCF service because I assume you all know how to build a WCF service to fetch data from a database and send it back to client for further usage in the client side.

Once you complete the code then run the project to see the output. You will see a fantastic mapper and click on each node to see how it expands the child nodes and rebuilds the layout. You can explore functionalities like changing color and style of nodes and connectors by defining and changing the styles in the XAMP page.

I am thankful to Francois of Orbifold for providing required inputs to work with Graphite control.

Please post if you have any questions while implementing it.

Comments

Popular posts from this blog

Office 2013 Installation Error : Code 1603

Wanted to share one error that I got while installing Microsoft Office Professional 2013 for which I had to spend almost 3 days to find the root cause. I also googled and found that many people have also faced the same issue but did not get if anyone had the solution. Sharing the solution that worked for me. Thanks to Dhaval Metrani, my colleague, who also helped me with this. If you get the following error in the log file (in the %temp% folder) while installing Office 2013 Failed to install product OSMMUI.msi ErrorCode: 1603  and the detail log shows ERROR: The network address is invalid then the same is because of Task Scheduler service is not enabled on the machine. 1603 is a generic error and some people have mentioned that the same could be related to deleting/renaming  %programdata% /Microsoft Help but the solution seemed to be related to Task Scheduler when the exact error was related to 'Network address invalid'. By default in Windows 7 and Windows Vista ...

Navigating the Data Landscape: Unraveling Data Mesh and Data Fabric

In today’s rapidly evolving tech landscape, data strategy is the cornerstone of business strategy. As organizations gather an ever-increasing amount of data, the need for efficient data management strategies becomes paramount.  Two prominent approaches that have gained traction in recent times are Data Mesh and Data Fabric . Both concepts aim to address the same very goal of Data Democratization while ensuring scalability, accessibility, and usability. In this blog, we’ll delve into the nuances of Data Mesh and Data Fabric, and provide recommendations for organizations seeking to fortify their data landscape. Data Mesh vs Data Fabric: Unpacking the Concepts Data Mesh is a domain-driven architectural approach to data management. It proposes treating data as a product and recommends a decentralized approach to data ownership with domain experts. Earlier, the Enterprise Data Lake approach focused on centralized data management and ownership whereas the Data Mesh architecture fo...

The fast-paced lifestyle of developers...

When we talk about software world, what’s the first thing that comes to your mind? Programming - right? Developers play a very important role in turning technology ideas into reality. It’s ultimately the code that runs on the computer providing an interface to the end users or systems. Empowerment of developers has evolved over the last few decades from assembly level programming to more sophisticated software programming. It continues to evolve and provide enormous opportunities to transform the life of a developer which in turn transforms the business that relies on technology.   When I started my professional career in late 90s, the technology world was limited but fascinating. Computer technology was something that every technologist wanted to be associated with. We had only a few options to choose from and I was fortunate to work on programming languages such as Java, Visual C++, etc. My first programming language Fortran (as part of my undergraduate course) was really di...