diff options
author | wout <wout@impinc.co.uk> | 2014-06-17 21:58:24 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-06-17 21:58:24 +0200 |
commit | 838ee6a024215808b7be3ef9534a4a63b42687ec (patch) | |
tree | 7b2b65668b2f117782a79dd551249e0b828dc343 | |
parent | 19c92a5d1f00789528dca1456f4a110153a8437a (diff) | |
download | svg.js-838ee6a024215808b7be3ef9534a4a63b42687ec.tar.gz svg.js-838ee6a024215808b7be3ef9534a4a63b42687ec.zip |
Updated REAMDE
-rwxr-xr-x | README.md | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -725,6 +725,21 @@ __`returns`: `SVG.Use`__ _Javascript inheritance stack: `SVG.Use` < `SVG.Shape` < `SVG.Element`_ +## Symbol +Not unlike the `group` element, the `symbol` element is a container element. The only difference between symbols and groups is that symbols are not rendered. Therefore a `symbol` element is ideal in combination with the `use` element: + + +```javascript +var symbol = draw.symbol() +symbol.rect(100, 100).fill('#f09') + +var use = draw.use(symbol).move(200, 200) +``` + +__`returns`: `SVG.Symbol`__ + +_Javascript inheritance stack: `SVG.Use` < `SVG.Container` < `SVG.Symbol`_ + ## Referencing elements @@ -2409,6 +2424,7 @@ Finally, to get a marker instance from the target element reference: path.reference('marker-end') ``` + ### ref() By default the `refX` and `refY` attributes of a marker are set to respectively half the `width` nd `height` values. To define the `refX` and `refY` of a marker differently: @@ -2416,6 +2432,8 @@ By default the `refX` and `refY` attributes of a marker are set to respectively marker.ref(2, 7) ``` +__`returns`: `itself`__ + ### update() Updating the contents of a marker will `clear()` the existing content and add the content defined in the block passed as the first argument: @@ -2425,6 +2443,8 @@ marker.update(function(add) { }) ``` +__`returns`: `itself`__ + ### width() Defines the `markerWidth` attribute: @@ -2432,6 +2452,8 @@ Defines the `markerWidth` attribute: marker.width(10) ``` +__`returns`: `itself`__ + ### height() Defines the `markerHeight` attribute: @@ -2439,6 +2461,8 @@ Defines the `markerHeight` attribute: marker.height(10) ``` +__`returns`: `itself`__ + ### size() Defines the `markerWidth` and `markerHeight` attributes: @@ -2446,6 +2470,8 @@ Defines the `markerWidth` and `markerHeight` attributes: marker.size(10, 10) ``` +__`returns`: `itself`__ + ## Data |