visNetwork & leaflet for tracking criminals

46 %
54 %
Information about visNetwork & leaflet for tracking criminals

Published on February 28, 2018

Author: LeonHJKim

Source: slideshare.net

1. visNetwork, DT::datatable, leaflet George Kikuchi

2. Problem • Criminals often co-offend • Cumbersome process to search multiple data sources to identify co-offending patterns • Mainframe-based system as the PPD users’ go-to resources

3. R Shiny Integration

4. Toy Data • Relationship data from Pulp Fiction • Co-appearance is defined as a linkage – Sources: • http://www.moviegalaxies.com • https://la.curbed.com

5. Building Blocks • Shiny • Shinydashboard • visNetwork • DT datatable • leaflet

6. Building Blocks • Shiny • Shinydashboard • visNetwork • DT datatable • leaflet

7. Building Blocks • Shiny • Shinydashboard • visNetwork • DT datatable • leaflet

8. Node and Edge

9. visNetwork(nodes, edges)

10. Building Blocks • Shiny • Shinydashboard • visNetwork • DT datatable • leaflet

11. datatable(data.frame)

12. Building Blocks • Shiny • Shinydashboard • visNetwork • DT datatable • leaflet

13. More functions, visualizations, and interactivity • Embedding a photo within datatable

14. More functions, visualizations, and interactivity • Hyperlinking visNetwork nodes (double-click) visEvents(doubleClick = "function(properties) { window.open('https://www.google.com/search?q=p ulp+fiction+' + this.body.data.nodes.get(properties.nodes[0]).id);}",

15. More functions, visualizations, and interactivity • Expanding a network through a click

16. • # selecting network elements observe({ input$current_node_id visNetworkProxy("network") %>% visGetSelectedNodes() }) • # react to a network element selection (e.g., left click a node) observeEvent(input$network_selected, { # insert additional data script here visNetworkProxy("network") %>% visUpdateNodes(nodes = nodes2) %>% visUpdateEdges(edges = edges2) })

17. More functions, visualizations, and interactivity • Linking visNetwork and data.table Clicking a link (edge) applies a filter to data.table to get detail information subset(table.df, id %in% input$network_selectedEdges)

Add a comment