• Stars
    star
    171
  • Rank 222,266 (Top 5 %)
  • Language
    R
  • License
    Other
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

R htmlwidget to view lists

CRAN_Status_Badge Travis-CI Build Status

listviewer

A package of R htmlwidgets to interactively view and maybe modify lists. As of now, listviewer provides an interface to jsoneditor and react-json-view. listviewer is designed to support multiple interfaces.

install

CRAN

install.packages("listviewer")

Development Version

devtools::install_github("timelyportfolio/listviewer")

jsoneditor

jsoneditor is a really well designed JSON interactive editor by Jos de Jong. Since most R data can be represented in JSON, we can use this great JavaScript library in R.

# using the data from the jsoneditor simple example
#  in R list form

library(listviewer)

jsonedit(
  list(
    array = c(1,2,3)
    ,boolean = TRUE
    ,null = NULL
    ,number = 123
    ,object = list( a="b", c="d" )
    ,string = "Hello World"
  )
)
# also works with data.frames
jsonedit( mtcars )
# helpful interactive view of par
jsonedit( par() )
# meta view of the above
jsonedit(jsonedit(par()))

See the above interactive view of par for yourself.

I got this idea courtesy of @jasonpbecker on Twitter. htmlwidgets dependencies are defined by YAML. Let's see the dependencies for jsonedit.

jsonedit(
  yaml.load_file(system.file("htmlwidgets/jsonedit.yaml",package="listviewer"))
)

How about topojson?

### experiment with topojson
library(httr)
library(pipeR)
library(listviewer)

# topojson for Afghanistan
url_path = "https://gist.githubusercontent.com/markmarkoh/8856417/raw/6178d18115d9f273656d294a867c3f83b739a951/customAfghanMap.topo.json"

url_path %>>% 
  GET %>>%
  content( as = "text") %>>%
  jsonedit

reactjson

react-json-view is another very nice JSON interactive editor. We even get copy/paste! All of the above examples should also work with reactjson.

# using the data from the jsoneditor simple example
#  in R list form

library(listviewer)

reactjson(
  list(
    array = c(1,2,3)
    ,boolean = TRUE
    ,null = NULL
    ,number = 123
    ,object = list( a="b", c="d" )
    ,string = "Hello World"
  )
)

Shiny example

listviewer works with Shiny but the implementation is crude and likely to change for jsonedit while reactjson integration is much better. If you really want to use jsonedit with Shiny, I would recommend debouncing the change callback. Here are examples with each.

library(shiny)
library(listviewer)

# put some data in environment so it will show up
data(mtcars)

ui <- shinyUI(
  fluidPage(
    jsoneditOutput( "jsed" )
  )
)

server <- function(input,output){
  output$jsed <- renderJsonedit({
    jsonedit(
      as.list( .GlobalEnv )
      ,"change" = htmlwidgets::JS('function(){
        console.log( event.currentTarget.parentNode.editor.get() )
      }')
    )
    
  })
}

runApp( list( ui = ui, server = server ) )
library(shiny)
library(listviewer)

# put some data in environment so it will show up
data(mtcars)

ui <- shinyUI(
  fluidPage(
    reactjsonOutput( "rjed" )
  )
)

server <- function(input,output){
  output$rjed <- renderReactjson({
    reactjson( as.list( .GlobalEnv ) )
  })
  
  observeEvent(input$rjed_edit, {
    str(input$rjed_edit, max.level=2)
  })
}

runApp( list( ui = ui, server = server ) )

code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

More Repositories

1

sunburstR

R htmlwidget for interactive sunburst plots
JavaScript
210
star
2

d3r

d3.js helpers for R
R
152
star
3

rCharts_time_series

Quick Summary of R's History of Time Series Charting
JavaScript
76
star
4

parcoords

R htmlwidget for parallel-coordinates chart
JavaScript
76
star
5

dataui

data-ui for R
R
65
star
6

buildingwidgets

repo for a htmlwidget a week documented at http://buildingwidgets.com
HTML
62
star
7

leaftime

Leaflet.timeline for R leaflet
R
58
star
8

rCharts_d3_sankey

rCharts implementation of d3 sankey plugin
JavaScript
54
star
9

rCharts_nyt_home_price

JavaScript
46
star
10

svgPanZoom

R htmlwidget for svg-pan-zoom.js | if you plot it, it will zoom
R
44
star
11

explodingboxplotR

d3.js exploding boxplots for R as an htmlwidget
HTML
37
star
12

shiny-d3-plot

experiments with d3 and r integration with shiny
36
star
13

shiny-d3-showreel

adapt the d3 showreel example to get data from R
R
32
star
14

rCharts_dimple

JavaScript
31
star
15

rcdimple

htmlwidgets for rCharts + dimple
R
28
star
16

timelineR

R htmlwidget for interactive d3.js timelines using d3.layout.timeline
R
26
star
17

parsetR

R htmlwidget for d3-parsets from Jason Davies
HTML
25
star
18

mapshaper_htmlwidget

R htmlwidget for mapshaper
JavaScript
24
star
19

rCharts_512paths

CSS
23
star
20

react_tutorial_in_R

use htmltools in R to do the Facebook React Tutorial
R
22
star
21

sweetalertR

R htmlwidget for sweetalert by @t4t5
HTML
21
star
22

excalidrawr

Excalidraw for R
R
20
star
23

treebar

R htmlwidget for Chris Given Zoomable Treemap Bar
R
20
star
24

d3vennR

R htmlwidget for d3.js venn diagrams from Ben Frederickson (@benfred)
R
20
star
25

rCharts_crossfilter_dcjs

JavaScript
19
star
26

googlefontR

R helpers for using Google Fonts
R
18
star
27

katexR

bring the power of KaTeX to R with htmlwidgets
HTML
17
star
28

gifrecordeR

R htmlwidget to record animated gifs client side
JavaScript
17
star
29

rCharts_factor_analytics

JavaScript
16
star
30

comicR

htmlwidgets for comic (xkcd-like) R
JavaScript
16
star
31

exportwidget

R htmlwidget to export other htmlwidgets and SVG as png
JavaScript
16
star
32

eventdropR

EventDrops d3.js timeline as R htmlwidget
R
15
star
33

radialNetworkR

R htmlwidget for Interactive (Searchable, Zoomable, Collapsible) d3 radial network
HTML
14
star
34

loryR

lory slider htmlwidget
R
13
star
35

shiny-d3-scatterplot

JavaScript
13
star
36

tooltipsterR

R htmlwidget for tooltipster
CSS
13
star
37

vegaliteR

vega-lite htmlwidget for R
JavaScript
12
star
38

nebular

nebula.gl experiment for R
JavaScript
12
star
39

rparticle

react-particle-image in R
JavaScript
12
star
40

rd3fc

d3fc financial components for R
R
11
star
41

TSclust_experiments

experiments with the R package TSclust
JavaScript
11
star
42

sankeytree

JavaScript
9
star
43

rCharts_d3_horizon

CSS
9
star
44

shiny-d3-calendar

JavaScript
9
star
45

d3hiveR

R htmlwidget for d3-hive
R
9
star
46

pandoclatextemplate

Rmarkdown Template using pandoc-latex-template
TeX
8
star
47

shiny-d3-pdf

R
8
star
48

gridSVG_intro

8
star
49

navr

R htmlwidget for responsive-nav.js
CSS
8
star
50

shiny-d3-accordion-portfolio

JavaScript
7
star
51

remiotic

Semiotic by @emeeks for R
HTML
7
star
52

vue-cli-r

Vue
7
star
53

functionplotR

R htmlwidget for function-plot d3.js library
R
7
star
54

materializeR

R htmlwidget for materialize framework
HTML
7
star
55

hopscotchr

hopscotch tours for R & Shiny
R
6
star
56

shiny-grid-svg

R
6
star
57

imageR

intense-images htmlwidget for R
JavaScript
6
star
58

e2d3R

e2d3 in R
JavaScript
6
star
59

quarto_tests

place to play with Quarto
5
star
60

rCharts_basketball

rough prototype of d3/rCharts basketball court plot
JavaScript
5
star
61

vite-vue-r

vite vue3 and shiny
Vue
5
star
62

pickingthetop

realtime account (maybe a book) of my inane efforts to make money by picking a top
5
star
63

shotsignR

Peter Beshai's d3 shooting signatures for R
R
5
star
64

trailr

D3-trail htmlwidget for R
JavaScript
4
star
65

react_bham_lunch_learn_reactR

talk on R + JavaScript introducting reactR
JavaScript
4
star
66

jsinr.me

posts on JavaScript and R
JavaScript
4
star
67

rCharts_techan

integrate rCharts and techan.js
R
4
star
68

stockchartR

react-stockcharts as a R htmlwidget
JavaScript
4
star
69

rCharts_rpart

experiments with making R rpart interactive with rCharts, d3.js
HTML
4
star
70

rCharts_rickshaw_gettingstarted

JavaScript
4
star
71

plotcon2016

Power of Combination for PlotCon2016
HTML
4
star
72

vue-vega

vue and vega - experimental for now
JavaScript
4
star
73

gicstree_shinylive

shiny live version of GICS tree from https://www.jsinr.me/2023/09/25/gics-tree/
R
3
star
74

slides_mlbham

Slides (rmd) for Machine Learning in Finance and R
3
star
75

rCharts_dygraphs

all development has moved to https://github.com/danielkrizian/rChartsDygraphs/
JavaScript
3
star
76

rCharts_morris_standalone

R
3
star
77

coursera_reactive_programming

course materials for Principles of Reactive Programming
3
star
78

dary

Quanteda Dictionary Tools in R
R
3
star
79

rCharts_colors

rChart+javascript color libraries
JavaScript
3
star
80

shiny-websockets

experiments with shiny at the core and with react
R
3
star
81

rCharts_chord

R
3
star
82

svelte-jsoneditor-standalone

Jos de Jong's New svelte-jsoneditor as classic standalone for R listviewer
HTML
3
star
83

rCharts_errorbar

JavaScript
3
star
84

rCharts_Rflickr

JavaScript
3
star
85

railroadR

Railroad Diagrams for R
JavaScript
3
star
86

clickme_multiline

multiline ractive for clickme
R
3
star
87

rCharts_d3_cpi

CSS
3
star
88

oplot

experimental R htmlwidgets wrapper for Observable Plot
R
3
star
89

plugin-ggvis

first attempt at a plugin for @rstudio ggvis in a @gitbookio gitbook
JavaScript
3
star
90

flattree

convert flat table tree to d3 hierarchy
R
3
star
91

d3hierR

d3 hierarchichal layouts in R starting with treemap
JavaScript
2
star
92

rCharts_cartogram

JavaScript
2
star
93

tlh

R
2
star
94

r_css_shapes

experiment with css shapes in R + htmltools
R
2
star
95

valtio_standalone

valtio vanilla with utils as standalone using browserify
R
2
star
96

tester

demo of reactR shiny input with children
JavaScript
2
star
97

r_seaborn

code to port seaborn aesthetics to R
R
2
star
98

rCharts_vega

JavaScript
2
star
99

gridSVG_d3_line

2
star
100

rNotebook_html5slides

JavaScript
2
star