From 838ee6a024215808b7be3ef9534a4a63b42687ec Mon Sep 17 00:00:00 2001 From: wout Date: Tue, 17 Jun 2014 21:58:24 +0200 Subject: Updated REAMDE --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 438d2d8..a6546c7 100755 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3