| lt_spec | R Documentation |
Return the JSON-ready spec for an lt() table: the raw data plus the
declarative ops (and any lt_interactive() options), prepared exactly as the
JavaScript runtime expects. This is the payload the runtime consumes, so
another widget can embed an lt table by shipping this spec (e.g.
xfun::tojson(lt_spec(x))) and rendering it client-side on demand with
LT.render(container, spec) (or LT.buildHtml(spec)). Styling from
lt_css() and CSS rules is dropped; attach the runtime assets separately
(see lt_dependency()).
lt_spec(x)
x |
An |
A named list of spec fields (data, ops, and any others set on the
table), ready to serialize to JSON.
spec = lt_spec(lt(head(mtcars)) |> lt_interactive())
str(spec, max.level = 1)
xfun::tojson(spec) # ship this, then LT.render(container, spec) in the browser
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.