File: script.rst

package info (click to toggle)
svgwrite 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,304 kB
  • sloc: python: 12,524; makefile: 116; sh: 5
file content (58 lines) | stat: -rw-r--r-- 1,918 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Script
======

The *script* element indicate links to a client-side language.

.. autoclass:: svgwrite.container.Script

.. seealso:: http://www.w3.org/TR/SVG/script.html

.. automethod:: svgwrite.container.Script.__init__

.. automethod:: svgwrite.container.Script.append

Best place for the *script* element is the *defs* attribute of the
:class:`~svgwrite.drawing.Drawing` class::

    drawing.defs.add(drawing.script('script-content'))

Parent Classes
--------------

* :class:`svgwrite.base.BaseElement`

SVG Attributes
--------------

* **type** -- `string`

  Identifies the scripting language for the given *script* element. The value
  content-type specifies a media type, per MIME. If a *type* is not provided,
  the value of **contentScriptType** on the **svg** element shall be used,
  which in turn defaults to ``'application/ecmascript'``. If a *script* element
  falls outside of the outermost svg element and the *type* is not provided,
  the *type* must default to ``'application/ecmascript'``

* **externalResourcesRequired** -- `bool`

  *False*: if document rendering can proceed even if external resources are
  unavailable else: *True*

* **xlink:href** -- `string` -- **href** parameter

* **xlink:show** -- ``'new|replace'``

* **xlink:acuate** -- ``'onRequest'``

  This attribute provides documentation to XLink-aware processors that an
  application should traverse from the starting resource to the ending
  resource only on a post-loading event triggered for the purpose of traversal.

Standard SVG Attributes
-----------------------

* :doc:`Core Attributes </attributes/core>`
* :doc:`Conditional Processing Attributes </attributes/conditional_processing>`
* :doc:`Graphical Event Attributes </attributes/graphical_event>`
* :doc:`Presentation Attributes </attributes/presentation>`
* :doc:`XLink Attributes </attributes/xlink>`