Skip to content

Latest commit

 

History

History
235 lines (158 loc) · 39.5 KB

File metadata and controls

235 lines (158 loc) · 39.5 KB
title Dynamic Visualization

Logistics

<iframe class='embed-responsive-item' src='schedule.html' width=100% height=700px allowfullscreen></iframe>

HTML Visualization

DataTables

DataTables display R data frames as interactive HTML tables (with filtering, pagination, sorting, and search). This is a great way to make your raw data browsable without using too much space.

library(widgetframe)
library(DT)
datatable(iris, options = list(pageLength = 5))
<script type="application/json" data-for="htmlwidget-85a6f86490cb1b19662e">{"x":{"filter":"none","data":[["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100","101","102","103","104","105","106","107","108","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","124","125","126","127","128","129","130","131","132","133","134","135","136","137","138","139","140","141","142","143","144","145","146","147","148","149","150"],[5.1,4.9,4.7,4.6,5,5.4,4.6,5,4.4,4.9,5.4,4.8,4.8,4.3,5.8,5.7,5.4,5.1,5.7,5.1,5.4,5.1,4.6,5.1,4.8,5,5,5.2,5.2,4.7,4.8,5.4,5.2,5.5,4.9,5,5.5,4.9,4.4,5.1,5,4.5,4.4,5,5.1,4.8,5.1,4.6,5.3,5,7,6.4,6.9,5.5,6.5,5.7,6.3,4.9,6.6,5.2,5,5.9,6,6.1,5.6,6.7,5.6,5.8,6.2,5.6,5.9,6.1,6.3,6.1,6.4,6.6,6.8,6.7,6,5.7,5.5,5.5,5.8,6,5.4,6,6.7,6.3,5.6,5.5,5.5,6.1,5.8,5,5.6,5.7,5.7,6.2,5.1,5.7,6.3,5.8,7.1,6.3,6.5,7.6,4.9,7.3,6.7,7.2,6.5,6.4,6.8,5.7,5.8,6.4,6.5,7.7,7.7,6,6.9,5.6,7.7,6.3,6.7,7.2,6.2,6.1,6.4,7.2,7.4,7.9,6.4,6.3,6.1,7.7,6.3,6.4,6,6.9,6.7,6.9,5.8,6.8,6.7,6.7,6.3,6.5,6.2,5.9],[3.5,3,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3,3,4,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.6,3,3.4,3.5,2.3,3.2,3.5,3.8,3,3.8,3.2,3.7,3.3,3.2,3.2,3.1,2.3,2.8,2.8,3.3,2.4,2.9,2.7,2,3,2.2,2.9,2.9,3.1,3,2.7,2.2,2.5,3.2,2.8,2.5,2.8,2.9,3,2.8,3,2.9,2.6,2.4,2.4,2.7,2.7,3,3.4,3.1,2.3,3,2.5,2.6,3,2.6,2.3,2.7,3,2.9,2.9,2.5,2.8,3.3,2.7,3,2.9,3,3,2.5,2.9,2.5,3.6,3.2,2.7,3,2.5,2.8,3.2,3,3.8,2.6,2.2,3.2,2.8,2.8,2.7,3.3,3.2,2.8,3,2.8,3,2.8,3.8,2.8,2.8,2.6,3,3.4,3.1,3,3.1,3.1,3.1,2.7,3.2,3.3,3,2.5,3,3.4,3],[1.4,1.4,1.3,1.5,1.4,1.7,1.4,1.5,1.4,1.5,1.5,1.6,1.4,1.1,1.2,1.5,1.3,1.4,1.7,1.5,1.7,1.5,1,1.7,1.9,1.6,1.6,1.5,1.4,1.6,1.6,1.5,1.5,1.4,1.5,1.2,1.3,1.4,1.3,1.5,1.3,1.3,1.3,1.6,1.9,1.4,1.6,1.4,1.5,1.4,4.7,4.5,4.9,4,4.6,4.5,4.7,3.3,4.6,3.9,3.5,4.2,4,4.7,3.6,4.4,4.5,4.1,4.5,3.9,4.8,4,4.9,4.7,4.3,4.4,4.8,5,4.5,3.5,3.8,3.7,3.9,5.1,4.5,4.5,4.7,4.4,4.1,4,4.4,4.6,4,3.3,4.2,4.2,4.2,4.3,3,4.1,6,5.1,5.9,5.6,5.8,6.6,4.5,6.3,5.8,6.1,5.1,5.3,5.5,5,5.1,5.3,5.5,6.7,6.9,5,5.7,4.9,6.7,4.9,5.7,6,4.8,4.9,5.6,5.8,6.1,6.4,5.6,5.1,5.6,6.1,5.6,5.5,4.8,5.4,5.6,5.1,5.1,5.9,5.7,5.2,5,5.2,5.4,5.1],[0.2,0.2,0.2,0.2,0.2,0.4,0.3,0.2,0.2,0.1,0.2,0.2,0.1,0.1,0.2,0.4,0.4,0.3,0.3,0.3,0.2,0.4,0.2,0.5,0.2,0.2,0.4,0.2,0.2,0.2,0.2,0.4,0.1,0.2,0.2,0.2,0.2,0.1,0.2,0.2,0.3,0.3,0.2,0.6,0.4,0.3,0.2,0.2,0.2,0.2,1.4,1.5,1.5,1.3,1.5,1.3,1.6,1,1.3,1.4,1,1.5,1,1.4,1.3,1.4,1.5,1,1.5,1.1,1.8,1.3,1.5,1.2,1.3,1.4,1.4,1.7,1.5,1,1.1,1,1.2,1.6,1.5,1.6,1.5,1.3,1.3,1.3,1.2,1.4,1.2,1,1.3,1.2,1.3,1.3,1.1,1.3,2.5,1.9,2.1,1.8,2.2,2.1,1.7,1.8,1.8,2.5,2,1.9,2.1,2,2.4,2.3,1.8,2.2,2.3,1.5,2.3,2,2,1.8,2.1,1.8,1.8,1.8,2.1,1.6,1.9,2,2.2,1.5,1.4,2.3,2.4,1.8,1.8,2.1,2.4,2.3,1.9,2.3,2.5,2.3,1.9,2,2.3,1.8],["setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","setosa","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","versicolor","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica","virginica"]],"container":"\n \n \n
<\/th>\n Sepal.Length<\/th>\n Sepal.Width<\/th>\n Petal.Length<\/th>\n Petal.Width<\/th>\n Species<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"pageLength":5,"columnDefs":[{"className":"dt-right","targets":[1,2,3,4]},{"orderable":false,"targets":0}],"order":[],"autoWidth":false,"orderClasses":false,"lengthMenu":[5,10,25,50,100]}},"evals":[],"jsHooks":[]}</script>

rbokeh

Interface to the Bokeh library for making interactive graphics.

library(rbokeh)
figure(width = 800, height=400) %>%
  ly_points(Sepal.Length, Sepal.Width, data = iris,
    color = Species, glyph = Species,
    hover = list(Sepal.Length, Sepal.Width))
<script type="application/json" data-for="htmlwidget-f9b6523c34cc0c9c4682">{"x":{"elementid":"5798d2a77cb1d45f67773de6d95fb736","modeltype":"Plot","modelid":"34c100cf983beb28905a7696d4986ed5","docid":"f9bd66ddd35b7aef633e2e3db42db23f","docs_json":{"f9bd66ddd35b7aef633e2e3db42db23f":{"version":"0.12.2","title":"Bokeh Figure","roots":{"root_ids":["34c100cf983beb28905a7696d4986ed5"],"references":[{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","attributes":{"id":"34c100cf983beb28905a7696d4986ed5","plot_width":800,"plot_height":400,"sizing_mode":"scale_both","x_range":{"type":"Range1d","id":"99c49992c8bbd0c21588a9a755d0e4a2"},"y_range":{"type":"Range1d","id":"ef687be57b7af12731a88706f7916454"},"left":[{"type":"LinearAxis","id":"9bde1d9c5d65bac86b87ac213a86c430"}],"below":[{"type":"LinearAxis","id":"3c36777a5d14b96a2906357b7b08c7c5"}],"right":[],"above":[],"renderers":[{"type":"BoxAnnotation","id":"afeaee7cd6e89c2c6f7c447a32021e39"},{"type":"GlyphRenderer","id":"bb96550ac4a9b08fb95ff36981e364f0"},{"type":"GlyphRenderer","id":"80f1bc9c532c9892f8f3f920c05dc5fd"},{"type":"GlyphRenderer","id":"d039e612738747a129787814ef56f8ee"},{"type":"GlyphRenderer","id":"6904c41a7e54c0f7051212f6f9c06c21"},{"type":"GlyphRenderer","id":"af629659bed146652ee3bf7347134167"},{"type":"GlyphRenderer","id":"051d7b63d7c6e5d9c02f3d486cfc11db"},{"type":"Legend","id":"507d53111fdc8f139561edcfed91a2b4"},{"type":"LinearAxis","id":"3c36777a5d14b96a2906357b7b08c7c5"},{"type":"Grid","id":"67431e627aeeb03fed3ef6604a85ddf5"},{"type":"LinearAxis","id":"9bde1d9c5d65bac86b87ac213a86c430"},{"type":"Grid","id":"7aa69cf6de78182ecb1b75a7293de170"}],"extra_y_ranges":{},"extra_x_ranges":{},"tags":[],"min_border_left":4,"min_border_right":4,"min_border_top":4,"min_border_bottom":4,"lod_threshold":null,"toolbar":{"type":"Toolbar","id":"d21f01b72e30ed87ad74f2b967cee454"},"tool_events":{"type":"ToolEvents","id":"e030c04b75cbea4728e79e42f70e0bc1"}},"subtype":"Figure"},{"type":"Toolbar","id":"d21f01b72e30ed87ad74f2b967cee454","attributes":{"id":"d21f01b72e30ed87ad74f2b967cee454","tags":[],"active_drag":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"type":"PanTool","id":"dda8ca946520eaa96eca7c3ad1e68706"},{"type":"WheelZoomTool","id":"c83c4a8c07e73b894e2e1393aa8cd45b"},{"type":"BoxZoomTool","id":"af7df522a8e197b95ec7933baa4799d8"},{"type":"ResetTool","id":"95b711d300fbf7ebeb3d8cd97a639fab"},{"type":"SaveTool","id":"453c532ffd4e1b2f8f86a3785c8cbbd5"},{"type":"HelpTool","id":"27d55c3d8b98fa3a6d5697f20e0bb178"},{"type":"HoverTool","id":"425873221dfa2e45c8e098578bb96ef3"},{"type":"HoverTool","id":"dd74938437137d8c4337da16ce0391e4"},{"type":"HoverTool","id":"6884190a62a1197e6fa9486ed193ae4d"}],"logo":null}},{"type":"PanTool","id":"dda8ca946520eaa96eca7c3ad1e68706","attributes":{"id":"dda8ca946520eaa96eca7c3ad1e68706","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"ToolEvents","id":"e030c04b75cbea4728e79e42f70e0bc1","attributes":{"id":"e030c04b75cbea4728e79e42f70e0bc1","tags":[]},"geometries":[]},{"type":"WheelZoomTool","id":"c83c4a8c07e73b894e2e1393aa8cd45b","attributes":{"id":"c83c4a8c07e73b894e2e1393aa8cd45b","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"BoxAnnotation","id":"afeaee7cd6e89c2c6f7c447a32021e39","attributes":{"id":"afeaee7cd6e89c2c6f7c447a32021e39","tags":[],"line_color":{"units":"data","value":"black"},"line_alpha":{"units":"data","value":1},"fill_color":{"units":"data","value":"lightgrey"},"fill_alpha":{"units":"data","value":0.5},"line_dash":[4,4],"line_width":{"units":"data","value":2},"level":"overlay","top_units":"screen","bottom_units":"screen","left_units":"screen","right_units":"screen","render_mode":"css"}},{"type":"BoxZoomTool","id":"af7df522a8e197b95ec7933baa4799d8","attributes":{"id":"af7df522a8e197b95ec7933baa4799d8","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"overlay":{"type":"BoxAnnotation","id":"afeaee7cd6e89c2c6f7c447a32021e39"}}},{"type":"ResetTool","id":"95b711d300fbf7ebeb3d8cd97a639fab","attributes":{"id":"95b711d300fbf7ebeb3d8cd97a639fab","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"}}},{"type":"SaveTool","id":"453c532ffd4e1b2f8f86a3785c8cbbd5","attributes":{"id":"453c532ffd4e1b2f8f86a3785c8cbbd5","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"}}},{"type":"HelpTool","id":"27d55c3d8b98fa3a6d5697f20e0bb178","attributes":{"id":"27d55c3d8b98fa3a6d5697f20e0bb178","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"redirect":"http://hafen.github.io/rbokeh","help_tooltip":"Click to learn more about rbokeh."}},{"type":"HoverTool","id":"425873221dfa2e45c8e098578bb96ef3","attributes":{"id":"425873221dfa2e45c8e098578bb96ef3","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"bb96550ac4a9b08fb95ff36981e364f0"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"833b88465634de7941221051c40cc2e6","attributes":{"id":"833b88465634de7941221051c40cc2e6","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[5.1,4.9,4.7,4.6,5,5.4,4.6,5,4.4,4.9,5.4,4.8,4.8,4.3,5.8,5.7,5.4,5.1,5.7,5.1,5.4,5.1,4.6,5.1,4.8,5,5,5.2,5.2,4.7,4.8,5.4,5.2,5.5,4.9,5,5.5,4.9,4.4,5.1,5,4.5,4.4,5,5.1,4.8,5.1,4.6,5.3,5],"y":[3.5,3,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3,3,4,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.6,3,3.4,3.5,2.3,3.2,3.5,3.8,3,3.8,3.2,3.7,3.3],"line_color":["#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4"],"fill_color":["#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4"],"hover_col_1":["5.1","4.9","4.7","4.6","5.0","5.4","4.6","5.0","4.4","4.9","5.4","4.8","4.8","4.3","5.8","5.7","5.4","5.1","5.7","5.1","5.4","5.1","4.6","5.1","4.8","5.0","5.0","5.2","5.2","4.7","4.8","5.4","5.2","5.5","4.9","5.0","5.5","4.9","4.4","5.1","5.0","4.5","4.4","5.0","5.1","4.8","5.1","4.6","5.3","5.0"],"hover_col_2":["3.5","3.0","3.2","3.1","3.6","3.9","3.4","3.4","2.9","3.1","3.7","3.4","3.0","3.0","4.0","4.4","3.9","3.5","3.8","3.8","3.4","3.7","3.6","3.3","3.4","3.0","3.4","3.5","3.4","3.2","3.1","3.4","4.1","4.2","3.1","3.2","3.5","3.6","3.0","3.4","3.5","2.3","3.2","3.5","3.8","3.0","3.8","3.2","3.7","3.3"]}}},{"type":"Circle","id":"7d72ac7debc3a2a1e320ac4b92c8c326","attributes":{"id":"7d72ac7debc3a2a1e320ac4b92c8c326","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Circle","id":"29c9dd5d257d6f3c980b9eb09f6a2b8c","attributes":{"id":"29c9dd5d257d6f3c980b9eb09f6a2b8c","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Circle","id":"43c860a4403a9b7fb37404c91cf4dfac","attributes":{"id":"43c860a4403a9b7fb37404c91cf4dfac","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"bb96550ac4a9b08fb95ff36981e364f0","attributes":{"id":"bb96550ac4a9b08fb95ff36981e364f0","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"29c9dd5d257d6f3c980b9eb09f6a2b8c"},"hover_glyph":{"type":"Circle","id":"43c860a4403a9b7fb37404c91cf4dfac"},"name":null,"data_source":{"type":"ColumnDataSource","id":"833b88465634de7941221051c40cc2e6"},"glyph":{"type":"Circle","id":"7d72ac7debc3a2a1e320ac4b92c8c326"}}},{"type":"HoverTool","id":"dd74938437137d8c4337da16ce0391e4","attributes":{"id":"dd74938437137d8c4337da16ce0391e4","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"80f1bc9c532c9892f8f3f920c05dc5fd"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"5ac8fa215ec21115d16e9cd94e314c55","attributes":{"id":"5ac8fa215ec21115d16e9cd94e314c55","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[7,6.4,6.9,5.5,6.5,5.7,6.3,4.9,6.6,5.2,5,5.9,6,6.1,5.6,6.7,5.6,5.8,6.2,5.6,5.9,6.1,6.3,6.1,6.4,6.6,6.8,6.7,6,5.7,5.5,5.5,5.8,6,5.4,6,6.7,6.3,5.6,5.5,5.5,6.1,5.8,5,5.6,5.7,5.7,6.2,5.1,5.7],"y":[3.2,3.2,3.1,2.3,2.8,2.8,3.3,2.4,2.9,2.7,2,3,2.2,2.9,2.9,3.1,3,2.7,2.2,2.5,3.2,2.8,2.5,2.8,2.9,3,2.8,3,2.9,2.6,2.4,2.4,2.7,2.7,3,3.4,3.1,2.3,3,2.5,2.6,3,2.6,2.3,2.7,3,2.9,2.9,2.5,2.8],"line_color":["#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E"],"fill_color":["#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E"],"hover_col_1":["7.0","6.4","6.9","5.5","6.5","5.7","6.3","4.9","6.6","5.2","5.0","5.9","6.0","6.1","5.6","6.7","5.6","5.8","6.2","5.6","5.9","6.1","6.3","6.1","6.4","6.6","6.8","6.7","6.0","5.7","5.5","5.5","5.8","6.0","5.4","6.0","6.7","6.3","5.6","5.5","5.5","6.1","5.8","5.0","5.6","5.7","5.7","6.2","5.1","5.7"],"hover_col_2":["3.2","3.2","3.1","2.3","2.8","2.8","3.3","2.4","2.9","2.7","2.0","3.0","2.2","2.9","2.9","3.1","3.0","2.7","2.2","2.5","3.2","2.8","2.5","2.8","2.9","3.0","2.8","3.0","2.9","2.6","2.4","2.4","2.7","2.7","3.0","3.4","3.1","2.3","3.0","2.5","2.6","3.0","2.6","2.3","2.7","3.0","2.9","2.9","2.5","2.8"]}}},{"type":"Square","id":"cbd544f0598093e1dadd0ab8677734a6","attributes":{"id":"cbd544f0598093e1dadd0ab8677734a6","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Square","id":"435578ebc57f292b77f26d21d87eec4b","attributes":{"id":"435578ebc57f292b77f26d21d87eec4b","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Square","id":"3bf3dd1f94a1d54eaba8e542482b37d2","attributes":{"id":"3bf3dd1f94a1d54eaba8e542482b37d2","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"80f1bc9c532c9892f8f3f920c05dc5fd","attributes":{"id":"80f1bc9c532c9892f8f3f920c05dc5fd","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Square","id":"435578ebc57f292b77f26d21d87eec4b"},"hover_glyph":{"type":"Square","id":"3bf3dd1f94a1d54eaba8e542482b37d2"},"name":null,"data_source":{"type":"ColumnDataSource","id":"5ac8fa215ec21115d16e9cd94e314c55"},"glyph":{"type":"Square","id":"cbd544f0598093e1dadd0ab8677734a6"}}},{"type":"HoverTool","id":"6884190a62a1197e6fa9486ed193ae4d","attributes":{"id":"6884190a62a1197e6fa9486ed193ae4d","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"d039e612738747a129787814ef56f8ee"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"f1a4ea6edb8f95b2832083ec6d4c6670","attributes":{"id":"f1a4ea6edb8f95b2832083ec6d4c6670","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[6.3,5.8,7.1,6.3,6.5,7.6,4.9,7.3,6.7,7.2,6.5,6.4,6.8,5.7,5.8,6.4,6.5,7.7,7.7,6,6.9,5.6,7.7,6.3,6.7,7.2,6.2,6.1,6.4,7.2,7.4,7.9,6.4,6.3,6.1,7.7,6.3,6.4,6,6.9,6.7,6.9,5.8,6.8,6.7,6.7,6.3,6.5,6.2,5.9],"y":[3.3,2.7,3,2.9,3,3,2.5,2.9,2.5,3.6,3.2,2.7,3,2.5,2.8,3.2,3,3.8,2.6,2.2,3.2,2.8,2.8,2.7,3.3,3.2,2.8,3,2.8,3,2.8,3.8,2.8,2.8,2.6,3,3.4,3.1,3,3.1,3.1,3.1,2.7,3.2,3.3,3,2.5,3,3.4,3],"line_color":["#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C"],"fill_color":["#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C"],"hover_col_1":["6.3","5.8","7.1","6.3","6.5","7.6","4.9","7.3","6.7","7.2","6.5","6.4","6.8","5.7","5.8","6.4","6.5","7.7","7.7","6.0","6.9","5.6","7.7","6.3","6.7","7.2","6.2","6.1","6.4","7.2","7.4","7.9","6.4","6.3","6.1","7.7","6.3","6.4","6.0","6.9","6.7","6.9","5.8","6.8","6.7","6.7","6.3","6.5","6.2","5.9"],"hover_col_2":["3.3","2.7","3.0","2.9","3.0","3.0","2.5","2.9","2.5","3.6","3.2","2.7","3.0","2.5","2.8","3.2","3.0","3.8","2.6","2.2","3.2","2.8","2.8","2.7","3.3","3.2","2.8","3.0","2.8","3.0","2.8","3.8","2.8","2.8","2.6","3.0","3.4","3.1","3.0","3.1","3.1","3.1","2.7","3.2","3.3","3.0","2.5","3.0","3.4","3.0"]}}},{"type":"Triangle","id":"7a5e1294f01430e98f0dd2d900a27b50","attributes":{"id":"7a5e1294f01430e98f0dd2d900a27b50","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Triangle","id":"e8f8a3aea0bc13f15bd4ad13da37f638","attributes":{"id":"e8f8a3aea0bc13f15bd4ad13da37f638","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Triangle","id":"b2b1b3652b79fb8cc65a9b7d6c19d83a","attributes":{"id":"b2b1b3652b79fb8cc65a9b7d6c19d83a","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"d039e612738747a129787814ef56f8ee","attributes":{"id":"d039e612738747a129787814ef56f8ee","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Triangle","id":"e8f8a3aea0bc13f15bd4ad13da37f638"},"hover_glyph":{"type":"Triangle","id":"b2b1b3652b79fb8cc65a9b7d6c19d83a"},"name":null,"data_source":{"type":"ColumnDataSource","id":"f1a4ea6edb8f95b2832083ec6d4c6670"},"glyph":{"type":"Triangle","id":"7a5e1294f01430e98f0dd2d900a27b50"}}},{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce","attributes":{"id":"8fedfab6f21e184f6222f647d2f2a1ce","tags":[],"column_names":["x","y"],"selected":[],"data":{"x":[null,null],"y":[null,null]}}},{"type":"Circle","id":"5a0e69ddd6237592b6f3284edc61b42f","attributes":{"id":"5a0e69ddd6237592b6f3284edc61b42f","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"3c18e466e1f64b52632e84579229f001","attributes":{"id":"3c18e466e1f64b52632e84579229f001","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"70c96ae684712f7d64a188a31a4d8ea4","attributes":{"id":"70c96ae684712f7d64a188a31a4d8ea4","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"6904c41a7e54c0f7051212f6f9c06c21","attributes":{"id":"6904c41a7e54c0f7051212f6f9c06c21","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"3c18e466e1f64b52632e84579229f001"},"hover_glyph":{"type":"Circle","id":"70c96ae684712f7d64a188a31a4d8ea4"},"name":null,"data_source":{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce"},"glyph":{"type":"Circle","id":"5a0e69ddd6237592b6f3284edc61b42f"}}},{"type":"Square","id":"9482c67fdce256c209acf8dddab16db4","attributes":{"id":"9482c67fdce256c209acf8dddab16db4","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#FF7F0E"},"fill_color":{"units":"data","value":"#FF7F0E"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Square","id":"1bef2bdc6e1f91b0e86cc0b45c017306","attributes":{"id":"1bef2bdc6e1f91b0e86cc0b45c017306","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Square","id":"56fb24cd2edad967938bccae7b9d47ef","attributes":{"id":"56fb24cd2edad967938bccae7b9d47ef","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#FF7F0E"},"fill_color":{"units":"data","value":"#FF7F0E"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"af629659bed146652ee3bf7347134167","attributes":{"id":"af629659bed146652ee3bf7347134167","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Square","id":"1bef2bdc6e1f91b0e86cc0b45c017306"},"hover_glyph":{"type":"Square","id":"56fb24cd2edad967938bccae7b9d47ef"},"name":null,"data_source":{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce"},"glyph":{"type":"Square","id":"9482c67fdce256c209acf8dddab16db4"}}},{"type":"Triangle","id":"deb65801ed24478b0dce60ac5ddb785b","attributes":{"id":"deb65801ed24478b0dce60ac5ddb785b","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#2CA02C"},"fill_color":{"units":"data","value":"#2CA02C"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Triangle","id":"b69be5683a1bb93307d1fe948c44bac3","attributes":{"id":"b69be5683a1bb93307d1fe948c44bac3","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Triangle","id":"72108cd9615137434e08f52302f75c88","attributes":{"id":"72108cd9615137434e08f52302f75c88","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#2CA02C"},"fill_color":{"units":"data","value":"#2CA02C"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"051d7b63d7c6e5d9c02f3d486cfc11db","attributes":{"id":"051d7b63d7c6e5d9c02f3d486cfc11db","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Triangle","id":"b69be5683a1bb93307d1fe948c44bac3"},"hover_glyph":{"type":"Triangle","id":"72108cd9615137434e08f52302f75c88"},"name":null,"data_source":{"type":"ColumnDataSource","id":"8fedfab6f21e184f6222f647d2f2a1ce"},"glyph":{"type":"Triangle","id":"deb65801ed24478b0dce60ac5ddb785b"}}},{"type":"Legend","id":"507d53111fdc8f139561edcfed91a2b4","attributes":{"id":"507d53111fdc8f139561edcfed91a2b4","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"legends":[["Species",[]],[" setosa",[{"type":"GlyphRenderer","id":"6904c41a7e54c0f7051212f6f9c06c21"}]],[" versicolor",[{"type":"GlyphRenderer","id":"af629659bed146652ee3bf7347134167"}]],[" virginica",[{"type":"GlyphRenderer","id":"051d7b63d7c6e5d9c02f3d486cfc11db"}]]],"location":"top_right"}},{"type":"Range1d","id":"99c49992c8bbd0c21588a9a755d0e4a2","attributes":{"id":"99c49992c8bbd0c21588a9a755d0e4a2","tags":[],"start":4.048,"end":8.152}},{"type":"Range1d","id":"ef687be57b7af12731a88706f7916454","attributes":{"id":"ef687be57b7af12731a88706f7916454","tags":[],"start":1.832,"end":4.568}},{"type":"LinearAxis","id":"3c36777a5d14b96a2906357b7b08c7c5","attributes":{"id":"3c36777a5d14b96a2906357b7b08c7c5","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"axis_label":"Sepal.Length","formatter":{"type":"BasicTickFormatter","id":"fa721a7b9157bdf213aa1c0b2e187125"},"ticker":{"type":"BasicTicker","id":"38f1d303635c91dfe938db138e6972b7"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"fa721a7b9157bdf213aa1c0b2e187125","attributes":{"id":"fa721a7b9157bdf213aa1c0b2e187125","tags":[]}},{"type":"BasicTicker","id":"38f1d303635c91dfe938db138e6972b7","attributes":{"id":"38f1d303635c91dfe938db138e6972b7","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"67431e627aeeb03fed3ef6604a85ddf5","attributes":{"id":"67431e627aeeb03fed3ef6604a85ddf5","tags":[],"dimension":0,"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"38f1d303635c91dfe938db138e6972b7"}}},{"type":"LinearAxis","id":"9bde1d9c5d65bac86b87ac213a86c430","attributes":{"id":"9bde1d9c5d65bac86b87ac213a86c430","tags":[],"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"axis_label":"Sepal.Width","formatter":{"type":"BasicTickFormatter","id":"70d327d96b4c8aa7a4ae9b6f25653fdc"},"ticker":{"type":"BasicTicker","id":"91b8529771d0b30c396adb5a95ec272e"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"70d327d96b4c8aa7a4ae9b6f25653fdc","attributes":{"id":"70d327d96b4c8aa7a4ae9b6f25653fdc","tags":[]}},{"type":"BasicTicker","id":"91b8529771d0b30c396adb5a95ec272e","attributes":{"id":"91b8529771d0b30c396adb5a95ec272e","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"7aa69cf6de78182ecb1b75a7293de170","attributes":{"id":"7aa69cf6de78182ecb1b75a7293de170","tags":[],"dimension":1,"plot":{"type":"Plot","id":"34c100cf983beb28905a7696d4986ed5","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"91b8529771d0b30c396adb5a95ec272e"}}}]}}},"debug":false},"evals":[],"jsHooks":[]}</script>

Leaflet

Leaflet is a really powerful JavaScript library for creating dynamic maps that support panning and zooming along with various annotations like markers, polygons, and popups.

library(leaflet)
library(ggmap)
geocode("Buffalo, NY", source = "dsk")
##         lon      lat
## 1 -78.88642 42.89606
m <- leaflet() %>% setView(lng = -78.88642, lat = 42.89606, zoom = 12) %>%   addTiles()

<script type="application/json" data-for="htmlwidget-aaa86cd3f0d846d49eaf">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-5.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>

dygraphs

Provides rich facilities for charting time-series data in R, including highly configurable series- and axis-display and interactive features like zoom/pan and series/point highlighting.

library(dygraphs)
dy1=dygraph(nhtemp, main = "New Haven Temperatures",height = 75) %>% 
  dyRangeSelector(dateWindow = c("1920-01-01", "1960-01-01"))

<script type="application/json" data-for="htmlwidget-8932b10be7a797c2d7af">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-7.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>

rthreejs

Create interactive 3D scatter plots, network plots, and globes using the 'three.js' visualization library.

#devtools::install_github("bwlewis/rthreejs")
library(threejs)
z <- seq(-10, 10, 0.1)
x <- cos(z)
y <- sin(z)
js3=scatterplot3js(x, y, z, color=rainbow(length(z)))

<script type="application/json" data-for="htmlwidget-d7c10ee5cdbbdcb30c2c">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-9.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>

networkD3

Creates 'D3' 'JavaScript' network, tree, dendrogram, and Sankey graphs from 'R'.

library(igraph)
library(networkD3)

Load example network

This loads an example social network of friendships between 34 members of a karate club at a US university in the 1970s. See W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977).

karate <- make_graph("Zachary")
wc <- cluster_walktrap(karate)
members <- membership(wc)

# Convert to object suitable for networkD3
karate_d3 <- igraph_to_networkD3(karate, group = members)

n3d=forceNetwork(Links = karate_d3$links, Nodes = karate_d3$nodes,
             Source = 'source', Target = 'target', NodeID = 'name',
             Group = 'group')

Force directed network plot

<script type="application/json" data-for="htmlwidget-8777dfd4fd0f5d6dfa51">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-12.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>

Sankey Network graph

Sankey diagrams are flow diagrams in which the width of the arrows is shown proportionally to the flow quantity.

# Load energy projection data
library(jsonlite)
URL <- paste0(
        "https://cdn.rawgit.com/christophergandrud/networkD3/",
        "master/JSONdata/energy.json")
Energy <- fromJSON(URL)

sn1=sankeyNetwork(Links = Energy$links, Nodes = Energy$nodes, Source = "source",
             Target = "target", Value = "value", NodeID = "name",
             units = "TWh", fontSize = 12, nodeWidth = 30)

<script type="application/json" data-for="htmlwidget-21f742f48177738be446">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-14.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>

Radial Network

URL <- paste0(
        "https://cdn.rawgit.com/christophergandrud/networkD3/",
        "master/JSONdata//flare.json")
## Convert to list format
Flare <- jsonlite::fromJSON(URL, simplifyDataFrame = FALSE)
# Use subset of data for more readable diagram
Flare$children = Flare$children[1:3]

rn1=radialNetwork(List = Flare, fontSize = 10, opacity = 0.9, height = 400, width=400)

frameWidget(rn1,height =500)
<script type="application/json" data-for="htmlwidget-81d66915555c9bfb4c7b">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-16.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>

Diagonal Network

dn1=diagonalNetwork(List = Flare, fontSize = 10, 
                    opacity = 0.9, height = 400, width=400)

frameWidget(dn1,height =500)
<script type="application/json" data-for="htmlwidget-06320bbbb31ef2214e9d">{"x":{"url":"PS_12_files/figure-revealjs//widgets/widget_unnamed-chunk-17.html","options":{"xdomain":"*","allowfullscreen":false,"lazyload":false}},"evals":[],"jsHooks":[]}</script>

Other D3 Visualizations

https://github.com/d3/d3/wiki/Gallery

rglwidget

RGL provides 3D interactive graphics, including functions modelled on base graphics (plot3d(), etc.) as well as functions for constructing representations of geometric objects (cube3d(), etc.). You may need to install XQuartz.

library(rgl)
library(htmltools)

theta <- seq(0, 6*pi, len=100)
xyz <- cbind(sin(theta), cos(theta), theta)
lineid <- plot3d(xyz, type="l", alpha = 1:0, 
                 lwd = 5, col = "blue")["data"]

Animate an interactive 3D process

rg1=browsable(tagList(
  rglwidget(elementId = "example", width = 800, height = 600,
            controllers = "player"),
  playwidget("example", 
             ageControl(births = theta, ages = c(0, 0, 1),
                        objids = lineid, alpha = c(0, 1, 0)),
                        start = 1, stop = 6*pi, step = 0.1, 
                        rate = 6,elementId = "player")
))%>%save_html(file="rgl.html")

<iframe class='embed-responsive-item' src='rgl.html' width=100% height=700px allowfullscreen></iframe>

Final Projects

Interactive elements

Consider embedding interactive elements in your site.