This is a simple Ruby on Rails application to show examples of visualizations that are created with data from VIVO.
As this is an out-of-the-box Ruby on Rails application, there is a database associated with this application, but it is not used. It must be created however. If the database does not exist, the application will show a page describing the steps needed to create the database.
We use PostgreSQL as a database but you can use any. Simply update the config/database.yml file as described in the Rails Guides.
Most of these visualizations come from LatticeGrid.
An example of a Chord Diagram showing the relationship of investigator collaborations through the vivo:Authorship records. Based on Mike Bostock's Chord Diagram.
An example of a Word Cloud showing the frequency of words used in bibo:Documents associated with an Author. Based on Jason Davies' Word Cloud.
Using the different classes of Publications, here we show the percentage of publication types by author. Based on Highcharts Pie Demo.
Simple Bar Chart created using Highcharts showing the number of publications for each year.
Similar to the Chord Diagram, but showing author relationships using the Cytoscape Web library.
The data used by these graphs is pulled from VIVO through the SPARQL API.
Look into the *.rake files for the SPARQL queries used, the data received, and how the data is massaged into formats used by the data diagrams.
There are four (4) rake tasks to be run to get the chord diagram data
- rake investigator_chord:uris
- rake investigator_chord:coauthors
- rake investigator_chord:publication_counts
- rake investigator_chord:chord_data
These tasks and descriptions of what they do are in the lib/tasks/investigator_chord.rake file.
There are three (3) rake tasks to be run to get the chord diagram data
- rake wordle:uris
- rake wordle:get_words
- rake wordle:data
These tasks and descriptions of what they do are in the lib/tasks/wordle.rake file.
There are two (2) rake tasks to be run to get the pie chart data
- rake pie:uris
- rake pie:publication_type_counts
These tasks and descriptions of what they do are in the lib/tasks/pie.rake file.
There is one (1) rake task to be run to create the publication by year data
- rake publications_by_year:count
These tasks and descriptions of what they do are in the lib/tasks/publications_by_year.rake file.
There are four (4) rake tasks to be run to create the cytoscape radial graph data
- rake cytoscape:uris
- rake cytoscape:coauthors
- rake cytoscape:coauthor_counts
- rake cytoscape:network_data
These tasks and descriptions of what they do are in the lib/tasks/cytoscape.rake file.
There are three (3) types of files touched in order to render a page.
All routes are defined in the config/routes.rb file.
There are generally two routes per data diagram - one to the page that renders the diagram and one to the data used to create the diagram.
For organizational purposes, I have created a Controller class for each distinct visualization library used. For example, all diagrams using the d3js.org libraries are in the D3Controller.
Here is perhaps the most interesting part of this project where we actually use the visualization libraries to render the page.