SlideShare uma empresa Scribd logo
1 de 35
EPSRC – Data Visualisation
         Proof of Concept




       Alex Hardman
Topics
• Node Graph (bouncing balls)
  – (Quick) Demo
  – Libraries
  – Frontend / AJAX
• Details Graphs (bar charts etc)
  – (Quick) Demo
  – Libraries
  – Frontend / AJAX
Quick Demo
Libraries
• Node Graph  arborjs.org

• Graphs  rgraph.net



           HTML5 + Canvas
Node Graph
• Uses Canvas (via the HTML5 getContext()
  object.
• The getContext("2d") object has methods to
  draw lines, boxes, circles, and more.
• Uses the Arbor js framework to store nodes
  and edges and handle updating their
  coordinates as the simulation progresses.
Node Graph - Creation
                    arbor.ParticleSystem()

• Parameters
   –   Repulsion (the force repelling nodes from each other)
   –   Stiffness (600 the rigidity of the edges)
   –   Friction (the amount of damping in the system)
   –   Gravity (an additional force attracting nodes to the origin)
   –   Fps (frames per second)
   –   Dt (timestep to use for stepping the simulation)
   –   Precision (accuracy vs. speed in force calculations
        (zero is fast but jittery, one is smooth but cpu-intensive)

                (stored in web.config passed to the view)
Feeding the graph
• Three calls to the server for graph data

             loadInitialData

              loadChildNodes

                    search
Feed the graph… “NodeGraphDTO”
• JSON from the server  “NodeGraphDTO”
Feed the graph… “NodeGraphDTO”
• Lists of :

        Entities   Relationships
Feed the graph… API
foreach(grant in Grants){
  If (showGrants()) {
     ParticleSystem.addNode(
          Id,
          {data we define such as
          size, colour, label text
          etc })
  }
}
… Do for each type in NodeGraphDTO
Feed the graph… API
if(showPeople() && showGrants(){
    foreach (rel in grantPersons) {
      get the grant
      get the person
      ParticleSystem.addEdge(
           grantId
           personId
    }
}
Node Graph – API Callbacks
• redraw()  Gets called repeatedly for each
  frame
• We handle callbacks for:
  – particleSystem.eachEdge(edge, pt1 pt2)
     • Draw a gradient line between pt1 and pt2
  – particleSystem.eachNode(node, pt)
     • Work out what type of node we have
     • Draw it out accordingly (Shape? ,Text? Size? Colour?)
Node Graph – API Callbacks
• initMouseHandling
  – Moved  used to determine whether to display
    hover text
  – Clicked
  – Dragged
  – Dropped  determine whether to load child
    nodes and quick details
JS – (as DRY as possible?)
$(document).ready(function () {
        //Instantiate control objects
        _restoreManager = new RestoreManager();
        _state = new SystemState();
        _aData = new DataHandler();
        _controlsManager = new ControlsManager();
        _nodeController = new NodeController();

       //Initialise controls
       _controlsManager.initialiseControls();

       //Load initial data
       _aData.loadInitialData();
});
General Usage
//Define object function ‘ControlsManager’
function ControlsManager() {
     var self = this;
     //Fix context of ‘this’ to the object
     function

     self.aPublicFunction = function(param) {
          //I’m public
     }
     function aPrivateFunction (){
          I’m private//
     }
}
ControlsManager
//Define controls once as private
var showGrantsChk =
    $("input:checkbox[id=ShowGran
    ts]");

var showOutcomesChk =
    $("input:checkbox[id=ShowOutc
    omes]");

etc…
ControlsManager
//access them via public functions

self.initialiseControls =
    function () {
        …on(‘click’,…) etc.
    }

self.clearDetails =
    function() {…}
DataHandler
self.saveNodeGraphData(data) {
    //Stores NodeGraphDTO object
    //from server
}

self.childData = [];
//can contain child DataHandler(s)
//retrieved when clicking on nodes

self.addChildData(childDataHandler)
DataHandler
//Contains ajax functionilty for
//graph data.

loadInitialData()
//called on document ready

loadChildNodes()
//called after clicking on a node
NodeController
function initSystem() {
    var sys =
    arbor.ParticleSystem(..);
}

self.throttle()
self.unthrottle()
NodeController
self.doGraphObjects() {
      buildThemes();
      buildPeople();
      //and all other nodes
      buildPeopleToGrantEdges();
      //and all other edges

      for (var i = 0; i <
      _aData.childData.length; i++) {
                  var childDataHandler =
                  _aData.childData[i];
                  self.doChildObjects
                        (childDataHandler);
        }
}
NodeController - buildPeople
self.buildPeople() {
    if (_state.showPeople()){
        for(each person in
        _aData.People){
            addPersonNode(person)
            sys.addEdge(…)
        }
    }
}
NodeController - addPersonNode
addPersonNode(person){
       if (!nodeExists(person.Id)){
              sys.addNode(
                     person.Id,
                     {
                            color:pColor,
                            display:person.Id,
                            size: nodeSize,
                            type: person.Type,
                            nodeType:labelNodeType,
                            showLabel:true
                     }
              );
       }
}
NodeController -
   buildPeopleToGrantEdges
buildPeopleToGrantEdges () {
       if (_state.showPeople() && _state.showGrants()) {
            for (var i = 0; i <
              _aData.peopleToGrants.length; i++) {
              var pg = _aData.peopleToGrants[i];
              var personNode = sys.getNode(pg.PersonId);
              var grantNode = sys.getNode(pg.GrantId);
              if (personNode !=undefined && grantNode !=
                                               undefined) {
                     sys.addEdge(pg.PersonId, pg.GrantId,
                           { color: edgeColour });
                    }

             }
         }
    };
NodeControler - doChildObjects
self.doChildObjects = function(cData){
     var parent = sys.getNode
          (cData.rootData.Id);
     //If the parent is null it is not
     //a child object so do nothing
     if (parent != undefined) {
          addChildPeopleNodes(parent,
          cData.peopleData);
          //And all the other types
          //(grants…, research areas…)
     }
};
NodeController -
           addCildPeopleNodes
function addChildPeopleNodes(parentNode, peopleDataArr) {
        if (_state.showPeople()) {
            for (var i = 0; i < peopleDataArr.length; i++) {
                var person = peopleDataArr[i];
                //If the node is root it ain’t a child!
                if (!_state.isCurrentRoot(person.Id)) {
                    var exisitng = sys.getNode(person.Id);
                    if (exisitng == undefined) {
                        addPersonNode(person);
                        _aData.addNodeId(person.Id);
                    }
                    sys.addEdge(
                        parentNode.data.display,
                        person.Id, { color: edgeColour });
                }
            }
        }
    }
RestoreManager
//initialises the reset storage
//in local storage

function initResetStorage(){
    localStorage.resetData = "";
}
RestoreManager
self.addRestorePoint = function (data) {
        if (localStorage.resetData != "") {
            var resetArr = JSON.parse
                (localStorage.resetData);
            resetArr.push(data);
            localStorage.resetData =
                JSON.stringify (resetArr);
        }
        else {
            localStorage.resetData =
                JSON.stringify
                      (new Array(data));
        }
    };
RestoreManager
self.getLastRestoreData = function () {
        var resetData =
              JSON.parse (localStorage.resetData);
        if (resetData.length > 0) {
            if (resetData.length == 1) {
                 return resetData[0];
            }
            var l = resetData.length;
            var data = resetData[l - 2];
            resetData.pop();
            localStorage.resetData =
                     JSON.stringify (resetData);
            return data;
        }
        return null;
    };
Drawing out the nodes - Renderer



           arborgraph.js
             Line 1172
RGraph
Details.js - ControlsManager
self.doResearchAreaGraph = function () {
       var canvas = getCanvas();
       var ctx = canvas.getContext('2d');
       ctx.clearRect
              (0, 0, canvas.width, canvas.height);
       if(_state.selectedGraphType() == "Bar Chart"){
              graph = new RGraph.Bar('graphCanvas',
              _dataManager.raData.GraphValues);
              graph.Set('chart.background.barcolor1',
              'white');
              graph.Set('chart.background.barcolor2',
              'white');
            graph.Set('chart.labels',
              _dataManager.raData.Themes);
       }
};

Mais conteúdo relacionado

Mais procurados

Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query OptimizationMongoDB
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query OptimizationMongoDB
 
GreenDao Introduction
GreenDao IntroductionGreenDao Introduction
GreenDao IntroductionBooch Lin
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! aleks-f
 
Di web tech mail (no subject)
Di web tech mail   (no subject)Di web tech mail   (no subject)
Di web tech mail (no subject)shubhamvcs
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMongoDB
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopSages
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineJason Terpko
 
Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)MongoDB
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLMongoDB
 
Optimizing Slow Queries with Indexes and Creativity
Optimizing Slow Queries with Indexes and CreativityOptimizing Slow Queries with Indexes and Creativity
Optimizing Slow Queries with Indexes and CreativityMongoDB
 
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLabApache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Fast querying indexing for performance (4)
Fast querying   indexing for performance (4)Fast querying   indexing for performance (4)
Fast querying indexing for performance (4)MongoDB
 
Easy undo.key
Easy undo.keyEasy undo.key
Easy undo.keyzachwaugh
 

Mais procurados (20)

Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query Optimization
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query Optimization
 
GreenDao Introduction
GreenDao IntroductionGreenDao Introduction
GreenDao Introduction
 
Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! Look Ma, “update DB to HTML5 using C++”, no hands! 
Look Ma, “update DB to HTML5 using C++”, no hands! 
 
Di web tech mail (no subject)
Di web tech mail   (no subject)Di web tech mail   (no subject)
Di web tech mail (no subject)
 
Green dao
Green daoGreen dao
Green dao
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
 
WOTC_Import
WOTC_ImportWOTC_Import
WOTC_Import
 
Slickdemo
SlickdemoSlickdemo
Slickdemo
 
Green dao
Green daoGreen dao
Green dao
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
 
greenDAO
greenDAOgreenDAO
greenDAO
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation Pipeline
 
Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQL
 
Optimizing Slow Queries with Indexes and Creativity
Optimizing Slow Queries with Indexes and CreativityOptimizing Slow Queries with Indexes and Creativity
Optimizing Slow Queries with Indexes and Creativity
 
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLabApache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
 
Fast querying indexing for performance (4)
Fast querying   indexing for performance (4)Fast querying   indexing for performance (4)
Fast querying indexing for performance (4)
 
Easy undo.key
Easy undo.keyEasy undo.key
Easy undo.key
 

Destaque

Handout - Using Technology To Enhance Your Teaching
Handout - Using Technology To Enhance Your TeachingHandout - Using Technology To Enhance Your Teaching
Handout - Using Technology To Enhance Your TeachingAlex Hardman
 
2009-10-07 IBM zExpo 2009, Current & Future Linux on System z
2009-10-07 IBM zExpo 2009, Current & Future Linux on System z2009-10-07 IBM zExpo 2009, Current & Future Linux on System z
2009-10-07 IBM zExpo 2009, Current & Future Linux on System zShawn Wells
 
Dejan Verčič - Nikola Ljubičić
Dejan Verčič - Nikola LjubičićDejan Verčič - Nikola Ljubičić
Dejan Verčič - Nikola LjubičićLom Buchela
 
CURSOS INTENSIVOS DE VERANO 2016
CURSOS INTENSIVOS DE VERANO 2016CURSOS INTENSIVOS DE VERANO 2016
CURSOS INTENSIVOS DE VERANO 2016CENEC MALAGA
 
Aparato circulatorio POR Erika Aracely Carranza P.
Aparato circulatorio POR Erika Aracely Carranza P.Aparato circulatorio POR Erika Aracely Carranza P.
Aparato circulatorio POR Erika Aracely Carranza P.AryCarranza
 
Kan een natuurwetenschapper geloven?
Kan een natuurwetenschapper geloven?Kan een natuurwetenschapper geloven?
Kan een natuurwetenschapper geloven?Daan van Schalkwijk
 
Grupo nossos poetas de ontem, de hoje, de sempre... agradecimentos
Grupo nossos poetas de ontem, de hoje, de sempre... agradecimentosGrupo nossos poetas de ontem, de hoje, de sempre... agradecimentos
Grupo nossos poetas de ontem, de hoje, de sempre... agradecimentosLuzia Gabriele
 
Gonçalves dias olhos verdes
Gonçalves dias olhos verdesGonçalves dias olhos verdes
Gonçalves dias olhos verdesLuzia Gabriele
 
La classification et l’identification des cultures par la télédétection
La classification et l’identification des cultures par la télédétectionLa classification et l’identification des cultures par la télédétection
La classification et l’identification des cultures par la télédétectionAbdessadek ELASRI
 

Destaque (16)

Handout - Using Technology To Enhance Your Teaching
Handout - Using Technology To Enhance Your TeachingHandout - Using Technology To Enhance Your Teaching
Handout - Using Technology To Enhance Your Teaching
 
ASHFORD GRADUATION DIPLOMAS
ASHFORD GRADUATION DIPLOMASASHFORD GRADUATION DIPLOMAS
ASHFORD GRADUATION DIPLOMAS
 
Rahul Gautam CV
Rahul Gautam CVRahul Gautam CV
Rahul Gautam CV
 
2009-10-07 IBM zExpo 2009, Current & Future Linux on System z
2009-10-07 IBM zExpo 2009, Current & Future Linux on System z2009-10-07 IBM zExpo 2009, Current & Future Linux on System z
2009-10-07 IBM zExpo 2009, Current & Future Linux on System z
 
Dejan Verčič - Nikola Ljubičić
Dejan Verčič - Nikola LjubičićDejan Verčič - Nikola Ljubičić
Dejan Verčič - Nikola Ljubičić
 
AD-Design1 (1)
AD-Design1 (1)AD-Design1 (1)
AD-Design1 (1)
 
CURSOS INTENSIVOS DE VERANO 2016
CURSOS INTENSIVOS DE VERANO 2016CURSOS INTENSIVOS DE VERANO 2016
CURSOS INTENSIVOS DE VERANO 2016
 
Aparato circulatorio POR Erika Aracely Carranza P.
Aparato circulatorio POR Erika Aracely Carranza P.Aparato circulatorio POR Erika Aracely Carranza P.
Aparato circulatorio POR Erika Aracely Carranza P.
 
Kan een natuurwetenschapper geloven?
Kan een natuurwetenschapper geloven?Kan een natuurwetenschapper geloven?
Kan een natuurwetenschapper geloven?
 
Grupo nossos poetas de ontem, de hoje, de sempre... agradecimentos
Grupo nossos poetas de ontem, de hoje, de sempre... agradecimentosGrupo nossos poetas de ontem, de hoje, de sempre... agradecimentos
Grupo nossos poetas de ontem, de hoje, de sempre... agradecimentos
 
Fa jan 17
Fa jan 17Fa jan 17
Fa jan 17
 
Gonçalves dias olhos verdes
Gonçalves dias olhos verdesGonçalves dias olhos verdes
Gonçalves dias olhos verdes
 
CAT
CATCAT
CAT
 
La classification et l’identification des cultures par la télédétection
La classification et l’identification des cultures par la télédétectionLa classification et l’identification des cultures par la télédétection
La classification et l’identification des cultures par la télédétection
 
IMIA Chiang Spatial Computing - 2016
IMIA Chiang Spatial Computing - 2016IMIA Chiang Spatial Computing - 2016
IMIA Chiang Spatial Computing - 2016
 
Proposal writing
Proposal writingProposal writing
Proposal writing
 

Semelhante a Using Arbor/ RGraph JS libaries for Data Visualisation

node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ioSteven Beeckman
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)Night Sailer
 
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsMySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsAlexander Rubin
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkitwlscaudill
 
JS Fest 2019 Node.js Antipatterns
JS Fest 2019 Node.js AntipatternsJS Fest 2019 Node.js Antipatterns
JS Fest 2019 Node.js AntipatternsTimur Shemsedinov
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile servicesAymeric Weinbach
 
Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0Frost
 
Developing web-apps like it's 2013
Developing web-apps like it's 2013Developing web-apps like it's 2013
Developing web-apps like it's 2013Laurent_VB
 
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015NoSQLmatters
 
Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkitnikhilyagnic
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Librariesjeresig
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascriptkvangork
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptkvangork
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.Nerd Tzanetopoulos
 
Javascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionJavascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionIban Martinez
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs偉格 高
 

Semelhante a Using Arbor/ RGraph JS libaries for Data Visualisation (20)

node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.io
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsMySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of Things
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkit
 
JS Fest 2019 Node.js Antipatterns
JS Fest 2019 Node.js AntipatternsJS Fest 2019 Node.js Antipatterns
JS Fest 2019 Node.js Antipatterns
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile services
 
Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0
 
Developing web-apps like it's 2013
Developing web-apps like it's 2013Developing web-apps like it's 2013
Developing web-apps like it's 2013
 
NoSQL meets Microservices
NoSQL meets MicroservicesNoSQL meets Microservices
NoSQL meets Microservices
 
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
 
Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkit
 
Secrets of JavaScript Libraries
Secrets of JavaScript LibrariesSecrets of JavaScript Libraries
Secrets of JavaScript Libraries
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascript
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.
 
Javascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionJavascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introduction
 
Road to react hooks
Road to react hooksRoad to react hooks
Road to react hooks
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
MongoDB and RDBMS
MongoDB and RDBMSMongoDB and RDBMS
MongoDB and RDBMS
 

Mais de Alex Hardman

21st Century Research Profiles Presentation
21st Century Research Profiles Presentation21st Century Research Profiles Presentation
21st Century Research Profiles PresentationAlex Hardman
 
21st Century Research Profiles Handout
21st Century Research Profiles Handout21st Century Research Profiles Handout
21st Century Research Profiles HandoutAlex Hardman
 
Technology Enabled Teaching
Technology Enabled TeachingTechnology Enabled Teaching
Technology Enabled TeachingAlex Hardman
 
Research2.0 Identity Management
Research2.0   Identity ManagementResearch2.0   Identity Management
Research2.0 Identity ManagementAlex Hardman
 
Technology Enabled Research
Technology Enabled ResearchTechnology Enabled Research
Technology Enabled ResearchAlex Hardman
 
Technology Enabled Research Handout
Technology Enabled Research HandoutTechnology Enabled Research Handout
Technology Enabled Research HandoutAlex Hardman
 
Integrating Technology Into Researcher Training Slides
Integrating Technology Into Researcher Training SlidesIntegrating Technology Into Researcher Training Slides
Integrating Technology Into Researcher Training SlidesAlex Hardman
 
Research Methods Online
Research Methods OnlineResearch Methods Online
Research Methods OnlineAlex Hardman
 
Technology Enhanced Training
Technology Enhanced TrainingTechnology Enhanced Training
Technology Enhanced TrainingAlex Hardman
 
Social Networking in Research
Social Networking in ResearchSocial Networking in Research
Social Networking in ResearchAlex Hardman
 
Blogging & Social Networking - Some thoughts about the social and educational...
Blogging & Social Networking - Some thoughts about the social and educational...Blogging & Social Networking - Some thoughts about the social and educational...
Blogging & Social Networking - Some thoughts about the social and educational...Alex Hardman
 

Mais de Alex Hardman (11)

21st Century Research Profiles Presentation
21st Century Research Profiles Presentation21st Century Research Profiles Presentation
21st Century Research Profiles Presentation
 
21st Century Research Profiles Handout
21st Century Research Profiles Handout21st Century Research Profiles Handout
21st Century Research Profiles Handout
 
Technology Enabled Teaching
Technology Enabled TeachingTechnology Enabled Teaching
Technology Enabled Teaching
 
Research2.0 Identity Management
Research2.0   Identity ManagementResearch2.0   Identity Management
Research2.0 Identity Management
 
Technology Enabled Research
Technology Enabled ResearchTechnology Enabled Research
Technology Enabled Research
 
Technology Enabled Research Handout
Technology Enabled Research HandoutTechnology Enabled Research Handout
Technology Enabled Research Handout
 
Integrating Technology Into Researcher Training Slides
Integrating Technology Into Researcher Training SlidesIntegrating Technology Into Researcher Training Slides
Integrating Technology Into Researcher Training Slides
 
Research Methods Online
Research Methods OnlineResearch Methods Online
Research Methods Online
 
Technology Enhanced Training
Technology Enhanced TrainingTechnology Enhanced Training
Technology Enhanced Training
 
Social Networking in Research
Social Networking in ResearchSocial Networking in Research
Social Networking in Research
 
Blogging & Social Networking - Some thoughts about the social and educational...
Blogging & Social Networking - Some thoughts about the social and educational...Blogging & Social Networking - Some thoughts about the social and educational...
Blogging & Social Networking - Some thoughts about the social and educational...
 

Último

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Último (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Using Arbor/ RGraph JS libaries for Data Visualisation

  • 1. EPSRC – Data Visualisation Proof of Concept Alex Hardman
  • 2. Topics • Node Graph (bouncing balls) – (Quick) Demo – Libraries – Frontend / AJAX • Details Graphs (bar charts etc) – (Quick) Demo – Libraries – Frontend / AJAX
  • 4. Libraries • Node Graph  arborjs.org • Graphs  rgraph.net HTML5 + Canvas
  • 5. Node Graph • Uses Canvas (via the HTML5 getContext() object. • The getContext("2d") object has methods to draw lines, boxes, circles, and more. • Uses the Arbor js framework to store nodes and edges and handle updating their coordinates as the simulation progresses.
  • 6. Node Graph - Creation arbor.ParticleSystem() • Parameters – Repulsion (the force repelling nodes from each other) – Stiffness (600 the rigidity of the edges) – Friction (the amount of damping in the system) – Gravity (an additional force attracting nodes to the origin) – Fps (frames per second) – Dt (timestep to use for stepping the simulation) – Precision (accuracy vs. speed in force calculations (zero is fast but jittery, one is smooth but cpu-intensive) (stored in web.config passed to the view)
  • 7. Feeding the graph • Three calls to the server for graph data loadInitialData loadChildNodes search
  • 8. Feed the graph… “NodeGraphDTO” • JSON from the server  “NodeGraphDTO”
  • 9. Feed the graph… “NodeGraphDTO” • Lists of : Entities Relationships
  • 10. Feed the graph… API foreach(grant in Grants){ If (showGrants()) { ParticleSystem.addNode( Id, {data we define such as size, colour, label text etc }) } } … Do for each type in NodeGraphDTO
  • 11. Feed the graph… API if(showPeople() && showGrants(){ foreach (rel in grantPersons) { get the grant get the person ParticleSystem.addEdge( grantId personId } }
  • 12. Node Graph – API Callbacks • redraw()  Gets called repeatedly for each frame • We handle callbacks for: – particleSystem.eachEdge(edge, pt1 pt2) • Draw a gradient line between pt1 and pt2 – particleSystem.eachNode(node, pt) • Work out what type of node we have • Draw it out accordingly (Shape? ,Text? Size? Colour?)
  • 13. Node Graph – API Callbacks • initMouseHandling – Moved  used to determine whether to display hover text – Clicked – Dragged – Dropped  determine whether to load child nodes and quick details
  • 14. JS – (as DRY as possible?) $(document).ready(function () { //Instantiate control objects _restoreManager = new RestoreManager(); _state = new SystemState(); _aData = new DataHandler(); _controlsManager = new ControlsManager(); _nodeController = new NodeController(); //Initialise controls _controlsManager.initialiseControls(); //Load initial data _aData.loadInitialData(); });
  • 15. General Usage //Define object function ‘ControlsManager’ function ControlsManager() { var self = this; //Fix context of ‘this’ to the object function self.aPublicFunction = function(param) { //I’m public } function aPrivateFunction (){ I’m private// } }
  • 16. ControlsManager //Define controls once as private var showGrantsChk = $("input:checkbox[id=ShowGran ts]"); var showOutcomesChk = $("input:checkbox[id=ShowOutc omes]"); etc…
  • 17. ControlsManager //access them via public functions self.initialiseControls = function () { …on(‘click’,…) etc. } self.clearDetails = function() {…}
  • 18. DataHandler self.saveNodeGraphData(data) { //Stores NodeGraphDTO object //from server } self.childData = []; //can contain child DataHandler(s) //retrieved when clicking on nodes self.addChildData(childDataHandler)
  • 19. DataHandler //Contains ajax functionilty for //graph data. loadInitialData() //called on document ready loadChildNodes() //called after clicking on a node
  • 20. NodeController function initSystem() { var sys = arbor.ParticleSystem(..); } self.throttle() self.unthrottle()
  • 21. NodeController self.doGraphObjects() { buildThemes(); buildPeople(); //and all other nodes buildPeopleToGrantEdges(); //and all other edges for (var i = 0; i < _aData.childData.length; i++) { var childDataHandler = _aData.childData[i]; self.doChildObjects (childDataHandler); } }
  • 22. NodeController - buildPeople self.buildPeople() { if (_state.showPeople()){ for(each person in _aData.People){ addPersonNode(person) sys.addEdge(…) } } }
  • 23. NodeController - addPersonNode addPersonNode(person){ if (!nodeExists(person.Id)){ sys.addNode( person.Id, { color:pColor, display:person.Id, size: nodeSize, type: person.Type, nodeType:labelNodeType, showLabel:true } ); } }
  • 24. NodeController - buildPeopleToGrantEdges buildPeopleToGrantEdges () { if (_state.showPeople() && _state.showGrants()) { for (var i = 0; i < _aData.peopleToGrants.length; i++) { var pg = _aData.peopleToGrants[i]; var personNode = sys.getNode(pg.PersonId); var grantNode = sys.getNode(pg.GrantId); if (personNode !=undefined && grantNode != undefined) { sys.addEdge(pg.PersonId, pg.GrantId, { color: edgeColour }); } } } };
  • 25. NodeControler - doChildObjects self.doChildObjects = function(cData){ var parent = sys.getNode (cData.rootData.Id); //If the parent is null it is not //a child object so do nothing if (parent != undefined) { addChildPeopleNodes(parent, cData.peopleData); //And all the other types //(grants…, research areas…) } };
  • 26. NodeController - addCildPeopleNodes function addChildPeopleNodes(parentNode, peopleDataArr) { if (_state.showPeople()) { for (var i = 0; i < peopleDataArr.length; i++) { var person = peopleDataArr[i]; //If the node is root it ain’t a child! if (!_state.isCurrentRoot(person.Id)) { var exisitng = sys.getNode(person.Id); if (exisitng == undefined) { addPersonNode(person); _aData.addNodeId(person.Id); } sys.addEdge( parentNode.data.display, person.Id, { color: edgeColour }); } } } }
  • 27. RestoreManager //initialises the reset storage //in local storage function initResetStorage(){ localStorage.resetData = ""; }
  • 28. RestoreManager self.addRestorePoint = function (data) { if (localStorage.resetData != "") { var resetArr = JSON.parse (localStorage.resetData); resetArr.push(data); localStorage.resetData = JSON.stringify (resetArr); } else { localStorage.resetData = JSON.stringify (new Array(data)); } };
  • 29. RestoreManager self.getLastRestoreData = function () { var resetData = JSON.parse (localStorage.resetData); if (resetData.length > 0) { if (resetData.length == 1) { return resetData[0]; } var l = resetData.length; var data = resetData[l - 2]; resetData.pop(); localStorage.resetData = JSON.stringify (resetData); return data; } return null; };
  • 30. Drawing out the nodes - Renderer arborgraph.js Line 1172
  • 32.
  • 33.
  • 34.
  • 35. Details.js - ControlsManager self.doResearchAreaGraph = function () { var canvas = getCanvas(); var ctx = canvas.getContext('2d'); ctx.clearRect (0, 0, canvas.width, canvas.height); if(_state.selectedGraphType() == "Bar Chart"){ graph = new RGraph.Bar('graphCanvas', _dataManager.raData.GraphValues); graph.Set('chart.background.barcolor1', 'white'); graph.Set('chart.background.barcolor2', 'white'); graph.Set('chart.labels', _dataManager.raData.Themes); } };