Description Usage Arguments Value Author(s) References See Also
This function arranges to add an interactive slider to the SVG graphic
described in doc
. The slider is implemented via the Carto.net
SVG and ECMAScript/ECMAScript library. This function endeavors to do
most of the generic setup within the SVG document to be able to use
the slider.
The creator of the SVG document with the slider must ensure that there
is enough space to display the slider (using
enlargeSVGViewBox
, for example). But often, this
function provides the necessary functionality to get the slider into
the document and SVG display and functional as most of the work is in
the JavaScript.
1 2 3 4 5 6 |
doc |
the parsed XML/SVG document into which the relevant nodes will be inserted |
onload |
a JavaScript command which is invoked when the SVG document is loaded. This is expected to create the slider object. |
javascript |
any JavaScript code that is needed to support the |
id |
an identifying string/name for the slider. This should be unique within the SVG document. |
svg |
the SVG root node of the XML document. This can be specified to allow a caller who has already accessed this for other purposes to provide it so the function doesn't have to do the small amount of work to retrieve it. |
defaultJavascripts |
the names of the JavaScript code files that
should also be included to make the slider function. These are
passed to |
side |
where to place the slider |
... |
name = value pairs of JavaScript variable names and R
objects that are also added to the JavaScript code. See |
The updated XML document, returned invisibly.
Duncan Temple Lang
http://www.carto.net/papers/svg
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.