Description Usage Arguments Examples
Creates a HTML widget displaying a shader.
1 |
shader |
the name of the shader, one of |
width, height |
a valid CSS measurement (like |
elementId |
a HTML id for the widget |
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 | library(thorn)
thorn("ikeda") # click on the shader to animate it
thorn("thorn") # you can also use the mouse wheel on this one
# four shaders ####
library(htmltools)
hw1 <- thorn("thorn-color", width = "50vw", height = "50vh")
hw2 <- thorn("ikeda", width = "50vw", height = "50vh")
hw3 <- thorn("sweet", width = "50vw", height = "50vh")
hw4 <- thorn("biomorph3", width = "50vw", height = "50vh")
if(interactive()){
browsable(
withTags(
div(
div(
style = "position:absolute; top:0;",
div(hw1, style="position:fixed; left:0;"),
div(hw2, style="position:fixed; left:50vw;")
),
div(
style = "position:absolute; top:50vh;",
div(hw3, style="position:fixed; left:0;"),
div(hw4, style="position:fixed; left:50vw;")
)
)
)
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.