d3_dep_jetpack | R Documentation |
d3-jetpack is a set of nifty convenience wrappers that speed up
your daily work with d3.js. Must be included after d3_dep_v4()
.
Learn more by reading d3-jetpack
or by watching this YouTube.
d3_dep_jetpack(offline = TRUE)
offline |
|
htmltools::htmlDependency
Other 'd3' dependency functions:
d3_dep_v3()
,
d3_dep_v4()
,
d3_dep_v5()
,
d3_dep_v6()
,
d3_dep_v7()
## Not run:
library(d3r)
library(htmltools)
tl <- tagList(tags$script(HTML(sprintf(
"
var x = 5;
var svg = d3.select('body')
.append('svg');
svg.append('rect')
.at({
x: 100,
y: 100,
width: 100,
height: 100
})
.st({
fill: 'blue',
stroke: 'purple'
});
"
))), d3_dep_v4(), d3_dep_jetpack())
browsable(tl)
tl <- tagList(tags$script(HTML(sprintf(
"
var svg = d3.select('body')
.append('svg');
test_data = [{x: 250, y: 250}, {x: 300, y: 300}, {x: 300, y: 100}];
svg.appendMany(test_data, 'circle')
.at({
cx: function(d){return d.x},
cy: function(d){return d.y},
r: 50
})
.st({
fill: 'purple',
stroke: 'blue'
});
"
))), d3_dep_v4(), d3_dep_jetpack())
browsable(tl)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.