From 96e89e0f7b97bc4b2cae120779859c8fb4a5f252 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 11:50:34 -0400 Subject: [PATCH 01/68] ignore emacs & _-prefixed scrap files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de40c71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +TAGS +*~ +_* From 136b6fae7b62fa49770c3fbff655834e25603a9b Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 12:43:17 -0400 Subject: [PATCH 02/68] COMMENTS for Snap.angle, Snap.Matrix, Snap.animate --- src/svg.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/svg.js b/src/svg.js index 743108e..e0f5bf4 100644 --- a/src/svg.js +++ b/src/svg.js @@ -288,6 +288,7 @@ Snap.rad = rad; = (number) angle in degrees. \*/ Snap.deg = deg; +// SIERRA for which point is the angle calculated? /*\ * Snap.angle [ method ] @@ -591,6 +592,7 @@ function Matrix(a, b, c, d, e, f) { } }; })(Matrix.prototype); +// SIERRA Unclear the difference between the two matrix formats ("parameters" vs svgMatrix). See my comment about Element.matrix(). /*\ * Snap.Matrix [ method ] @@ -2045,6 +2047,9 @@ function arrayFirstValue(arr) { } return res; }; + // SIERRA unfamiliar with the phrase _caring function,_ so the text for the _setter_ param isn't clear. + // SIERRA With the animation's start/end states defined, how is its _speed_ distinguished from its _duration_? + // SIERRA Text explaining the mina format should move to the section on the mina object interface. (Prior comment applies: object interfaces need to also be documented.) /*\ * Snap.animate [ method ] From b9db9c6301b924c41e13931158d9afdf5c5a6897 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 12:46:54 -0400 Subject: [PATCH 03/68] 'ms' arg => 'duration' --- src/svg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg.js b/src/svg.js index e0f5bf4..f0f461e 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2006,7 +2006,7 @@ function arrayFirstValue(arr) { * Creates animation object. ** - attr (object) attributes of final destination - - ms (number) animation duration + - duration (number) duration of the animation, in milliseconds - easing (function) #optional one of easing functions of @mina or custom one - callback (function) #optional callback = (object) animation object @@ -2059,7 +2059,7 @@ function arrayFirstValue(arr) { - from (number|array) number or array of numbers - to (number|array) number or array of numbers - setter (function) caring function that will take one number argument - - ms (number) duration + - duration (number) duration, in milliseconds - easing (function) #optional easing function from @mina or custom - callback (function) #optional = (object) animation object in @mina format @@ -2104,7 +2104,7 @@ function arrayFirstValue(arr) { * Animate given attributes of the element. ** - attrs (object) key-value pairs of destination attributes - - ms (number) duration + - duration (number) duration of the animation, in milliseconds - easing (function) #optional easing function from @mina or custom - callback (function) #optional = (Element) the element From b72783a656319da64e8871ba4b382f7f19e1707c Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 12:52:56 -0400 Subject: [PATCH 04/68] VERIFY: when does animation callback fire? --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index f0f461e..9b3dc08 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2061,7 +2061,7 @@ function arrayFirstValue(arr) { - setter (function) caring function that will take one number argument - duration (number) duration, in milliseconds - easing (function) #optional easing function from @mina or custom - - callback (function) #optional + - callback (function) #optional callback function to execute when animation ends VERIFY = (object) animation object in @mina format o { o id (string) animation id, consider it read-only, From ec688519b94ebee1328f2f66e67a36948cc25987 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 12:57:47 -0400 Subject: [PATCH 05/68] VERIFY: callback executes when animation ends? --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 9b3dc08..a635cb1 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2008,7 +2008,7 @@ function arrayFirstValue(arr) { - attr (object) attributes of final destination - duration (number) duration of the animation, in milliseconds - easing (function) #optional one of easing functions of @mina or custom one - - callback (function) #optional callback + - callback (function) #optional callback function that fires when animation ends VERIFY = (object) animation object \*/ Snap.animation = function (attr, ms, easing, callback) { From 4da7e39032948ec5138819aea9d9848c41fe14c8 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:00:01 -0400 Subject: [PATCH 06/68] COMMENT Snap.animate() --- src/svg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg.js b/src/svg.js index a635cb1..79cdb9c 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2050,6 +2050,7 @@ function arrayFirstValue(arr) { // SIERRA unfamiliar with the phrase _caring function,_ so the text for the _setter_ param isn't clear. // SIERRA With the animation's start/end states defined, how is its _speed_ distinguished from its _duration_? // SIERRA Text explaining the mina format should move to the section on the mina object interface. (Prior comment applies: object interfaces need to also be documented.) + // SIERRA unclear how to express a custom _easing_ (+) /*\ * Snap.animate [ method ] From b83d74330bf949b0b729fd1634a090a55a806ec2 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:10:39 -0400 Subject: [PATCH 07/68] Snap.color --- src/svg.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/svg.js b/src/svg.js index 79cdb9c..d3e41c1 100644 --- a/src/svg.js +++ b/src/svg.js @@ -636,13 +636,13 @@ Snap.Matrix = Matrix; #
  • hsla(•••%, •••%, •••%, •••%) — also with opacity
  • # * Note that `%` can be used any time: `rgb(20%, 255, 50%)`. - = (object) RGB object in format: + = (object) RGB object in the following format: o { o r (number) red, o g (number) green, o b (number) blue o hex (string) color in HTML/CSS format: #••••••, - o error (boolean) true if string cant be parsed + o error (boolean) true if string can't be parsed o } \*/ Snap.getRGB = cacher(function (colour) { @@ -826,20 +826,20 @@ packageRGB = function (r, g, b, o) { is(o, "finite") && (rgb.opacity = o); return rgb; }; - +// SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g., can you specify a semi-transparent value for Snap.filter.shadow()? /*\ * Snap.color [ method ] ** - * Parses the color string and returns object with all values for the given color. + * Parses the color string and returns an object featuring the color's component values. - clr (string) color string in one of the supported formats (see @Snap.getRGB) - = (object) Combined RGB & HSB object in format: + = (object) Combined RGB & HSB object in the following format: o { o r (number) red, o g (number) green, o b (number) blue, o hex (string) color in HTML/CSS format: #••••••, - o error (boolean) `true` if string cant be parsed, + o error (boolean) `true` if string can't be parsed, o h (number) hue, o s (number) saturation, o v (number) value (brightness), @@ -890,7 +890,7 @@ Snap.color = function (clr) { - h (number) hue - s (number) saturation - v (number) value or brightness - = (object) RGB object in format: + = (object) RGB object in the following format: o { o r (number) red, o g (number) green, @@ -926,7 +926,7 @@ Snap.hsb2rgb = function (h, s, v, o) { - h (number) hue - s (number) saturation - l (number) luminosity - = (object) RGB object in format: + = (object) RGB object in the following format: o { o r (number) red, o g (number) green, @@ -966,7 +966,7 @@ Snap.hsl2rgb = function (h, s, l, o) { - r (number) red - g (number) green - b (number) blue - = (object) HSB object in format: + = (object) HSB object in the following format: o { o h (number) hue o s (number) saturation @@ -999,7 +999,7 @@ Snap.rgb2hsb = function (r, g, b) { - r (number) red - g (number) green - b (number) blue - = (object) HSL object in format: + = (object) HSL object in the following format: o { o h (number) hue o s (number) saturation @@ -1999,6 +1999,7 @@ function arrayFirstValue(arr) { easing && (this.easing = easing); callback && (this.callback = callback); }; + // SIERRA All object methods should feature sample code. This is just one instance. /*\ * Snap.animation [ method ] From 580cecc1adcd6d441caa4e1fbe005fd4f236816c Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:11:49 -0400 Subject: [PATCH 08/68] edit Snap.deg --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index d3e41c1..659268b 100644 --- a/src/svg.js +++ b/src/svg.js @@ -284,7 +284,7 @@ Snap.rad = rad; [ method ] ** * Transform angle to degrees - - deg (number) angle in radians + - rad (number) angle in radians = (number) angle in degrees. \*/ Snap.deg = deg; From 108e1b03e9fa3989333780483faa0791436d9ced Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:18:07 -0400 Subject: [PATCH 09/68] COMMENT Snap.filter.* --- src/filter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filter.js b/src/filter.js index b85e092..7e5db64 100644 --- a/src/filter.js +++ b/src/filter.js @@ -81,7 +81,8 @@ Snap.plugin(function (Snap, Element, Paper, glob) { this.node.removeAttribute("filter"); } }); - + // SIERRA Would help to clarify when various Snap.filter.* matches the behavior of CSS filter property keyword functions. E.g., I don't think CSS's blur() accepts a second parameter for y axis. + // SIERRA Would also be useful to illustrate a chain of >1 filter as a code snippet. /*\ * Snap.filter.blur [ method ] From 2961192d832dc718fef1b2817f24731715b6b4d0 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:19:04 -0400 Subject: [PATCH 10/68] COMMENT Snap.fragment --- src/svg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg.js b/src/svg.js index 659268b..46f1b5e 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2307,6 +2307,7 @@ Fragment.prototype.select = Element.prototype.select; * See @Element.selectAll \*/ Fragment.prototype.selectAll = Element.prototype.selectAll; +// SIERRA Snap.fragment() could especially use a code example /*\ * Snap.fragment [ method ] From 16f10bb5664d9e2e21375781d24e0d74a58fac76 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:20:49 -0400 Subject: [PATCH 11/68] EDIT Snap.getRGB --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 46f1b5e..2a264d3 100644 --- a/src/svg.js +++ b/src/svg.js @@ -617,7 +617,7 @@ Snap.Matrix = Matrix; [ method ] ** * Parses colour string as RGB object - - colour (string) colour string in one of formats: + - colour (string) colour string in one of the following formats: #
      #
    • Colour name (“red”, “green”, “cornflowerblue”, etc)
    • #
    • #••• — shortened HTML colour: (“#000”, “#fc0”, etc)
    • From 2c8b512a985c5e54417afe4d9c9a3ff2ef101270 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:24:38 -0400 Subject: [PATCH 12/68] COMMENTS Snap.parse Snap.hsb, others --- src/svg.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/svg.js b/src/svg.js index 2a264d3..2d15f38 100644 --- a/src/svg.js +++ b/src/svg.js @@ -723,6 +723,7 @@ Snap.getRGB = cacher(function (colour) { } return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString}; }, Snap); +// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others. /*\ * Snap.hsb [ method ] @@ -2259,6 +2260,7 @@ function arrayFirstValue(arr) { }; } }(Element.prototype)); +// SIERRA Snap.parse() accepts & returns a fragment, but there's no info on what it does in between. What if it doesn't parse? /*\ * Snap.parse [ method ] From 8ddfad5fbfb88ebae4b27bc75c58b298350dcbb4 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:26:54 -0400 Subject: [PATCH 13/68] COMMENT Snap.parsePathString --- src/svg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg.js b/src/svg.js index 2d15f38..a853f9a 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1030,6 +1030,7 @@ Snap.rgb2hsl = function (r, g, b) { }; // Transformations +# SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured? /*\ * Snap.parsePathString [ method ] From 4b7a41aa9730d0293630edcc523d7b794657ab2d Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:31:55 -0400 Subject: [PATCH 14/68] EDIT & COMMENT Snap.parseTransformString --- src/svg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index a853f9a..b0df93e 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1084,13 +1084,14 @@ Snap.parsePathString = function (pathString) { pth.arr = Snap.path.clone(data); return data; }; +// SIERRA Snap.parseTransformString(): I don't understand the string format. /*\ * Snap.parseTransformString [ method ] ** * Utility method ** - * Parses given path string into an array of transformations. + * Parses given transform string into an array of transformations. - TString (string|array) transform string or array of transformations (in the last case it will be returned straight away) = (array) array of transformations. \*/ From 7c42bf70aed5cd294ab6fc6c8e5491adbbf9f886 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:37:51 -0400 Subject: [PATCH 15/68] EDIT Snap.snapTo --- src/path.js | 1 + src/svg.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/path.js b/src/path.js index a5f0073..d9e486a 100644 --- a/src/path.js +++ b/src/path.js @@ -1254,6 +1254,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { \*/ Snap.path.intersection = pathIntersection; Snap.path.intersectionNumber = pathIntersectionNumber; + // SIERRA Does the fill mode affect how isPointInside behaves? /*\ * Snap.path.isPointInside [ method ] diff --git a/src/svg.js b/src/svg.js index b0df93e..921edcd 100644 --- a/src/svg.js +++ b/src/svg.js @@ -321,7 +321,7 @@ Snap.is = is; * Snaps given value to given grid. - values (array|number) given array of values or step of the grid - value (number) value to adjust - - tolerance (number) #optional tolerance for snapping. Default is `10`. + - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`. VERIFY = (number) adjusted value. \*/ Snap.snapTo = function (values, value, tolerance) { From 96ea9f1d5f8c1cf35a666e8eca0468a0ca540342 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:39:12 -0400 Subject: [PATCH 16/68] EDIT Set.clear --- src/set.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/set.js b/src/set.js index 62a5d2a..1042c51 100644 --- a/src/set.js +++ b/src/set.js @@ -91,7 +91,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Set.clear [ method ] ** - * Removeds all elements from the set + * Removes all elements from the set \*/ setproto.clear = function () { while (this.length) { From 046e146522fb63d097589cb2bb8ef2bb36f29c15 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:40:23 -0400 Subject: [PATCH 17/68] COMMENT mina --- src/mina.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mina.js b/src/mina.js index 87481af..7c9a228 100644 --- a/src/mina.js +++ b/src/mina.js @@ -122,6 +122,7 @@ var mina = (function (eve) { } len && requestAnimFrame(frame); }, + // SIERRA Unfamiliar with the word _slave_ in this context. Also, I don't know what _gereal_ means. Do you mean _general_? /*\ * mina [ method ] From c714b1f1ee62d62ef2c2227b32939a1eb05e2557 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:43:10 -0400 Subject: [PATCH 18/68] EDIT mina.getById; flush curly quotes from doc --- src/mina.js | 4 ++-- src/svg.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mina.js b/src/mina.js index 7c9a228..1d35b50 100644 --- a/src/mina.js +++ b/src/mina.js @@ -198,8 +198,8 @@ var mina = (function (eve) { * mina.getById [ method ] ** - * Returns animation by it’s id. - - id (string) animation’s id + * Returns animation by its id. + - id (string) animation's id = (object) See @mina \*/ mina.getById = function (id) { diff --git a/src/svg.js b/src/svg.js index 921edcd..102b4cb 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2395,7 +2395,7 @@ function wrap(dom) { } return new Element(dom); } -// gradients’ helpers +// gradients' helpers function Gstops() { return this.selectAll("stop"); } From eb9bbee71b14b2ec6509b2048efda078e6fa993f Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:50:49 -0400 Subject: [PATCH 19/68] COMMENT Element.toString --- src/svg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg.js b/src/svg.js index 102b4cb..7847657 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2218,6 +2218,7 @@ function arrayFirstValue(arr) { } return this; }; + // SIERRA Element.toString(): Recommend renaming this _outerSVG_ to keep it consistent with HTML & innerSVG, and also to avoid confusing it with what textContent() does. Cross-reference with innerSVG. /*\ * Element.toString [ method ] From aec4e73c991e234626f7cbe47c3428e4bb11f896 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 13:53:12 -0400 Subject: [PATCH 20/68] EDIT and COMMENT Element.data --- src/svg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 7847657..0b58251 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2163,11 +2163,12 @@ function arrayFirstValue(arr) { return el; }; var eldata = {}; + // SIERRA Element.data()/Element.removeData(): Do these correspond to _data- attributes, and if so, can you ordinarily use the the dataset API within SVG? /*\ * Element.data [ method ] ** - * Adds or retrieves given value asociated with given key. + * Adds or retrieves given value associated with given key. ** * See also @Element.removeData - key (string) key to store data From 624f565bcf1455a4bf4a4439b1307a38a3af7520 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:11:28 -0400 Subject: [PATCH 21/68] EDIT: accented bezier --- src/path.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/path.js b/src/path.js index d9e486a..2fda342 100644 --- a/src/path.js +++ b/src/path.js @@ -1140,7 +1140,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Find dot coordinates on the given cubic bezier curve at the given t. + * Find dot coordinates on the given cubic beziér curve at the given t. - p1x (number) x of the first point of the curve - p1y (number) y of the first point of the curve - c1x (number) x of the first anchor of the curve @@ -1180,7 +1180,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Return bounding box of a given cubic bezier curve + * Return bounding box of a given cubic beziér curve - p1x (number) x of the first point of the curve - p1y (number) y of the first point of the curve - c1x (number) x of the first anchor of the curve @@ -1190,7 +1190,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { - p2x (number) x of the second point of the curve - p2y (number) y of the second point of the curve * or - - bez (array) array of six points for bezier curve + - bez (array) array of six points for beziér curve = (object) point information in format: o { o min: { @@ -1316,7 +1316,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Converts path to a new path where all segments are cubic bezier curves. + * Converts path to a new path where all segments are cubic beziér curves. - pathString (string|array) path string or array of segments = (array) array of segments. \*/ From 46516a063444da8766beca329cf9095d01905820 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:17:27 -0400 Subject: [PATCH 22/68] EDIT Paper.path --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 0b58251..13c8868 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2694,7 +2694,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - pathString (string) #optional path string in SVG format. * Path string consists of one-letter commands, followed by comma seprarated arguments in numercal form. Example: | "M10,20L30,40" - * Here we can see two commands: “M”, with arguments `(10, 20)` and “L” with arguments `(30, 40)`. Upper case letter mean command is absolute, lower case—relative. + * This example features two commands: “M”, with arguments `(10, 20)` and “L” with arguments `(30, 40)`. Uppercase commands indicate absolute coordinates. Lowercase commands position relative to the previous coordinates. * #

      Here is short list of commands available, for more details see SVG path string format or article about path strings at MDN.

      # From 25f9e7b1d8c5c8ffc87df5665cbcb2f255e4cf69 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:22:14 -0400 Subject: [PATCH 23/68] EDIT Element.select, Element.selectAll --- src/svg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/svg.js b/src/svg.js index 13c8868..3cb0ce2 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1732,7 +1732,7 @@ function arrayFirstValue(arr) { * Element.select [ method ] ** - * Applies CSS selector with the element as a parent and returns the result as an @Element. + * Gathers nested @Element matching the given set of CSS selectors. ** - query (string) CSS selector = (Element) result of query selection @@ -1744,7 +1744,7 @@ function arrayFirstValue(arr) { * Element.selectAll [ method ] ** - * Applies CSS selector with the element as a parent and returns the result as a set or array of elements. + * Gathers nested @Element objects matching the given set of CSS selectors. ** - query (string) CSS selector = (Set|array) result of query selection From e6de34eec782c691cae721ba7b0600c612e3b963 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:24:54 -0400 Subject: [PATCH 24/68] EDIT & COMMENT Element.toDefs --- src/svg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 3cb0ce2..7f36af5 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1881,11 +1881,12 @@ function arrayFirstValue(arr) { clone.insertAfter(this); return clone; }; +// SIERRA Element.toDefs(): If this _moves_ an element to the region, why is the return value a _clone_? Also unclear why it's called the _relative_ section. Perhaps _shared_? /*\ * Element.toDefs [ method ] ** - * Moves element to the relative `` section. + * Moves element to the shared `` area. ** = (Element) the clone \*/ From 78bc067beba2734cea1c21e04b8b5608758afec3 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:30:48 -0400 Subject: [PATCH 25/68] EDIT & COMMENT Element.attr --- src/svg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 7f36af5..eed1029 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1446,13 +1446,14 @@ function arrayFirstValue(arr) { } } (function (elproto) { + // SIERRA Element.attr(): There appear to be two possible return values, one of which is blank. (Search the doc for _Returns:_ to identify problems.) /*\ * Element.attr [ method ] ** * Gets or sets given attributes of the element ** - - params (object) key-value pairs of attributes you want to set + - params (object) contains key-value pairs of attributes you want to set * or - param (string) name of the attribute = (Element) @@ -1773,6 +1774,7 @@ function arrayFirstValue(arr) { } return unit2px(this, attr, value); }; + // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned instantiates. It's a part of SVG with which ordinary web developers may be least familiar. /*\ * Element.use [ method ] From b550dc698bd79c3ed5d844dd641fcc31d575d0ca Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:32:40 -0400 Subject: [PATCH 26/68] COMMENT Element.stop --- src/svg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg.js b/src/svg.js index eed1029..ac638d5 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2090,6 +2090,7 @@ function arrayFirstValue(arr) { callback && eve.once("mina.finish." + anim.id, callback); return anim; }; + // SIERRA Element.stop(). Does it _stop_ or _pause_ the animations? If you run Element.animate() to restart the animation, does it commence from the beginning? /*\ * Element.stop [ method ] From 84adcea242aaeb8c4ebab8b090886ccf0a125b12 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:34:05 -0400 Subject: [PATCH 27/68] EDIT Element.inAnim --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index ac638d5..5727de4 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2025,7 +2025,7 @@ function arrayFirstValue(arr) { * Element.inAnim [ method ] ** - * Returns an array of animations element currently in + * Returns a set of animations that may be able to manipulate the current element VERIFY ** = (object) in format o { From 4937f457ba873eccbac90a79c8e377dbc997ebcc Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:38:32 -0400 Subject: [PATCH 28/68] EDIT & COMMENT Element.animate --- src/svg.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/svg.js b/src/svg.js index 5727de4..57a7ebd 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2106,6 +2106,8 @@ function arrayFirstValue(arr) { } return this; }; + // SIERRA Element.animate(): For _attrs_, clarify if they represent the destination values, and if the animation executes relative to the element's current attribute values. + // SIERRA would a _custom_ animation function be an SVG keySplines value? /*\ * Element.animate [ method ] @@ -2113,9 +2115,9 @@ function arrayFirstValue(arr) { * Animate given attributes of the element. ** - attrs (object) key-value pairs of destination attributes - - duration (number) duration of the animation, in milliseconds + - duration (number) duration of the animation in milliseconds - easing (function) #optional easing function from @mina or custom - - callback (function) #optional + - callback (function) #optional callback function that executes when the animation ends VERIFY = (Element) the element \*/ elproto.animate = function (attrs, ms, easing, callback) { From e502789d7d5582c81a52905d27bfbb18ba1b2999 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:41:39 -0400 Subject: [PATCH 29/68] EDIT add/remove event handlers --- src/mouse.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/mouse.js b/src/mouse.js index 38d6c2b..31b96bb 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -148,7 +148,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.click [ method ] ** - * Adds event handler for click for the element. + * Adds a click event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -156,7 +156,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unclick [ method ] ** - * Removes event handler for click for the element. + * Removes a click event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -165,7 +165,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.dblclick [ method ] ** - * Adds event handler for double click for the element. + * Adds a double click event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -173,7 +173,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.undblclick [ method ] ** - * Removes event handler for double click for the element. + * Removes a double click event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -182,7 +182,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mousedown [ method ] ** - * Adds event handler for mousedown for the element. + * Adds a mousedown event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -190,7 +190,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmousedown [ method ] ** - * Removes event handler for mousedown for the element. + * Removes a mousedown event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -199,7 +199,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mousemove [ method ] ** - * Adds event handler for mousemove for the element. + * Adds a mousemove event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -207,7 +207,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmousemove [ method ] ** - * Removes event handler for mousemove for the element. + * Removes a mousemove event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -216,7 +216,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mouseout [ method ] ** - * Adds event handler for mouseout for the element. + * Adds a mouseout event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -224,7 +224,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmouseout [ method ] ** - * Removes event handler for mouseout for the element. + * Removes a mouseout event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -233,7 +233,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mouseover [ method ] ** - * Adds event handler for mouseover for the element. + * Adds a mouseover event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -241,7 +241,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmouseover [ method ] ** - * Removes event handler for mouseover for the element. + * Removes a mouseover event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -250,7 +250,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mouseup [ method ] ** - * Adds event handler for mouseup for the element. + * Adds a mouseup event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -258,7 +258,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmouseup [ method ] ** - * Removes event handler for mouseup for the element. + * Removes a mouseup event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -267,7 +267,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchstart [ method ] ** - * Adds event handler for touchstart for the element. + * Adds a touchstart event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -275,7 +275,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchstart [ method ] ** - * Removes event handler for touchstart for the element. + * Removes a touchstart event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -284,7 +284,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchmove [ method ] ** - * Adds event handler for touchmove for the element. + * Adds a touchmove event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -292,7 +292,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchmove [ method ] ** - * Removes event handler for touchmove for the element. + * Removes a touchmove event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -301,7 +301,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchend [ method ] ** - * Adds event handler for touchend for the element. + * Adds a touchend event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -309,7 +309,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchend [ method ] ** - * Removes event handler for touchend for the element. + * Removes a touchend event handler from the element. - handler (function) handler for the event = (object) @Element \*/ @@ -318,7 +318,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchcancel [ method ] ** - * Adds event handler for touchcancel for the element. + * Adds a touchcancel event handler to the element. - handler (function) handler for the event = (object) @Element \*/ @@ -326,7 +326,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchcancel [ method ] ** - * Removes event handler for touchcancel for the element. + * Removes a touchcancel event handler from the element. - handler (function) handler for the event = (object) @Element \*/ From 90a2c1bfc323944e169ce3c93670e028111827c7 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:49:30 -0400 Subject: [PATCH 30/68] GLOBAL: remove 'will' --- src/mouse.js | 12 ++++++------ src/set.js | 2 +- src/svg.js | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mouse.js b/src/mouse.js index 31b96bb..30f428c 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -396,21 +396,21 @@ Snap.plugin(function (Snap, Element, Paper, glob) { - mcontext (object) #optional context for moving handler - scontext (object) #optional context for drag start handler - econtext (object) #optional context for drag end handler - * Additionaly following `drag` events will be triggered: `drag.start.` on start, - * `drag.end.` on end and `drag.move.` on every move. When element will be dragged over another element - * `drag.over.` will be fired as well. + * Additionaly following `drag` events are triggered: `drag.start.` on start, + * `drag.end.` on end and `drag.move.` on every move. When element is dragged over another element + * `drag.over.` fires as well. * - * Start event and start handler will be called in specified context or in context of the element with following parameters: + * Start event and start handler are called in specified context or in context of the element with following parameters: o x (number) x position of the mouse o y (number) y position of the mouse o event (object) DOM event object - * Move event and move handler will be called in specified context or in context of the element with following parameters: + * Move event and move handler are called in specified context or in context of the element with following parameters: o dx (number) shift by x from the start point o dy (number) shift by y from the start point o x (number) x position of the mouse o y (number) y position of the mouse o event (object) DOM event object - * End event and end handler will be called in specified context or in context of the element with following parameters: + * End event and end handler are called in specified context or in context of the element with following parameters: o event (object) DOM event object = (object) @Element \*/ diff --git a/src/set.js b/src/set.js index 1042c51..9a51aa3 100644 --- a/src/set.js +++ b/src/set.js @@ -67,7 +67,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Executes given function for each element in the set. * - * If function returns `false` it will stop loop running. + * If the function returns `false`, the loop stops running. ** - callback (function) function to run - thisArg (object) context object for the callback diff --git a/src/svg.js b/src/svg.js index 57a7ebd..5841135 100644 --- a/src/svg.js +++ b/src/svg.js @@ -156,10 +156,10 @@ function is(o, type) { * Replaces construction of type “`{}`” to the corresponding argument. ** - token (string) string to format - - json (object) object which properties will be used as a replacement + - json (object) object which properties are used as a replacement = (string) formated string > Usage - | // this will draw a rectangular shape equivalent to "M10,20h40v50h-40z" + | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z" | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", { | x: 10, | y: 20, @@ -1038,7 +1038,7 @@ Snap.rgb2hsl = function (r, g, b) { * Utility method ** * Parses given path string into an array of arrays of path segments. - - pathString (string|array) path string or array of segments (in the last case it will be returned straight away) + - pathString (string|array) path string or array of segments (in the last case it is returned straight away) = (array) array of segments. \*/ Snap.parsePathString = function (pathString) { @@ -1092,7 +1092,7 @@ Snap.parsePathString = function (pathString) { * Utility method ** * Parses given transform string into an array of transformations. - - TString (string|array) transform string or array of transformations (in the last case it will be returned straight away) + - TString (string|array) transform string or array of transformations (in the last case it is returned straight away) = (array) array of transformations. \*/ var parseTransformString = Snap.parseTransformString = function (TString) { @@ -1503,9 +1503,9 @@ function arrayFirstValue(arr) { o h: (number) height, o height: (number) height, o path: (string) path command for the box, - o r0: (number) radius of the circle that will enclose the box, + o r0: (number) radius of a circle that fully encloses the box, o r1: (number) radius of the smallest circle that can be enclosed, - o r2: (number) radius of the biggest circle that can be enclosed, + o r2: (number) radius of the largest circle that can be enclosed, o vb: (string) box as a viewbox command, o w: (number) width, o width: (number) width, @@ -2066,7 +2066,7 @@ function arrayFirstValue(arr) { ** - from (number|array) number or array of numbers - to (number|array) number or array of numbers - - setter (function) caring function that will take one number argument + - setter (function) caring function that accepts one number argument - duration (number) duration, in milliseconds - easing (function) #optional easing function from @mina or custom - callback (function) #optional callback function to execute when animation ends VERIFY @@ -2716,7 +2716,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { # #
      CommandNameParameters
      Aelliptical arc(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
      RCatmull-Rom curveto*x1 y1 (x y)+
      * * “Catmull-Rom curveto” is a not standard SVG command and added to make life easier. - * Note: there is a special case when path consist of just three commands: “M10,10R…z”. In this case path will smoothly connects to its beginning. + * Note: there is a special case when a path consists of only three commands: “M10,10R…z”. In this case, the path connects smoothly to its beginning. > Usage | var c = paper.path("M10 10L90 90"); | // draw a diagonal line: @@ -2745,7 +2745,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { > Usage | var c1 = paper.circle(), | c2 = paper.rect(), - | g = paper.g(c2, c1); // note that the order of elements will be different + | g = paper.g(c2, c1); // note that the order of elements is different * or | var c1 = paper.circle(), | c2 = paper.rect(), From 6df0f0ecd58520ebb3d3ef798d4f471b9b3dba2b Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 14:53:42 -0400 Subject: [PATCH 31/68] EDIT & COMMENT Element.drag --- src/mouse.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mouse.js b/src/mouse.js index 30f428c..4821899 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -385,11 +385,16 @@ Snap.plugin(function (Snap, Element, Paper, glob) { return this.unmouseover(f_in).unmouseout(f_out); }; var draggable = []; + // SIERRA unclear what _context_ refers to for starting, ending, moving the drag gesture. + // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y values offset from? + // SIERRA Element.drag(): much of this member's doc appears to be duplicated for some reason. + // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start. on start, drag.end. on end and drag.move. on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID? /*\ * Element.drag [ method ] ** - * Adds event handlers for drag of the element. + * Adds event handlers for an element's drag gesture. + ** - onmove (function) handler for moving - onstart (function) handler for drag start - onend (function) handler for drag end From be508cd8a92f6304f094562e62992b56b2dd49f8 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:01:33 -0400 Subject: [PATCH 32/68] EDIT & COMMENT Element.getTotalLength --- src/path.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/path.js b/src/path.js index 2fda342..7f501cf 100644 --- a/src/path.js +++ b/src/path.js @@ -1093,7 +1093,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.getTotalLength [ method ] ** - * Returns length of the path in pixels. Only works for element of “path” type. + * Returns length of the path in pixels. Only works for `path` elements. = (number) length. \*/ elproto.getTotalLength = function () { @@ -1101,11 +1101,12 @@ Snap.plugin(function (Snap, Element, Paper, glob) { return this.node.getTotalLength(); } }; + // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a is broken into different segments, is the jump distance to the new coordinates set by the _M_ or _m_ commands calculated as part of the path's total length? /*\ * Element.getPointAtLength [ method ] ** - * Return coordinates of the point located at the given length on the given path. Only works for element of “path” type. + * Return coordinates of the point located at the given length on the given path. Only works for `path` elements. ** - length (number) ** @@ -1123,7 +1124,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.getSubpath [ method ] ** - * Return subpath of a given element from given length to given length. Only works for element of “path” type. + * Return subpath of a given element from given length to given length. Only works for `path` elements. ** - from (number) position of the start of the segment - to (number) position of the end of the segment From cef235cb872ff710f66759ae8c78f3a08aeb3443 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:08:31 -0400 Subject: [PATCH 33/68] GLOBAL: replace quote characters w/inline font --- src/mina.js | 22 +++++++++++----------- src/svg.js | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/mina.js b/src/mina.js index 1d35b50..95aaa60 100644 --- a/src/mina.js +++ b/src/mina.js @@ -129,24 +129,24 @@ var mina = (function (eve) { ** * Generic animation of numbers. ** - - a (number) start “slave” number - - A (number) end “slave” number - - b (number) start “master” number (start time in gereal case) - - B (number) end “master” number (end time in gereal case) - - get (function) getter of “master” number (see @mina.time) - - set (function) setter of “slave” number + - a (number) start _slave_ number + - A (number) end _slave_ number + - b (number) start _master_ number (start time in gereal case) + - B (number) end _master_ number (end time in gereal case) + - get (function) getter of _master_ number (see @mina.time) + - set (function) setter of _slave_ number - easing (function) #optional easing function, default is @mina.linear = (object) animation descriptor o { o id (string) animation id, - o start (number) start “slave” number, - o end (number) end “slave” number, - o b (number) start “master” number, + o start (number) start _slave_ number, + o end (number) end _slave_ number, + o b (number) start _master_ number, o s (number) animation status (0..1), o dur (number) animation duration, o spd (number) animation speed, - o get (function) getter of “master” number (see @mina.time), - o set (function) setter of “slave” number, + o get (function) getter of _master_ number (see @mina.time), + o set (function) setter of _slave_ number, o easing (function) easing function, default is @mina.linear, o status (function) status getter/setter, o speed (function) speed getter/setter, diff --git a/src/svg.js b/src/svg.js index 5841135..1e26db6 100644 --- a/src/svg.js +++ b/src/svg.js @@ -153,7 +153,7 @@ function is(o, type) { * Snap.format [ method ] ** - * Replaces construction of type “`{}`” to the corresponding argument. + * Replaces construction of type `{}` to the corresponding argument. ** - token (string) string to format - json (object) object which properties are used as a replacement @@ -310,7 +310,7 @@ Snap.angle = angle; ** * Handfull replacement for `typeof` operator. - o (…) any object or primitive - - type (string) name of the type, i.e. “string”, “function”, “number”, etc. + - type (string) name of the type, i.e. `string`, `function`, `number`, etc. = (boolean) is given value is of given type \*/ Snap.is = is; @@ -619,18 +619,18 @@ Snap.Matrix = Matrix; * Parses colour string as RGB object - colour (string) colour string in one of the following formats: #
        - #
      • Colour name (“red”, “green”, “cornflowerblue”, etc)
      • - #
      • #••• — shortened HTML colour: (“#000”, “#fc0”, etc)
      • - #
      • #•••••• — full length HTML colour: (“#000000”, “#bd2300”)
      • - #
      • rgb(•••, •••, •••) — red, green and blue channels values: (“rgb(200, 100, 0)”)
      • + #
      • Colour name (red, green, cornflowerblue, etc)
      • + #
      • #••• — shortened HTML colour: (#000, #fc0, etc)
      • + #
      • #•••••• — full length HTML colour: (#000000, #bd2300)
      • + #
      • rgb(•••, •••, •••) — red, green and blue channels values: (rgb(200, 100, 0))
      • #
      • rgba(•••, •••, •••, •••) — also with opacity
      • - #
      • rgb(•••%, •••%, •••%) — same as above, but in %: (“rgb(100%, 175%, 0%)”)
      • + #
      • rgb(•••%, •••%, •••%) — same as above, but in %: (rgb(100%, 175%, 0%))
      • #
      • rgba(•••%, •••%, •••%, •••%) — also with opacity
      • - #
      • hsb(•••, •••, •••) — hue, saturation and brightness values: (“hsb(0.5, 0.25, 1)”)
      • + #
      • hsb(•••, •••, •••) — hue, saturation and brightness values: (hsb(0.5, 0.25, 1))
      • #
      • hsba(•••, •••, •••, •••) — also with opacity
      • #
      • hsb(•••%, •••%, •••%) — same as above, but in %
      • #
      • hsba(•••%, •••%, •••%, •••%) — also with opacity
      • - #
      • hsl(•••, •••, •••) — hue, saturation and luminosity values: (“hsb(0.5, 0.25, 0.5)”)
      • + #
      • hsl(•••, •••, •••) — hue, saturation and luminosity values: (hsb(0.5, 0.25, 0.5))
      • #
      • hsla(•••, •••, •••, •••) — also with opacity
      • #
      • hsl(•••%, •••%, •••%) — same as above, but in %
      • #
      • hsla(•••%, •••%, •••%, •••%) — also with opacity
      • @@ -1466,7 +1466,7 @@ function arrayFirstValue(arr) { | strokeWidth: 2, // CamelCase... | "fill-opacity": 0.5 // or dash-separated names | }); - | console.log(el.attr("fill")); // “#fc0” + | console.log(el.attr("fill")); // #fc0 \*/ elproto.attr = function (params, value) { var el = this, @@ -2545,7 +2545,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - height (number) height - rx (number) #optional horisontal radius for rounded corners, default is 0 - ry (number) #optional vertical radius for rounded corners, default is rx or 0 - = (object) Element object with type “rect” + = (object) Element object with type `rect` ** > Usage | // regular rectangle @@ -2585,7 +2585,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - x (number) x coordinate of the centre - y (number) y coordinate of the centre - r (number) radius - = (object) Element object with type “circle” + = (object) Element object with type `circle` ** > Usage | var c = paper.circle(50, 50, 40); @@ -2614,7 +2614,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y coordinate position - width (number) width of the image - height (number) height of the image - = (object) Raphaël element object with type “image” + = (object) Raphaël element object with type `image` ** > Usage | var c = paper.image("apple.png", 10, 10, 80, 80); @@ -2630,7 +2630,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y coordinate position - width (number) width of the image - height (number) height of the image - = (object) Element object with type “image” + = (object) Element object with type `image` ** > Usage | var c = paper.image("apple.png", 10, 10, 80, 80); @@ -2673,7 +2673,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y coordinate of the centre - rx (number) horizontal radius - ry (number) vertical radius - = (object) Element object with type “ellipse” + = (object) Element object with type `ellipse` ** > Usage | var c = paper.ellipse(50, 50, 40, 20); @@ -2700,7 +2700,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - pathString (string) #optional path string in SVG format. * Path string consists of one-letter commands, followed by comma seprarated arguments in numercal form. Example: | "M10,20L30,40" - * This example features two commands: “M”, with arguments `(10, 20)` and “L” with arguments `(30, 40)`. Uppercase commands indicate absolute coordinates. Lowercase commands position relative to the previous coordinates. + * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase commands indicate absolute coordinates. Lowercase commands position relative to the previous coordinates. * #

        Here is short list of commands available, for more details see SVG path string format or article about path strings at MDN.

        # @@ -2715,8 +2715,8 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { # # #
        CommandNameParameters
        Tsmooth quadratic Bézier curveto(x y)+
        Aelliptical arc(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
        RCatmull-Rom curveto*x1 y1 (x y)+
        - * * “Catmull-Rom curveto” is a not standard SVG command and added to make life easier. - * Note: there is a special case when a path consists of only three commands: “M10,10R…z”. In this case, the path connects smoothly to its beginning. + * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier. + * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case, the path connects smoothly to its beginning. > Usage | var c = paper.path("M10 10L90 90"); | // draw a diagonal line: @@ -2740,7 +2740,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Makes a group element. ** - varargs (…) #optional elements - = (object) Element object with type “g” + = (object) Element object with type `g` ** > Usage | var c1 = paper.circle(), @@ -2780,7 +2780,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - x (number) x coordinate position - y (number) y coordinate position - text (string|array) The text string to draw or array of s - = (object) Element object with type “text” + = (object) Element object with type `text` ** > Usage | var t1 = paper.text(50, 50, "Snap"); @@ -2809,7 +2809,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y1 (number) y coordinate position of the start - x2 (number) x coordinate position of the end - y2 (number) y coordinate position of the end - = (object) Element object with type “line” + = (object) Element object with type `line` ** > Usage | var t1 = paper.line(50, 50, 100, 100); @@ -2837,7 +2837,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - points (array) array of points * or - varargs (…) points - = (object) Element object with type “text” + = (object) Element object with type `text` ** > Usage | var p1 = paper.polyline([10, 10, 100, 100]); @@ -2888,12 +2888,12 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - gradient (string) gradient descriptor > Gradient Descriptor * Gradient descriptor consists of `()`. Type - * could be linear or radial, which presented as letter “L” or “R”. Any + * could be linear or radial, which presented as letter `L` or `R`. Any * type could be absolute or relative, absolute gradient take it coords * relative to the SVG surface, while relative takes them relative to * the bounding box of the element it applied to. For absolute - * coordinates you specify type as an upper case letter (“L” or “R”). - * For relative use low case letter (“l” or “r”). Coordinates specify + * coordinates you specify type as an upper case letter (`L` or `R`). + * For relative use low case letter (`l` or `r`). Coordinates specify * vector of gradient for linear as x1, y1, x2, y2. For radial as cx, * cy, r and optional fx, fy. Colors are list of dash separated colors. * Optionally color could have offset after colon. @@ -2910,7 +2910,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { | paper.circle(50, 50, 40).attr({ | fill: g | }); - = (object) Element object with type “gradient” + = (object) Element object with type `gradient` \*/ proto.gradient = function (str) { return gradient(this.defs, str); From 272be001d886b9be021262b2257850a5e84fcc5c Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:16:46 -0400 Subject: [PATCH 34/68] COMMENT Element.getSubpath --- src/path.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/path.js b/src/path.js index 7f501cf..c7f758b 100644 --- a/src/path.js +++ b/src/path.js @@ -1120,6 +1120,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { elproto.getPointAtLength = function (length) { return getPointAtLength(this.attr("d"), length); }; + // SIERRA Element.getSubpath(): Similar to the problem for Element.getPointAtLength(). Unclear how this would work for a segmented path. Overall, the concept of _subpath_ and what I'm calling a _segment_ (series of non-_M_ or _Z_ commands) is unclear. /*\ * Element.getSubpath [ method ] From b9f6fd919a6fca42d384fab0d0543e9abb114b4f Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:23:28 -0400 Subject: [PATCH 35/68] EDIT & COMMENT Element.marker --- src/svg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 1e26db6..9d935a3 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1943,6 +1943,8 @@ function arrayFirstValue(arr) { p.node.appendChild(this.node); return p; }; +// SIERRA Element.marker(): clarify what a reference point is. E.g., helps you offset the object from its edge such as when centering it over a path. +// SIERRA Element.marker(): I suggest the method should accept default reference point values. Perhaps centered with (refX = width/2) and (refY = height/2)? Also, couldn't it assume the element's current _width_ and _height_? And please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't they also be assigned default values? /*\ * Element.marker [ method ] @@ -1957,7 +1959,7 @@ function arrayFirstValue(arr) { - refX (number) - refY (number) = (Element) `` element - * You can use pattern later on as an argument for `marker-start` or `marker-end` attributes. + * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end. \*/ // TODO add usage for markers elproto.marker = function (x, y, width, height, refX, refY) { From 537c5b30ed73607e497395da947714b99a9d4179 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:26:42 -0400 Subject: [PATCH 36/68] COMMENT Element.pattern, Snap.parsePathString --- src/svg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 9d935a3..a01af9a 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1030,7 +1030,7 @@ Snap.rgb2hsl = function (r, g, b) { }; // Transformations -# SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured? +// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured? /*\ * Snap.parsePathString [ method ] @@ -1897,6 +1897,8 @@ function arrayFirstValue(arr) { defs.appendChild(this.node); return this; }; +// SIERRA Element.pattern(): x/y/width/height data types are listed as both String and Number. Is that an error, or does it mean strings are coerced? +// SIERRA Element.pattern(): clarify that x/y are offsets that e.g., may add gutters between the tiles. /*\ * Element.pattern [ method ] From 43f94159d13d2fdc84785cd2542c1543a3088c59 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:29:27 -0400 Subject: [PATCH 37/68] COMMENT Element.transform --- src/svg.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/svg.js b/src/svg.js index a01af9a..6a97c8a 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1547,6 +1547,9 @@ function arrayFirstValue(arr) { var propString = function () { return this.local; }; +// SIERRA Element.transform(): seems to allow two return values, one of which (_Element_) is undefined. +// SIERRA Element.transform(): if this only accepts one argument, it's unclear how it can both _get_ and _set_ a transform. +// SIERRA Element.transform(): Unclear how Snap transform string format differs from SVG's. /*\ * Element.transform [ method ] From d2a48dc6b2f7adc58dccbac312bd1845eb16d8ff Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:34:35 -0400 Subject: [PATCH 38/68] EDIT & COMMENT Element.getBBox --- src/svg.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/svg.js b/src/svg.js index 6a97c8a..5c46f84 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1490,6 +1490,8 @@ function arrayFirstValue(arr) { } return el; }; +// SIERRA Element.getBBox(): Unclear why you would want to express the dimension of the box as a path. +// SIERRA Element.getBBox(): Unclear why you would want to use r0/r1/r2. Also, basic definitions: wouldn't the _smallest circle that can be enclosed_ be a zero-radius point? /*\ * Element.getBBox [ method ] @@ -1511,8 +1513,8 @@ function arrayFirstValue(arr) { o width: (number) width, o x2: (number) x of the right side, o x: (number) x of the left side, - o y2: (number) y of the right side, - o y: (number) y of the left side + o y2: (number) y of the bottom edge, + o y: (number) y of the top edge o } \*/ elproto.getBBox = function (isWithoutTransform) { From af5b0ab89624fae0481d018d7337dc504d9406ea Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:43:31 -0400 Subject: [PATCH 39/68] GLOBAL: fix 'Element object with type fubar' --- src/svg.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/svg.js b/src/svg.js index 5c46f84..84cab64 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2554,7 +2554,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - height (number) height - rx (number) #optional horisontal radius for rounded corners, default is 0 - ry (number) #optional vertical radius for rounded corners, default is rx or 0 - = (object) Element object with type `rect` + = (object) `rect` element ** > Usage | // regular rectangle @@ -2594,7 +2594,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - x (number) x coordinate of the centre - y (number) y coordinate of the centre - r (number) radius - = (object) Element object with type `circle` + = (object) `circle` element ** > Usage | var c = paper.circle(50, 50, 40); @@ -2639,7 +2639,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y coordinate position - width (number) width of the image - height (number) height of the image - = (object) Element object with type `image` + = (object) `image` element ** > Usage | var c = paper.image("apple.png", 10, 10, 80, 80); @@ -2672,6 +2672,8 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { } return el; }; +// SIERRA Paper.ellipse(): Returns _ellipse element_. Use in-line font change for _ellipse,_ not quote characters. + /*\ * Paper.ellipse [ method ] @@ -2682,7 +2684,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y coordinate of the centre - rx (number) horizontal radius - ry (number) vertical radius - = (object) Element object with type `ellipse` + = (object) `ellipse` element ** > Usage | var c = paper.ellipse(50, 50, 40, 20); @@ -2749,7 +2751,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Makes a group element. ** - varargs (…) #optional elements - = (object) Element object with type `g` + = (object) `g` element ** > Usage | var c1 = paper.circle(), @@ -2789,7 +2791,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - x (number) x coordinate position - y (number) y coordinate position - text (string|array) The text string to draw or array of s - = (object) Element object with type `text` + = (object) `text` element ** > Usage | var t1 = paper.text(50, 50, "Snap"); @@ -2818,7 +2820,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y1 (number) y coordinate position of the start - x2 (number) x coordinate position of the end - y2 (number) y coordinate position of the end - = (object) Element object with type `line` + = (object) `line` element ** > Usage | var t1 = paper.line(50, 50, 100, 100); @@ -2846,7 +2848,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - points (array) array of points * or - varargs (…) points - = (object) Element object with type `text` + = (object) `text` element ** > Usage | var p1 = paper.polyline([10, 10, 100, 100]); @@ -2919,7 +2921,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { | paper.circle(50, 50, 40).attr({ | fill: g | }); - = (object) Element object with type `gradient` + = (object) `gradient` element \*/ proto.gradient = function (str) { return gradient(this.defs, str); From dd416fbec52e0df00aea384b1855191dc979c96e Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:44:27 -0400 Subject: [PATCH 40/68] remove stray comment --- src/svg.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/svg.js b/src/svg.js index 84cab64..f4ae264 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2672,8 +2672,6 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { } return el; }; -// SIERRA Paper.ellipse(): Returns _ellipse element_. Use in-line font change for _ellipse,_ not quote characters. - /*\ * Paper.ellipse [ method ] From 830d7afde632e4d25e365be0fe7f042c4a846621 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:46:31 -0400 Subject: [PATCH 41/68] EDIT & COMMENT Paper.filter --- src/filter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filter.js b/src/filter.js index 7e5db64..21b7059 100644 --- a/src/filter.js +++ b/src/filter.js @@ -18,6 +18,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { Str = String, $ = Snap._.$; Snap.filter = {}; +// SIERRA Paper.filter(): I don't understand the note. Does that mean an HTML should dedicate a separate SVG region for a filter definition? What's the advantage over a DEFS? /*\ * Paper.filter [ method ] @@ -26,7 +27,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** - filstr (string) SVG fragment of filter provided as a string. = (object) @Element - * Note: It is recommended to use filters embedded into page inside empty SVG element. + * Note: It is recommended to use filters embedded into the page inside an empty SVG element. > Usage | var f = paper.filter(''), | c = paper.circle(10, 10, 10).attr({ From d1b22f53784317586e52ddc414100fbfb9f90876 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:49:18 -0400 Subject: [PATCH 42/68] EDIT & COMMENT Paper.g --- src/svg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index f4ae264..9896077 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2742,13 +2742,14 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { } return el; }; +// SIERRA Paper.g(): Don't understand the code comment about the order being _different._ Wouldn't it be a rect followed by a circle? /*\ * Paper.g [ method ] ** * Makes a group element. ** - - varargs (…) #optional elements + - varargs (…) #optional elements to nest within the group = (object) `g` element ** > Usage From 19b8e2a43e46de8a91d9f1935032935e667f0052 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 15:55:15 -0400 Subject: [PATCH 43/68] EDIT Paper.gradient --- src/svg.js | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/svg.js b/src/svg.js index 9896077..1074f93 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2897,26 +2897,30 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { ** - gradient (string) gradient descriptor > Gradient Descriptor - * Gradient descriptor consists of `()`. Type - * could be linear or radial, which presented as letter `L` or `R`. Any - * type could be absolute or relative, absolute gradient take it coords - * relative to the SVG surface, while relative takes them relative to - * the bounding box of the element it applied to. For absolute - * coordinates you specify type as an upper case letter (`L` or `R`). - * For relative use low case letter (`l` or `r`). Coordinates specify - * vector of gradient for linear as x1, y1, x2, y2. For radial as cx, - * cy, r and optional fx, fy. Colors are list of dash separated colors. - * Optionally color could have offset after colon. - > Example - | var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff"); + * The gradient descriptor is an expression formatted as + * follows: `()`. The `` can be + * either linear or radial. The uppercase `L` or `R` letters + * indicate absolute coordinates offset from the SVG surface. + * Lowercase `l` or `r` letters indicate coordinates + * calculated relative to the element to which the gradient is + * applied. Coordinates specify a linear gradient vector as + * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`, + * `r` and optional `fx`, `fy` specifying a focal point away + * from the center of the circle. Specify `` as a list + * of dash-separated CSS color values. Each color may be + * followed by a custom offset value, separated with a colon + * character. + > Examples * Linear gradient, relative from top-left corner to bottom-right - * corner, from black through red to white. - | var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25%-#fff"); + * corner, from black through red to white: + | var g = paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff"); * Linear gradient, absolute from (0, 0) to (100, 100), from black - * through red at 25% to white. - | var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff"); + * through red at 25% to white: + | var g = paper.gradient("L(0, 0, 100, 100)#000-#f00:25%-#fff"); * Radial gradient, relative from the center of the element with radius - * 0.5 of the width, from black to white. + * half the width, from black to white: + | var g = paper.gradient("r(0.5, 0.5, 0.5)#000-#fff"); + * To apply the gradient: | paper.circle(50, 50, 40).attr({ | fill: g | }); From 5d0a340754b7770f8eeec128e6dd5802907ff8e3 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:00:58 -0400 Subject: [PATCH 44/68] EDIT Paper.image, to collapse redundant doc entries --- src/svg.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/svg.js b/src/svg.js index 1074f93..551248b 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2612,6 +2612,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { } return el; }; + /*\ * Paper.image [ method ] @@ -2619,27 +2620,13 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Embeds an image into the surface. ** - src (string) URI of the source image - - x (number) x coordinate position - - y (number) y coordinate position - - width (number) width of the image - - height (number) height of the image - = (object) Raphaël element object with type `image` - ** - > Usage - | var c = paper.image("apple.png", 10, 10, 80, 80); - \*/ - /*\ - * Paper.image - [ method ] - ** - * Embeds an image into the surface. - ** - - src (string) URI of the source image - - x (number) x coordinate position - - y (number) y coordinate position + - x (number) x offset position + - y (number) y offset position - width (number) width of the image - height (number) height of the image = (object) `image` element + * or + = (object) Raphaël element object with type `image` ** > Usage | var c = paper.image("apple.png", 10, 10, 80, 80); From a3f88ffa1f74124d686b4c45a9d1467550ffaa5a Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:04:58 -0400 Subject: [PATCH 45/68] EDIT & COMMENT Paper.path --- src/svg.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/svg.js b/src/svg.js index 551248b..0666cf1 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2688,15 +2688,16 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { } return el; }; + // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier. /*\ * Paper.path [ method ] ** - * Creates a path element by given path data string. + * Creates a path element using the given string as the path's definition. - pathString (string) #optional path string in SVG format. - * Path string consists of one-letter commands, followed by comma seprarated arguments in numercal form. Example: + * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example: | "M10,20L30,40" - * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase commands indicate absolute coordinates. Lowercase commands position relative to the previous coordinates. + * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates. * #

        Here is short list of commands available, for more details see SVG path string format or article about path strings at MDN.

        # @@ -2712,7 +2713,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { # #
        CommandNameParameters
        Aelliptical arc(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+
        RCatmull-Rom curveto*x1 y1 (x y)+
        * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier. - * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case, the path connects smoothly to its beginning. + * Note: there is a special case when a path consists of only three commands: `M10,10R…z`. In this case the path connects back to its starting point. > Usage | var c = paper.path("M10 10L90 90"); | // draw a diagonal line: From 13599ac0f5d54a8491cda6f231464576b5f1fd86 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:06:22 -0400 Subject: [PATCH 46/68] EDIT Paper.polyline --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 0666cf1..22b6437 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2835,7 +2835,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - points (array) array of points * or - varargs (…) points - = (object) `text` element + = (object) `polyline` element ** > Usage | var p1 = paper.polyline([10, 10, 100, 100]); From c51a3119c9fd4a554e28c6dff5fb73c2543789e1 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:07:25 -0400 Subject: [PATCH 47/68] GLOBAL: 'horizontal' --- src/filter.js | 4 ++-- src/svg.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filter.js b/src/filter.js index 21b7059..0ad2e0a 100644 --- a/src/filter.js +++ b/src/filter.js @@ -90,7 +90,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns string of the blur filter. ** - - x (number) amount of horisontal blur in px. + - x (number) amount of horizontal blur in px. - y (number) #optional amount of vertical blur in px. = (string) filter representation > Usage @@ -117,7 +117,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns string of the shadow filter. ** - - dx (number) horisontal shift of the shadow in px. + - dx (number) horizontal shift of the shadow in px. - dy (number) vertical shift of the shadow in px. - blur (number) #optional amount of blur. - color (string) #optional color of the shadow. diff --git a/src/svg.js b/src/svg.js index 22b6437..698e76a 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2552,7 +2552,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y coordinate of the top left corner - width (number) width - height (number) height - - rx (number) #optional horisontal radius for rounded corners, default is 0 + - rx (number) #optional horizontal radius for rounded corners, default is 0 - ry (number) #optional vertical radius for rounded corners, default is rx or 0 = (object) `rect` element ** From 933037609fb56c5b27de32075cd859a2b55dbc40 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:09:59 -0400 Subject: [PATCH 48/68] EDIT Paper.text --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 698e76a..d96edd9 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2777,7 +2777,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { ** - x (number) x coordinate position - y (number) y coordinate position - - text (string|array) The text string to draw or array of s + - text (string|array) The text string to draw or array of strings to nest within separate `` elements = (object) `text` element ** > Usage From ee051acc89149f1ee646c6fe0edcdc0c36217582 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:13:17 -0400 Subject: [PATCH 49/68] COMMENT Matrix.split --- src/svg.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/svg.js b/src/svg.js index d96edd9..637a139 100644 --- a/src/svg.js +++ b/src/svg.js @@ -522,6 +522,9 @@ function Matrix(a, b, c, d, e, f) { a[0] && (a[0] /= mag); a[1] && (a[1] /= mag); } +// SIERRA Matrix.split(): HTML formatting for the return value is scrambled. It should appear _Returns: {OBJECT} in format:..._ +// SIERRA Matrix.split(): the _shear_ parameter needs to be detailed. Is it an angle? What does it affect? +// SIERRA Matrix.split(): The idea of _simple_ transforms needs to be detailed and contrasted with any alternatives. /*\ * Matrix.split [ method ] From e73df0453848d5520b93fa94b540fce178bb5e00 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:13:57 -0400 Subject: [PATCH 50/68] COMMENT Matrix.invert --- src/svg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg.js b/src/svg.js index 637a139..dc0f833 100644 --- a/src/svg.js +++ b/src/svg.js @@ -413,6 +413,7 @@ function Matrix(a, b, c, d, e, f) { this.f = out[1][2]; return this; }; +// SIERRA Matrix.invert(): Unclear what it means to invert a matrix. /*\ * Matrix.invert [ method ] From 6f339923455ba23fb84d40f85a45278678c47849 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:18:21 -0400 Subject: [PATCH 51/68] COMMENT Matrix.toTransformString --- src/svg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg.js b/src/svg.js index dc0f833..1a47468 100644 --- a/src/svg.js +++ b/src/svg.js @@ -575,6 +575,7 @@ function Matrix(a, b, c, d, e, f) { out.noRotation = !+out.shear.toFixed(9) && !out.rotate; return out; }; +// SIERRA Matrix.toTransformString(): The format of the string needs to be detailed. /*\ * Matrix.toTransformString [ method ] From d8e7ced562d9a9510dd24e53e70c718ada218624 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:41:09 -0400 Subject: [PATCH 52/68] VERIFY subpath distances exclude jumps --- src/path.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/path.js b/src/path.js index c7f758b..4a083a1 100644 --- a/src/path.js +++ b/src/path.js @@ -1060,7 +1060,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Return coordinates of the point located at the given length on the given path. ** - path (string) SVG path string - - length (number) + - length (number) distance, in pixels, from the start of the path, excluding non-rendering jumps VERIFY ** = (object) representation of the point: o { @@ -1074,13 +1074,13 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.path.getSubpath [ method ] ** - * Return subpath of a given path from given length to given length. + * Return subpath of a given path between given start and end lengths ** - path (string) SVG path string - - from (number) position of the start of the segment - - to (number) position of the end of the segment + - from (number) distance, in pixels, to the start of the segment VERIFY + - to (number) distance, in pixels, to the end of the segment VERIFY ** - = (string) pathstring for the segment + = (string) path string definition for the segment \*/ Snap.path.getSubpath = function (path, from, to) { if (this.getTotalLength(path) - to < 1e-6) { @@ -1125,12 +1125,12 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.getSubpath [ method ] ** - * Return subpath of a given element from given length to given length. Only works for `path` elements. + * Return subpath of a given element from given start and end lengths. Only works for `path` elements. ** - - from (number) position of the start of the segment - - to (number) position of the end of the segment + - from (number) distance, in pixels, of the start of the segment VERIFY + - to (number) distance, in pixels, of the end of the segment VERIFY ** - = (string) pathstring for the segment + = (string) path string definition for the segment \*/ elproto.getSubpath = function (from, to) { return Snap.path.getSubpath(this.attr("d"), from, to); From eceaf146afd939020f53fc8b09c33dccec8289cf Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:49:02 -0400 Subject: [PATCH 53/68] VERIFY sync subpath descriptions --- src/path.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/path.js b/src/path.js index 4a083a1..3538fdd 100644 --- a/src/path.js +++ b/src/path.js @@ -1060,7 +1060,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Return coordinates of the point located at the given length on the given path. ** - path (string) SVG path string - - length (number) distance, in pixels, from the start of the path, excluding non-rendering jumps VERIFY + - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps VERIFY ** = (object) representation of the point: o { @@ -1077,8 +1077,8 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Return subpath of a given path between given start and end lengths ** - path (string) SVG path string - - from (number) distance, in pixels, to the start of the segment VERIFY - - to (number) distance, in pixels, to the end of the segment VERIFY + - from (number) length, in pixels, from the start of the path to the start of the segment VERIFY + - to (number) length, in pixels, from the start of the path to the end of the segment VERIFY ** = (string) path string definition for the segment \*/ @@ -1108,7 +1108,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Return coordinates of the point located at the given length on the given path. Only works for `path` elements. ** - - length (number) + - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps VERIFY ** = (object) representation of the point: o { @@ -1127,8 +1127,8 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Return subpath of a given element from given start and end lengths. Only works for `path` elements. ** - - from (number) distance, in pixels, of the start of the segment VERIFY - - to (number) distance, in pixels, of the end of the segment VERIFY + - from (number) length, in pixels, from the start of the path to the start of the segment VERIFY + - to (number) length, in pixels, from the start of the path to the end of the segment VERIFY ** = (string) path string definition for the segment \*/ From 52c5b2da7d97ec744f3e6126a6b1e25ae7d6953c Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 16:56:49 -0400 Subject: [PATCH 54/68] VERIFY new values for matrix translate x/y --- src/svg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg.js b/src/svg.js index 1a47468..0c17c2e 100644 --- a/src/svg.js +++ b/src/svg.js @@ -441,8 +441,8 @@ function Matrix(a, b, c, d, e, f) { [ method ] ** * Translate the matrix - - x (number) - - y (number) + - x (number) horizontal offset distance VERIFY + - y (number) vertical offset distance VERIFY \*/ matrixproto.translate = function (x, y) { return this.add(1, 0, 0, 1, x, y); @@ -838,7 +838,7 @@ packageRGB = function (r, g, b, o) { [ method ] ** * Parses the color string and returns an object featuring the color's component values. - - clr (string) color string in one of the supported formats (see @Snap.getRGB) + - clr (string) color string in one of the supported formats. See @Snap.getRGB. = (object) Combined RGB & HSB object in the following format: o { o r (number) red, From 0d237dd2c8fe3e8d91b47f9c627695d870a93d39 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 17:06:53 -0400 Subject: [PATCH 55/68] VERIFY new values for Matrix.scale --- src/svg.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/svg.js b/src/svg.js index 0c17c2e..3485dcc 100644 --- a/src/svg.js +++ b/src/svg.js @@ -447,15 +447,16 @@ function Matrix(a, b, c, d, e, f) { matrixproto.translate = function (x, y) { return this.add(1, 0, 0, 1, x, y); }; + // SIERRA: do cx/cy default to the center point, as in CSS? If so, Snap appears to resolve important discrepancies between how transforms behave in SVG & CSS. /*\ * Matrix.scale [ method ] ** * Scales the matrix - - x (number) - - y (number) #optional - - cx (number) #optional - - cy (number) #optional + - x (number) amount to be scaled, with `1` resulting in no change VERIFY + - y (number) #optional amount to scale along the vertical axis. (Otherwise `x` applies to both axes.) + - cx (number) #optional horizontal origin point from which to scale VERIFY + - cy (number) #optional vertical origin point from which to scale \*/ matrixproto.scale = function (x, y, cx, cy) { y == null && (y = x); From 46e28d5001d7a2abc29d8f8210059654d679bdac Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 17:09:30 -0400 Subject: [PATCH 56/68] VERIFY new values for Matrix.rotate --- src/svg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg.js b/src/svg.js index 3485dcc..073169f 100644 --- a/src/svg.js +++ b/src/svg.js @@ -470,9 +470,9 @@ function Matrix(a, b, c, d, e, f) { [ method ] ** * Rotates the matrix - - a (number) - - x (number) - - y (number) + - a (number) angle of rotation, in radians VERIFY + - x (number) horizontal origin point from which to rotate VERIFY + - y (number) vertical origin point from which to rotate VERIFY \*/ matrixproto.rotate = function (a, x, y) { a = rad(a); From 7c99047c63474fb5092fa481a8a8d9ba0673d6ed Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 17:21:14 -0400 Subject: [PATCH 57/68] EDIT & COMMENT on high-level object interfaces --- src/svg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 073169f..c95256f 100644 --- a/src/svg.js +++ b/src/svg.js @@ -14,6 +14,7 @@ var Snap = (function() { Snap.version = "0.0.1"; +// SIERRA: this method appears to be missing from HTML output /*\ * Snap [ method ] @@ -23,7 +24,7 @@ Snap.version = "0.0.1"; - width (number|string) width of surface - height (number|string) height of surface * or - - dom (SVGElement) element to be wrapped into Snap structure + - DOM (SVGElement) element to be wrapped into Snap structure * or - query (string) CSS query selector = (object) @Element @@ -2369,6 +2370,7 @@ function make(name, parent) { el.type = name; return el; } +// SIERRA Is Paper() part of final interface, akin to Snap()? Document if so. function Paper(w, h) { var res, desc, From 69e8c0edb7721f6d99e00f636e317e54fc98aaf5 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 17:31:17 -0400 Subject: [PATCH 58/68] GLOBAL: e.g., i.e., etc. --- src/svg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg.js b/src/svg.js index c95256f..143a3a0 100644 --- a/src/svg.js +++ b/src/svg.js @@ -311,7 +311,7 @@ Snap.angle = angle; ** * Handfull replacement for `typeof` operator. - o (…) any object or primitive - - type (string) name of the type, i.e. `string`, `function`, `number`, etc. + - type (string) name of the type, e.g., `string`, `function`, `number`, etc. = (boolean) is given value is of given type \*/ Snap.is = is; @@ -627,7 +627,7 @@ Snap.Matrix = Matrix; - colour (string) colour string in one of the following formats: #
          #
        • Colour name (red, green, cornflowerblue, etc)
        • - #
        • #••• — shortened HTML colour: (#000, #fc0, etc)
        • + #
        • #••• — shortened HTML colour: (#000, #fc0, etc.)
        • #
        • #•••••• — full length HTML colour: (#000000, #bd2300)
        • #
        • rgb(•••, •••, •••) — red, green and blue channels values: (rgb(200, 100, 0))
        • #
        • rgba(•••, •••, •••, •••) — also with opacity
        • @@ -1774,7 +1774,7 @@ function arrayFirstValue(arr) { * Element.asPX [ method ] ** - * Return given attribute of the element as a `px` value. (Not %, em, etc) + * Return given attribute of the element as a `px` value. (Not %, em, etc.) ** - attr (string) attribute name - value (string) #optional attribute value From 4c7a9a95ee32769c302555cab051c6697d392c22 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 17:33:57 -0400 Subject: [PATCH 59/68] EDIT Snap.is --- src/svg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/svg.js b/src/svg.js index 143a3a0..29215fe 100644 --- a/src/svg.js +++ b/src/svg.js @@ -309,10 +309,10 @@ Snap.angle = angle; * Snap.is [ method ] ** - * Handfull replacement for `typeof` operator. + * Handy replacement for the `typeof` operator. - o (…) any object or primitive - type (string) name of the type, e.g., `string`, `function`, `number`, etc. - = (boolean) is given value is of given type + = (boolean) if given value is of given type \*/ Snap.is = is; /*\ From 5d6091fb0a74969830729199ace2c1dbb59374ad Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 20:56:44 -0400 Subject: [PATCH 60/68] GLOBAL: standardize method descriptions --- src/filter.js | 20 ++++---- src/mina.js | 22 ++++----- src/mouse.js | 54 +++++++++++----------- src/path.js | 30 ++++++------ src/set.js | 8 ++-- src/svg.js | 126 +++++++++++++++++++++++++------------------------- 6 files changed, 130 insertions(+), 130 deletions(-) diff --git a/src/filter.js b/src/filter.js index 0ad2e0a..056e1b9 100644 --- a/src/filter.js +++ b/src/filter.js @@ -23,7 +23,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Paper.filter [ method ] ** - * Creates filter element + * Creates a `` element ** - filstr (string) SVG fragment of filter provided as a string. = (object) @Element @@ -88,7 +88,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.blur [ method ] ** - * Returns string of the blur filter. + * Returns an SVG markup string for the blur filter ** - x (number) amount of horizontal blur in px. - y (number) #optional amount of vertical blur in px. @@ -115,7 +115,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.shadow [ method ] ** - * Returns string of the shadow filter. + * Returns an SVG markup string for the shadow filter ** - dx (number) horizontal shift of the shadow in px. - dy (number) vertical shift of the shadow in px. @@ -159,7 +159,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.grayscale [ method ] ** - * Returns string of the grayscale filter. + * Returns an SVG markup string for the grayscale filter ** - amount (number) amount of filter (`0..1`). = (string) filter representation @@ -186,7 +186,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.sepia [ method ] ** - * Returns string of the sepia filter. + * Returns an SVG markup string for the sepia filter ** - amount (number) amount of filter (`0..1`). = (string) filter representation @@ -214,7 +214,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.saturate [ method ] ** - * Returns string of the saturate filter. + * Returns an SVG markup string for the saturate filter ** - amount (number) amount of filter (`0..1`). = (string) filter representation @@ -234,7 +234,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.hueRotate [ method ] ** - * Returns string of the hue-rotate filter. + * Returns an SVG markup string for the hue-rotate filter ** - angle (number) angle of rotation. = (string) filter representation @@ -252,7 +252,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.invert [ method ] ** - * Returns string of the invert filter. + * Returns an SVG markup string for the invert filter ** - amount (number) amount of filter (`0..1`). = (string) filter representation @@ -273,7 +273,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.brightness [ method ] ** - * Returns string of the brightness filter. + * Returns an SVG markup string for the brightness filter ** - amount (number) amount of filter (`0..1`). = (string) filter representation @@ -293,7 +293,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.filter.contrast [ method ] ** - * Returns string of the contrast filter. + * Returns an SVG markup string for the contrast filter ** - amount (number) amount of filter (`0..1`). = (string) filter representation diff --git a/src/mina.js b/src/mina.js index 95aaa60..7b3a1ae 100644 --- a/src/mina.js +++ b/src/mina.js @@ -127,7 +127,7 @@ var mina = (function (eve) { * mina [ method ] ** - * Generic animation of numbers. + * Generic animation of numbers ** - a (number) start _slave_ number - A (number) end _slave_ number @@ -188,7 +188,7 @@ var mina = (function (eve) { * mina.time [ method ] ** - * Returns current time. Equal to + * Returns the current time. Equivalent to: | function () { | return (new Date).getTime(); | } @@ -198,7 +198,7 @@ var mina = (function (eve) { * mina.getById [ method ] ** - * Returns animation by its id. + * Returns an animation by its id - id (string) animation's id = (object) See @mina \*/ @@ -210,7 +210,7 @@ var mina = (function (eve) { * mina.linear [ method ] ** - * Default linear easing. + * Default linear easing - n (number) input 0..1 = (number) output 0..1 \*/ @@ -221,7 +221,7 @@ var mina = (function (eve) { * mina.easeout [ method ] ** - * Easeout easing. + * Easeout easing - n (number) input 0..1 = (number) output 0..1 \*/ @@ -232,7 +232,7 @@ var mina = (function (eve) { * mina.easein [ method ] ** - * Easein easing. + * Easein easing - n (number) input 0..1 = (number) output 0..1 \*/ @@ -243,7 +243,7 @@ var mina = (function (eve) { * mina.easeinout [ method ] ** - * Easeinout easing. + * Easeinout easing - n (number) input 0..1 = (number) output 0..1 \*/ @@ -267,7 +267,7 @@ var mina = (function (eve) { * mina.backin [ method ] ** - * Backin easing. + * Backin easing - n (number) input 0..1 = (number) output 0..1 \*/ @@ -282,7 +282,7 @@ var mina = (function (eve) { * mina.backout [ method ] ** - * Backout easing. + * Backout easing - n (number) input 0..1 = (number) output 0..1 \*/ @@ -298,7 +298,7 @@ var mina = (function (eve) { * mina.elastic [ method ] ** - * Elastic easing. + * Elastic easing - n (number) input 0..1 = (number) output 0..1 \*/ @@ -313,7 +313,7 @@ var mina = (function (eve) { * mina.bounce [ method ] ** - * Bounce easing. + * Bounce easing - n (number) input 0..1 = (number) output 0..1 \*/ diff --git a/src/mouse.js b/src/mouse.js index 4821899..a52cff5 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -148,7 +148,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.click [ method ] ** - * Adds a click event handler to the element. + * Adds a click event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -156,7 +156,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unclick [ method ] ** - * Removes a click event handler from the element. + * Removes a click event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -165,7 +165,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.dblclick [ method ] ** - * Adds a double click event handler to the element. + * Adds a double click event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -173,7 +173,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.undblclick [ method ] ** - * Removes a double click event handler from the element. + * Removes a double click event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -182,7 +182,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mousedown [ method ] ** - * Adds a mousedown event handler to the element. + * Adds a mousedown event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -190,7 +190,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmousedown [ method ] ** - * Removes a mousedown event handler from the element. + * Removes a mousedown event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -199,7 +199,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mousemove [ method ] ** - * Adds a mousemove event handler to the element. + * Adds a mousemove event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -207,7 +207,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmousemove [ method ] ** - * Removes a mousemove event handler from the element. + * Removes a mousemove event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -216,7 +216,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mouseout [ method ] ** - * Adds a mouseout event handler to the element. + * Adds a mouseout event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -224,7 +224,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmouseout [ method ] ** - * Removes a mouseout event handler from the element. + * Removes a mouseout event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -233,7 +233,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mouseover [ method ] ** - * Adds a mouseover event handler to the element. + * Adds a mouseover event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -241,7 +241,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmouseover [ method ] ** - * Removes a mouseover event handler from the element. + * Removes a mouseover event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -250,7 +250,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.mouseup [ method ] ** - * Adds a mouseup event handler to the element. + * Adds a mouseup event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -258,7 +258,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unmouseup [ method ] ** - * Removes a mouseup event handler from the element. + * Removes a mouseup event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -267,7 +267,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchstart [ method ] ** - * Adds a touchstart event handler to the element. + * Adds a touchstart event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -275,7 +275,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchstart [ method ] ** - * Removes a touchstart event handler from the element. + * Removes a touchstart event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -284,7 +284,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchmove [ method ] ** - * Adds a touchmove event handler to the element. + * Adds a touchmove event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -292,7 +292,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchmove [ method ] ** - * Removes a touchmove event handler from the element. + * Removes a touchmove event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -301,7 +301,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchend [ method ] ** - * Adds a touchend event handler to the element. + * Adds a touchend event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -309,7 +309,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchend [ method ] ** - * Removes a touchend event handler from the element. + * Removes a touchend event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -318,7 +318,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.touchcancel [ method ] ** - * Adds a touchcancel event handler to the element. + * Adds a touchcancel event handler to the element - handler (function) handler for the event = (object) @Element \*/ @@ -326,7 +326,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.untouchcancel [ method ] ** - * Removes a touchcancel event handler from the element. + * Removes a touchcancel event handler from the element - handler (function) handler for the event = (object) @Element \*/ @@ -362,7 +362,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.hover [ method ] ** - * Adds event handlers for hover for the element. + * Adds hover event handlers to the element - f_in (function) handler for hover in - f_out (function) handler for hover out - icontext (object) #optional context for hover in handler @@ -376,7 +376,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.unhover [ method ] ** - * Removes event handlers for hover for the element. + * Removes hover event handlers from the element - f_in (function) handler for hover in - f_out (function) handler for hover out = (object) @Element @@ -393,7 +393,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.drag [ method ] ** - * Adds event handlers for an element's drag gesture. + * Adds event handlers for an element's drag gesture ** - onmove (function) handler for moving - onstart (function) handler for drag start @@ -453,7 +453,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.onDragOver [ method ] ** - * Shortcut for assigning event handler for `drag.over.` event, where id is id of the element (see @Element.id). + * Shortcut to assign event handler for `drag.over.` event, where `id` is the element's `id` (see @Element.id) - f (function) handler for event, first argument would be the element you are dragging over \*/ // elproto.onDragOver = function (f) { @@ -463,7 +463,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.undrag [ method ] ** - * Removes all drag event handlers from given element. + * Removes all drag event handlers from the given element \*/ elproto.undrag = function () { var i = draggable.length; diff --git a/src/path.js b/src/path.js index 3538fdd..bd159c5 100644 --- a/src/path.js +++ b/src/path.js @@ -1046,7 +1046,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.path.getTotalLength [ method ] ** - * Returns length of the given path in pixels. + * Returns the length of the given path in pixels ** - path (string) SVG path string. ** @@ -1057,7 +1057,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.path.getPointAtLength [ method ] ** - * Return coordinates of the point located at the given length on the given path. + * Returns the coordinates of the point located at the given length along the given path ** - path (string) SVG path string - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps VERIFY @@ -1074,7 +1074,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.path.getSubpath [ method ] ** - * Return subpath of a given path between given start and end lengths + * Returns the subpath of a given path between given start and end lengths ** - path (string) SVG path string - from (number) length, in pixels, from the start of the path to the start of the segment VERIFY @@ -1093,7 +1093,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.getTotalLength [ method ] ** - * Returns length of the path in pixels. Only works for `path` elements. + * Returns the length of the path in pixels (only works for `path` elements) = (number) length. \*/ elproto.getTotalLength = function () { @@ -1106,7 +1106,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.getPointAtLength [ method ] ** - * Return coordinates of the point located at the given length on the given path. Only works for `path` elements. + * Returns coordinates of the point located at the given length on the given path (only works for `path` elements) ** - length (number) length, in pixels, from the start of the path, excluding non-rendering jumps VERIFY ** @@ -1125,7 +1125,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.getSubpath [ method ] ** - * Return subpath of a given element from given start and end lengths. Only works for `path` elements. + * Returns subpath of a given element from given start and end lengths (only works for `path` elements) ** - from (number) length, in pixels, from the start of the path to the start of the segment VERIFY - to (number) length, in pixels, from the start of the path to the end of the segment VERIFY @@ -1142,7 +1142,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Find dot coordinates on the given cubic beziér curve at the given t. + * Finds dot coordinates on the given cubic beziér curve at the given t - p1x (number) x of the first point of the curve - p1y (number) y of the first point of the curve - c1x (number) x of the first anchor of the curve @@ -1182,7 +1182,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Return bounding box of a given cubic beziér curve + * Returns the bounding box of a given cubic beziér curve - p1x (number) x of the first point of the curve - p1y (number) y of the first point of the curve - c1x (number) x of the first anchor of the curve @@ -1212,7 +1212,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Returns `true` if given point is inside bounding box. + * Returns `true` if given point is inside bounding box - bbox (string) bounding box - x (string) x coordinate of the point - y (string) y coordinate of the point @@ -1263,7 +1263,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Returns `true` if given point is inside a given closed path. + * Returns `true` if given point is inside a given closed path - path (string) path string - x (number) x of the point - y (number) y of the point @@ -1276,7 +1276,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Return bounding box of a given path + * Returns the bounding box of a given path - path (string) path string = (object) bounding box o { @@ -1296,7 +1296,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Converts path coordinates into relative values. + * Converts path coordinates into relative values - path (string) path string = (array) path string \*/ @@ -1307,7 +1307,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Converts path coordinates into absolute values. + * Converts path coordinates into absolute values - path (string) path string = (array) path string \*/ @@ -1318,7 +1318,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Utility method ** - * Converts path to a new path where all segments are cubic beziér curves. + * Converts path to a new path where all segments are cubic beziér curves - pathString (string|array) path string or array of segments = (array) array of segments. \*/ @@ -1327,7 +1327,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Snap.path.map [ method ] ** - * Transform the path string with given matrix. + * Transform the path string with the given matrix - path (string) path string - matrix (object) see @Matrix = (string) transformed path string diff --git a/src/set.js b/src/set.js index 9a51aa3..f95eb70 100644 --- a/src/set.js +++ b/src/set.js @@ -34,7 +34,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Set.push [ method ] ** - * Adds each argument to the current set. + * Adds each argument to the current set = (object) original element \*/ setproto.push = function () { @@ -54,7 +54,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Set.pop [ method ] ** - * Removes last element and returns it. + * Removes last element and returns it = (object) element \*/ setproto.pop = function () { @@ -65,7 +65,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Set.forEach [ method ] ** - * Executes given function for each element in the set. + * Executes given function for each element in the set * * If the function returns `false`, the loop stops running. ** @@ -102,7 +102,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Set.splice [ method ] ** - * Removes given element from the set + * Removes range of elements from the set ** - index (number) position of the deletion - count (number) number of element to remove diff --git a/src/svg.js b/src/svg.js index 29215fe..ea6c1c2 100644 --- a/src/svg.js +++ b/src/svg.js @@ -19,7 +19,7 @@ Snap.version = "0.0.1"; * Snap [ method ] ** - * Creates drawing surface or wraps existing SVG element. + * Creates a drawing surface or wraps existing SVG element ** - width (number|string) width of surface - height (number|string) height of surface @@ -154,7 +154,7 @@ function is(o, type) { * Snap.format [ method ] ** - * Replaces construction of type `{}` to the corresponding argument. + * Replaces construction of type `{}` to the corresponding argument ** - token (string) string to format - json (object) object which properties are used as a replacement @@ -294,7 +294,7 @@ Snap.deg = deg; * Snap.angle [ method ] ** - * Returns angle between two or three points. + * Returns an angle between two or three points > Parameters - x1 (number) x coord of first point - y1 (number) y coord of first point @@ -309,7 +309,7 @@ Snap.angle = angle; * Snap.is [ method ] ** - * Handy replacement for the `typeof` operator. + * Handy replacement for the `typeof` operator - o (…) any object or primitive - type (string) name of the type, e.g., `string`, `function`, `number`, etc. = (boolean) if given value is of given type @@ -319,7 +319,7 @@ Snap.is = is; * Snap.snapTo [ method ] ** - * Snaps given value to given grid. + * Snaps given value to given grid - values (array|number) given array of values or step of the grid - value (number) value to adjust - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`. VERIFY @@ -377,7 +377,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.add [ method ] ** - * Adds given matrix to existing one. + * Adds the given matrix to existing one - a (number) - b (number) - c (number) @@ -419,7 +419,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.invert [ method ] ** - * Returns inverted version of the matrix + * Returns an inverted version of the matrix = (object) @Matrix \*/ matrixproto.invert = function () { @@ -431,7 +431,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.clone [ method ] ** - * Returns copy of the matrix + * Returns a copy of the matrix = (object) @Matrix \*/ matrixproto.clone = function () { @@ -488,7 +488,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.x [ method ] ** - * Return x coordinate for given point after transformation described by the matrix. See also @Matrix.y + * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y - x (number) - y (number) = (number) x @@ -500,7 +500,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.y [ method ] ** - * Return y coordinate for given point after transformation described by the matrix. See also @Matrix.x + * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x - x (number) - y (number) = (number) y @@ -582,7 +582,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.toTransformString [ method ] ** - * Return transform string that represents given matrix + * Returns transform string that represents given matrix = (string) transform string \*/ matrixproto.toTransformString = function (shorter) { @@ -606,7 +606,7 @@ function Matrix(a, b, c, d, e, f) { ** * Utility method ** - * Returns matrix based on given parameters. + * Returns a matrix based on the given parameters - a (number) - b (number) - c (number) @@ -735,7 +735,7 @@ Snap.getRGB = cacher(function (colour) { * Snap.hsb [ method ] ** - * Converts HSB values to hex representation of the colour. + * Converts HSB values to a hex representation of the colour - h (number) hue - s (number) saturation - b (number) value or brightness @@ -748,7 +748,7 @@ Snap.hsb = cacher(function (h, s, b) { * Snap.hsl [ method ] ** - * Converts HSL values to hex representation of the colour. + * Converts HSL values to a hex representation of the colour - h (number) hue - s (number) saturation - l (number) luminosity @@ -761,7 +761,7 @@ Snap.hsl = cacher(function (h, s, l) { * Snap.rgb [ method ] ** - * Converts RGB values to hex representation of the colour. + * Converts RGB values to a hex representation of the colour - r (number) red - g (number) green - b (number) blue @@ -839,7 +839,7 @@ packageRGB = function (r, g, b, o) { * Snap.color [ method ] ** - * Parses the color string and returns an object featuring the color's component values. + * Parses the color string and returns an object featuring the color's component values - clr (string) color string in one of the supported formats. See @Snap.getRGB. = (object) Combined RGB & HSB object in the following format: o { @@ -894,7 +894,7 @@ Snap.color = function (clr) { * Snap.hsb2rgb [ method ] ** - * Converts HSB values to RGB object. + * Converts HSB values to an RGB object - h (number) hue - s (number) saturation - v (number) value or brightness @@ -930,7 +930,7 @@ Snap.hsb2rgb = function (h, s, v, o) { * Snap.hsl2rgb [ method ] ** - * Converts HSL values to RGB object. + * Converts HSL values to an RGB object - h (number) hue - s (number) saturation - l (number) luminosity @@ -970,7 +970,7 @@ Snap.hsl2rgb = function (h, s, l, o) { * Snap.rgb2hsb [ method ] ** - * Converts RGB values to HSB object. + * Converts RGB values to an HSB object - r (number) red - g (number) green - b (number) blue @@ -1003,7 +1003,7 @@ Snap.rgb2hsb = function (r, g, b) { * Snap.rgb2hsl [ method ] ** - * Converts RGB values to HSL object. + * Converts RGB values to an HSL object - r (number) red - g (number) green - b (number) blue @@ -1044,7 +1044,7 @@ Snap.rgb2hsl = function (r, g, b) { ** * Utility method ** - * Parses given path string into an array of arrays of path segments. + * Parses given path string into an array of arrays of path segments - pathString (string|array) path string or array of segments (in the last case it is returned straight away) = (array) array of segments. \*/ @@ -1098,7 +1098,7 @@ Snap.parsePathString = function (pathString) { ** * Utility method ** - * Parses given transform string into an array of transformations. + * Parses given transform string into an array of transformations - TString (string|array) transform string or array of transformations (in the last case it is returned straight away) = (array) array of transformations. \*/ @@ -1364,7 +1364,7 @@ function unit2px(el, name, value) { * Snap.select [ method ] ** - * Wraps DOM element specified by CSS selector as @Element + * Wraps a DOM element specified by CSS selector as @Element - query (string) CSS selector of the element = (Element) \*/ @@ -1503,7 +1503,7 @@ function arrayFirstValue(arr) { * Element.getBBox [ method ] ** - * Returns bounding box descriptor for the given element. + * Returns the bounding box descriptor for the given element ** = (object) bounding box descriptor: o { @@ -1617,7 +1617,7 @@ function arrayFirstValue(arr) { * Element.parent [ method ] ** - * Returns parent of the element + * Returns the element's parent ** = (Element) parent \*/ @@ -1628,7 +1628,7 @@ function arrayFirstValue(arr) { * Element.append [ method ] ** - * Appends given element to current one. + * Appends the given element to current one ** - el (Element|Set) element to append = (Element) parent @@ -1637,7 +1637,7 @@ function arrayFirstValue(arr) { * Element.add [ method ] ** - * See @Element.append. + * See @Element.append \*/ elproto.append = elproto.add = function (el) { if (el.type == "set") { @@ -1656,7 +1656,7 @@ function arrayFirstValue(arr) { * Element.prepend [ method ] ** - * Prepends given element to current one. + * Prepends the given element to the current one ** - el (Element) element to prepend = (Element) parent @@ -1671,7 +1671,7 @@ function arrayFirstValue(arr) { * Element.before [ method ] ** - * Inserts given element before the current one. + * Inserts given element before the current one ** - el (Element) element to insert = (Element) parent @@ -1687,7 +1687,7 @@ function arrayFirstValue(arr) { * Element.after [ method ] ** - * Inserts given element after the current one. + * Inserts given element after the current one ** - el (Element) element to insert = (Element) parent @@ -1702,7 +1702,7 @@ function arrayFirstValue(arr) { * Element.insertBefore [ method ] ** - * Inserts the element after the given one. + * Inserts the element after the given one ** - el (Element) element next to whom insert to = (Element) parent @@ -1717,7 +1717,7 @@ function arrayFirstValue(arr) { * Element.insertAfter [ method ] ** - * Inserts the element after the given one. + * Inserts the element after the given one ** - el (Element) element next to whom insert to = (Element) parent @@ -1745,7 +1745,7 @@ function arrayFirstValue(arr) { * Element.select [ method ] ** - * Gathers nested @Element matching the given set of CSS selectors. + * Gathers the nested @Element matching the given set of CSS selectors ** - query (string) CSS selector = (Element) result of query selection @@ -1757,7 +1757,7 @@ function arrayFirstValue(arr) { * Element.selectAll [ method ] ** - * Gathers nested @Element objects matching the given set of CSS selectors. + * Gathers nested @Element objects matching the given set of CSS selectors ** - query (string) CSS selector = (Set|array) result of query selection @@ -1774,7 +1774,7 @@ function arrayFirstValue(arr) { * Element.asPX [ method ] ** - * Return given attribute of the element as a `px` value. (Not %, em, etc.) + * Returns given attribute of the element as a `px` value (not %, em, etc.) ** - attr (string) attribute name - value (string) #optional attribute value @@ -1791,7 +1791,7 @@ function arrayFirstValue(arr) { * Element.use [ method ] ** - * Creates `` element linked to the current element. + * Creates a `` element linked to the current element ** = (Element) `` element \*/ @@ -1820,7 +1820,7 @@ function arrayFirstValue(arr) { * Element.clone [ method ] ** - * Creates clone of the element and inserts it after the element. + * Creates a clone of the element and inserts it after the element ** = (Element) the clone \*/ @@ -1900,7 +1900,7 @@ function arrayFirstValue(arr) { * Element.toDefs [ method ] ** - * Moves element to the shared `` area. + * Moves element to the shared `` area ** = (Element) the clone \*/ @@ -1915,7 +1915,7 @@ function arrayFirstValue(arr) { * Element.pattern [ method ] ** - * Creates `` element from the current element. + * Creates a `` element from the current element ** * To create a pattern you have to specify the pattern rect: - x (string|number) @@ -1963,7 +1963,7 @@ function arrayFirstValue(arr) { * Element.marker [ method ] ** - * Creates `` element from the current element. + * Creates a `` element from the current element ** * To create a marker you have to specify the bounding rect and reference point: - x (number) @@ -2026,7 +2026,7 @@ function arrayFirstValue(arr) { * Snap.animation [ method ] ** - * Creates animation object. + * Creates an animation object ** - attr (object) attributes of final destination - duration (number) duration of the animation, in milliseconds @@ -2078,7 +2078,7 @@ function arrayFirstValue(arr) { * Snap.animate [ method ] ** - * Runs generic animation of one number into another with a caring function. + * Runs generic animation of one number into another with a caring function ** - from (number|array) number or array of numbers - to (number|array) number or array of numbers @@ -2111,7 +2111,7 @@ function arrayFirstValue(arr) { * Element.stop [ method ] ** - * Stops all the animations of the current element. + * Stops all the animations for the current element ** = (Element) the element \*/ @@ -2128,7 +2128,7 @@ function arrayFirstValue(arr) { * Element.animate [ method ] ** - * Animate given attributes of the element. + * Animates the given attributes of the element ** - attrs (object) key-value pairs of destination attributes - duration (number) duration of the animation in milliseconds @@ -2190,7 +2190,7 @@ function arrayFirstValue(arr) { * Element.data [ method ] ** - * Adds or retrieves given value associated with given key. + * Adds or retrieves given value associated with given key ** * See also @Element.removeData - key (string) key to store data @@ -2246,7 +2246,7 @@ function arrayFirstValue(arr) { * Element.toString [ method ] ** - * Returns SVG code of the element. Equivalent to `outerHTML` in HTML context. + * Returns SVG code of the element, equivalent to HTML's `outerHTML` = (string) SVG code of the element. \*/ elproto.toString = toString(1); @@ -2254,7 +2254,7 @@ function arrayFirstValue(arr) { * Element.innerSVG [ method ] ** - * Returns SVG code of the element. Equivalent to `innerHTML` in HTML context. + * Returns SVG code of the element's contents, equivalent to HTML's `innerHTML` = (string) SVG code of the element. \*/ elproto.innerSVG = toString(); @@ -2291,7 +2291,7 @@ function arrayFirstValue(arr) { * Snap.parse [ method ] ** - * Parses SVG fragment and converts it into @Fragment. + * Parses SVG fragment and converts it into @Fragment ** - svg (string) SVG string = (Fragment) the fragment @@ -2534,7 +2534,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.el [ method ] ** - * Creates element on paper with a given name and no attributes. + * Creates an element on paper with a given name and no attributes ** - name (string) tag name - attr (object) attributes @@ -2554,7 +2554,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.rect [ method ] * - * Draws a rectangle. + * Draws a rectangle ** - x (number) x coordinate of the top left corner - y (number) y coordinate of the top left corner @@ -2597,7 +2597,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.circle [ method ] ** - * Draws a circle. + * Draws a circle ** - x (number) x coordinate of the centre - y (number) y coordinate of the centre @@ -2625,7 +2625,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.image [ method ] ** - * Embeds an image into the surface. + * Places an image on the surface ** - src (string) URI of the source image - x (number) x offset position @@ -2671,7 +2671,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.ellipse [ method ] ** - * Draws an ellipse. + * Draws an ellipse ** - x (number) x coordinate of the centre - y (number) y coordinate of the centre @@ -2701,7 +2701,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.path [ method ] ** - * Creates a path element using the given string as the path's definition. + * Creates a `` element using the given string as the path's definition - pathString (string) #optional path string in SVG format. * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example: | "M10,20L30,40" @@ -2743,7 +2743,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.g [ method ] ** - * Makes a group element. + * Creates a group element ** - varargs (…) #optional elements to nest within the group = (object) `g` element @@ -2781,7 +2781,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.text [ method ] ** - * Draws a text string. + * Draws a text string ** - x (number) x coordinate position - y (number) y coordinate position @@ -2809,7 +2809,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.line [ method ] ** - * Draws a line. + * Draws a line ** - x1 (number) x coordinate position of the start - y1 (number) y coordinate position of the start @@ -2838,7 +2838,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.polyline [ method ] ** - * Draws a polyline. + * Draws a polyline ** - points (array) array of points * or @@ -2889,7 +2889,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.gradient [ method ] ** - * Creates a gradient element. + * Creates a gradient element ** - gradient (string) gradient descriptor > Gradient Descriptor @@ -2935,8 +2935,8 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Paper.toString [ method ] ** - * Returns SVG code of the @Paper. - = (string) SVG code of the @Paper. + * Returns SVG code for the @Paper + = (string) SVG code for the @Paper. \*/ proto.toString = function () { var f = glob.doc.createDocumentFragment(), @@ -2958,7 +2958,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Snap.ajax [ method ] ** - * Simple implementation of Ajax. + * Simple implementation of Ajax ** - url (string) URL - postData (object|string) data for post request @@ -3010,7 +3010,7 @@ Snap.ajax = function (url, postData, callback, scope){ * Snap.load [ method ] ** - * Loads external SVG file as a @Fragment. For more advanced AJAX see @Snap.ajax. + * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX) ** - url (string) URL - callback (function) callback From ea74a41a4ab7fe944de54b248cd139cf896b05e7 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 21:00:46 -0400 Subject: [PATCH 61/68] GLOBAL: no trailing punctuation in return values --- src/path.js | 6 +++--- src/svg.js | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/path.js b/src/path.js index bd159c5..9e1a329 100644 --- a/src/path.js +++ b/src/path.js @@ -1050,7 +1050,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** - path (string) SVG path string. ** - = (number) length. + = (number) length \*/ Snap.path.getTotalLength = getTotalLength; /*\ @@ -1094,7 +1094,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { [ method ] ** * Returns the length of the path in pixels (only works for `path` elements) - = (number) length. + = (number) length \*/ elproto.getTotalLength = function () { if (this.node.getTotalLength) { @@ -1320,7 +1320,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Converts path to a new path where all segments are cubic beziér curves - pathString (string|array) path string or array of segments - = (array) array of segments. + = (array) array of segments \*/ Snap.path.toCubic = path2curve; /*\ diff --git a/src/svg.js b/src/svg.js index ea6c1c2..59db38d 100644 --- a/src/svg.js +++ b/src/svg.js @@ -277,7 +277,7 @@ function x_y_w_h() { ** * Transform angle to radians - deg (number) angle in degrees - = (number) angle in radians. + = (number) angle in radians \*/ Snap.rad = rad; /*\ @@ -286,7 +286,7 @@ Snap.rad = rad; ** * Transform angle to degrees - rad (number) angle in radians - = (number) angle in degrees. + = (number) angle in degrees \*/ Snap.deg = deg; // SIERRA for which point is the angle calculated? @@ -302,7 +302,7 @@ Snap.deg = deg; - y2 (number) y coord of second point - x3 (number) #optional x coord of third point - y3 (number) #optional y coord of third point - = (number) angle in degrees. + = (number) angle in degrees \*/ Snap.angle = angle; /*\ @@ -323,7 +323,7 @@ Snap.is = is; - values (array|number) given array of values or step of the grid - value (number) value to adjust - tolerance (number) #optional maximum distance to the target value that would trigger the snap. Default is `10`. VERIFY - = (number) adjusted value. + = (number) adjusted value \*/ Snap.snapTo = function (values, value, tolerance) { tolerance = is(tolerance, "finite") ? tolerance : 10; @@ -739,7 +739,7 @@ Snap.getRGB = cacher(function (colour) { - h (number) hue - s (number) saturation - b (number) value or brightness - = (string) hex representation of the colour. + = (string) hex representation of the colour \*/ Snap.hsb = cacher(function (h, s, b) { return Snap.hsb2rgb(h, s, b).hex; @@ -752,7 +752,7 @@ Snap.hsb = cacher(function (h, s, b) { - h (number) hue - s (number) saturation - l (number) luminosity - = (string) hex representation of the colour. + = (string) hex representation of the colour \*/ Snap.hsl = cacher(function (h, s, l) { return Snap.hsl2rgb(h, s, l).hex; @@ -765,7 +765,7 @@ Snap.hsl = cacher(function (h, s, l) { - r (number) red - g (number) green - b (number) blue - = (string) hex representation of the colour. + = (string) hex representation of the colour \*/ Snap.rgb = cacher(function (r, g, b, o) { if (is(o, "finite")) { @@ -1046,7 +1046,7 @@ Snap.rgb2hsl = function (r, g, b) { ** * Parses given path string into an array of arrays of path segments - pathString (string|array) path string or array of segments (in the last case it is returned straight away) - = (array) array of segments. + = (array) array of segments \*/ Snap.parsePathString = function (pathString) { if (!pathString) { @@ -1100,7 +1100,7 @@ Snap.parsePathString = function (pathString) { ** * Parses given transform string into an array of transformations - TString (string|array) transform string or array of transformations (in the last case it is returned straight away) - = (array) array of transformations. + = (array) array of transformations \*/ var parseTransformString = Snap.parseTransformString = function (TString) { if (!TString) { @@ -2246,16 +2246,16 @@ function arrayFirstValue(arr) { * Element.toString [ method ] ** - * Returns SVG code of the element, equivalent to HTML's `outerHTML` - = (string) SVG code of the element. + * Returns SVG code for the element, equivalent to HTML's `outerHTML` + = (string) SVG code for the element \*/ elproto.toString = toString(1); /*\ * Element.innerSVG [ method ] ** - * Returns SVG code of the element's contents, equivalent to HTML's `innerHTML` - = (string) SVG code of the element. + * Returns SVG code for the element's contents, equivalent to HTML's `innerHTML` + = (string) SVG code for the element \*/ elproto.innerSVG = toString(); function toString(type) { @@ -2936,7 +2936,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { [ method ] ** * Returns SVG code for the @Paper - = (string) SVG code for the @Paper. + = (string) SVG code for the @Paper \*/ proto.toString = function () { var f = glob.doc.createDocumentFragment(), From 014026e6d5a695a41d5c11b88422cba12a8040bd Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 21:04:35 -0400 Subject: [PATCH 62/68] GLOBAL: colour => color --- src/path.js | 2 +- src/svg.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/path.js b/src/path.js index 9e1a329..8b3e74e 100644 --- a/src/path.js +++ b/src/path.js @@ -1125,7 +1125,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Element.getSubpath [ method ] ** - * Returns subpath of a given element from given start and end lengths (only works for `path` elements) + * Returns subpath of a given element from given start and end lengths (only works for `path` elements) ** - from (number) length, in pixels, from the start of the path to the start of the segment VERIFY - to (number) length, in pixels, from the start of the path to the end of the segment VERIFY diff --git a/src/svg.js b/src/svg.js index 59db38d..0f06d73 100644 --- a/src/svg.js +++ b/src/svg.js @@ -488,7 +488,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.x [ method ] ** - * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y + * Returns x coordinate for given point after transformation described by the matrix. See also @Matrix.y - x (number) - y (number) = (number) x @@ -500,7 +500,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.y [ method ] ** - * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x + * Returns y coordinate for given point after transformation described by the matrix. See also @Matrix.x - x (number) - y (number) = (number) y @@ -582,7 +582,7 @@ function Matrix(a, b, c, d, e, f) { * Matrix.toTransformString [ method ] ** - * Returns transform string that represents given matrix + * Returns transform string that represents given matrix = (string) transform string \*/ matrixproto.toTransformString = function (shorter) { @@ -623,12 +623,12 @@ Snap.Matrix = Matrix; * Snap.getRGB [ method ] ** - * Parses colour string as RGB object - - colour (string) colour string in one of the following formats: + * Parses color string as RGB object + - color (string) color string in one of the following formats: #
            #
          • Colour name (red, green, cornflowerblue, etc)
          • - #
          • #••• — shortened HTML colour: (#000, #fc0, etc.)
          • - #
          • #•••••• — full length HTML colour: (#000000, #bd2300)
          • + #
          • #••• — shortened HTML color: (#000, #fc0, etc.)
          • + #
          • #•••••• — full length HTML color: (#000000, #bd2300)
          • #
          • rgb(•••, •••, •••) — red, green and blue channels values: (rgb(200, 100, 0))
          • #
          • rgba(•••, •••, •••, •••) — also with opacity
          • #
          • rgb(•••%, •••%, •••%) — same as above, but in %: (rgb(100%, 175%, 0%))
          • @@ -735,11 +735,11 @@ Snap.getRGB = cacher(function (colour) { * Snap.hsb [ method ] ** - * Converts HSB values to a hex representation of the colour + * Converts HSB values to a hex representation of the color - h (number) hue - s (number) saturation - b (number) value or brightness - = (string) hex representation of the colour + = (string) hex representation of the color \*/ Snap.hsb = cacher(function (h, s, b) { return Snap.hsb2rgb(h, s, b).hex; @@ -748,11 +748,11 @@ Snap.hsb = cacher(function (h, s, b) { * Snap.hsl [ method ] ** - * Converts HSL values to a hex representation of the colour + * Converts HSL values to a hex representation of the color - h (number) hue - s (number) saturation - l (number) luminosity - = (string) hex representation of the colour + = (string) hex representation of the color \*/ Snap.hsl = cacher(function (h, s, l) { return Snap.hsl2rgb(h, s, l).hex; @@ -761,11 +761,11 @@ Snap.hsl = cacher(function (h, s, l) { * Snap.rgb [ method ] ** - * Converts RGB values to a hex representation of the colour + * Converts RGB values to a hex representation of the color - r (number) red - g (number) green - b (number) blue - = (string) hex representation of the colour + = (string) hex representation of the color \*/ Snap.rgb = cacher(function (r, g, b, o) { if (is(o, "finite")) { @@ -1774,7 +1774,7 @@ function arrayFirstValue(arr) { * Element.asPX [ method ] ** - * Returns given attribute of the element as a `px` value (not %, em, etc.) + * Returns given attribute of the element as a `px` value (not %, em, etc.) ** - attr (string) attribute name - value (string) #optional attribute value From 9498a62c3476837b9d44235e8f53803939f19545 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 21:05:17 -0400 Subject: [PATCH 63/68] GLOBAL: Colour => Color --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 0f06d73..162db69 100644 --- a/src/svg.js +++ b/src/svg.js @@ -626,7 +626,7 @@ Snap.Matrix = Matrix; * Parses color string as RGB object - color (string) color string in one of the following formats: #
              - #
            • Colour name (red, green, cornflowerblue, etc)
            • + #
            • Color name (red, green, cornflowerblue, etc)
            • #
            • #••• — shortened HTML color: (#000, #fc0, etc.)
            • #
            • #•••••• — full length HTML color: (#000000, #bd2300)
            • #
            • rgb(•••, •••, •••) — red, green and blue channels values: (rgb(200, 100, 0))
            • From 780f9f5326911bdd0b87f2855f3778680a614813 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 21:11:46 -0400 Subject: [PATCH 64/68] GLOBAL: standardize pseudo-JSON object format --- src/path.js | 58 ++++++++++++++++++++++++++--------------------------- src/svg.js | 10 ++++----- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/path.js b/src/path.js index 8b3e74e..bca774b 100644 --- a/src/path.js +++ b/src/path.js @@ -1064,8 +1064,8 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** = (object) representation of the point: o { - o x: (number) x coordinate - o y: (number) y coordinate + o x: (number) x coordinate, + o y: (number) y coordinate, o alpha: (number) angle of derivative o } \*/ @@ -1112,8 +1112,8 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** = (object) representation of the point: o { - o x: (number) x coordinate - o y: (number) y coordinate + o x: (number) x coordinate, + o y: (number) y coordinate, o alpha: (number) angle of derivative o } \*/ @@ -1154,24 +1154,24 @@ Snap.plugin(function (Snap, Element, Paper, glob) { - t (number) position on the curve (0..1) = (object) point information in format: o { - o x: (number) x coordinate of the point - o y: (number) y coordinate of the point + o x: (number) x coordinate of the point, + o y: (number) y coordinate of the point, o m: { - o x: (number) x coordinate of the left anchor + o x: (number) x coordinate of the left anchor, o y: (number) y coordinate of the left anchor - o } + o }, o n: { - o x: (number) x coordinate of the right anchor + o x: (number) x coordinate of the right anchor, o y: (number) y coordinate of the right anchor - o } + o }, o start: { - o x: (number) x coordinate of the start of the curve + o x: (number) x coordinate of the start of the curve, o y: (number) y coordinate of the start of the curve - o } + o }, o end: { - o x: (number) x coordinate of the end of the curve + o x: (number) x coordinate of the end of the curve, o y: (number) y coordinate of the end of the curve - o } + o }, o alpha: (number) angle of the curve derivative at the point o } \*/ @@ -1196,11 +1196,11 @@ Snap.plugin(function (Snap, Element, Paper, glob) { = (object) point information in format: o { o min: { - o x: (number) x coordinate of the left point + o x: (number) x coordinate of the left point, o y: (number) y coordinate of the top point - o } + o }, o max: { - o x: (number) x coordinate of the right point + o x: (number) x coordinate of the right point, o y: (number) y coordinate of the bottom point o } o } @@ -1243,13 +1243,13 @@ Snap.plugin(function (Snap, Element, Paper, glob) { = (array) dots of intersection o [ o { - o x: (number) x coordinate of the point - o y: (number) y coordinate of the point - o t1: (number) t value for segment of path1 - o t2: (number) t value for segment of path2 - o segment1: (number) order number for segment of path1 - o segment2: (number) order number for segment of path2 - o bez1: (array) eight coordinates representing beziér curve for the segment of path1 + o x: (number) x coordinate of the point, + o y: (number) y coordinate of the point, + o t1: (number) t value for segment of path1, + o t2: (number) t value for segment of path2, + o segment1: (number) order number for segment of path1, + o segment2: (number) order number for segment of path2, + o bez1: (array) eight coordinates representing beziér curve for the segment of path1, o bez2: (array) eight coordinates representing beziér curve for the segment of path2 o } o ] @@ -1280,11 +1280,11 @@ Snap.plugin(function (Snap, Element, Paper, glob) { - path (string) path string = (object) bounding box o { - o x: (number) x coordinate of the left top point of the box - o y: (number) y coordinate of the left top point of the box - o x2: (number) x coordinate of the right bottom point of the box - o y2: (number) y coordinate of the right bottom point of the box - o width: (number) width of the box + o x: (number) x coordinate of the left top point of the box, + o y: (number) y coordinate of the left top point of the box, + o x2: (number) x coordinate of the right bottom point of the box, + o y2: (number) y coordinate of the right bottom point of the box, + o width: (number) width of the box, o height: (number) height of the box o } \*/ diff --git a/src/svg.js b/src/svg.js index 162db69..6b0ec3b 100644 --- a/src/svg.js +++ b/src/svg.js @@ -647,7 +647,7 @@ Snap.Matrix = Matrix; o { o r (number) red, o g (number) green, - o b (number) blue + o b (number) blue, o hex (string) color in HTML/CSS format: #••••••, o error (boolean) true if string can't be parsed o } @@ -976,8 +976,8 @@ Snap.hsl2rgb = function (h, s, l, o) { - b (number) blue = (object) HSB object in the following format: o { - o h (number) hue - o s (number) saturation + o h (number) hue, + o s (number) saturation, o b (number) brightness o } \*/ @@ -1009,8 +1009,8 @@ Snap.rgb2hsb = function (r, g, b) { - b (number) blue = (object) HSL object in the following format: o { - o h (number) hue - o s (number) saturation + o h (number) hue, + o s (number) saturation, o l (number) luminosity o } \*/ From ea2fee7d2ab5c4eb01b647347b83cc936dd397ab Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Wed, 9 Oct 2013 21:13:54 -0400 Subject: [PATCH 65/68] GLOBAL: no & in text --- src/set.js | 2 +- src/svg.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/set.js b/src/set.js index f95eb70..7746042 100644 --- a/src/set.js +++ b/src/set.js @@ -142,7 +142,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Removes given element from the set ** - element (object) element to remove - = (boolean) `true` if object was found & removed from the set + = (boolean) `true` if object was found and removed from the set \*/ setproto.exclude = function (el) { for (var i = 0, ii = this.length; i < ii; i++) if (this[i] == el) { diff --git a/src/svg.js b/src/svg.js index 6b0ec3b..08a0b62 100644 --- a/src/svg.js +++ b/src/svg.js @@ -841,7 +841,7 @@ packageRGB = function (r, g, b, o) { ** * Parses the color string and returns an object featuring the color's component values - clr (string) color string in one of the supported formats. See @Snap.getRGB. - = (object) Combined RGB & HSB object in the following format: + = (object) Combined RGB/HSB object in the following format: o { o r (number) red, o g (number) green, From 242df93cd983289aff322e50e1b35683fa0017b3 Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Thu, 10 Oct 2013 06:39:09 -0400 Subject: [PATCH 66/68] EDIT Snap.fragment --- src/svg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.js b/src/svg.js index 08a0b62..a4cea15 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2340,7 +2340,7 @@ Fragment.prototype.selectAll = Element.prototype.selectAll; * Snap.fragment [ method ] ** - * Creates DOM fragment from given list of elements or strings + * Creates a DOM fragment from a given list of elements or strings ** - varargs (…) SVG string = (Fragment) the @Fragment From 613740014e118e7770cae5c88b28bc67c35c571c Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Thu, 10 Oct 2013 10:40:22 -0400 Subject: [PATCH 67/68] GLOBAL: standardize return values --- src/path.js | 6 ++--- src/svg.js | 66 ++++++++++++++++++++++++++--------------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/path.js b/src/path.js index bca774b..1c8ad68 100644 --- a/src/path.js +++ b/src/path.js @@ -1216,7 +1216,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { - bbox (string) bounding box - x (string) x coordinate of the point - y (string) y coordinate of the point - = (boolean) `true` if point inside + = (boolean) `true` if point is inside \*/ Snap.path.isPointInsideBBox = isPointInsideBBox; /*\ @@ -1228,7 +1228,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { * Returns `true` if two bounding boxes intersect - bbox1 (string) first bounding box - bbox2 (string) second bounding box - = (boolean) `true` if they intersect + = (boolean) `true` if bounding boxes intersect \*/ Snap.path.isBBoxIntersect = isBBoxIntersect; /*\ @@ -1267,7 +1267,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { - path (string) path string - x (number) x of the point - y (number) y of the point - = (boolean) true, if point is inside the path + = (boolean) `true` if point is inside the path \*/ Snap.path.isPointInside = isPointInsidePath; /*\ diff --git a/src/svg.js b/src/svg.js index a4cea15..bbddef8 100644 --- a/src/svg.js +++ b/src/svg.js @@ -158,7 +158,7 @@ function is(o, type) { ** - token (string) string to format - json (object) object which properties are used as a replacement - = (string) formated string + = (string) formatted string > Usage | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z" | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", { @@ -312,7 +312,7 @@ Snap.angle = angle; * Handy replacement for the `typeof` operator - o (…) any object or primitive - type (string) name of the type, e.g., `string`, `function`, `number`, etc. - = (boolean) if given value is of given type + = (boolean) `true` if given value is of given type \*/ Snap.is = is; /*\ @@ -1366,7 +1366,7 @@ function unit2px(el, name, value) { ** * Wraps a DOM element specified by CSS selector as @Element - query (string) CSS selector of the element - = (Element) + = (Element) the current element \*/ Snap.select = function (query) { return wrap(glob.doc.querySelector(query)); @@ -1377,7 +1377,7 @@ Snap.select = function (query) { ** * Wraps DOM elements specified by CSS selector as set or array of @Element - query (string) CSS selector of the element - = (Element) + = (Element) the current element \*/ Snap.selectAll = function (query) { var nodelist = glob.doc.querySelectorAll(query), @@ -1463,7 +1463,7 @@ function arrayFirstValue(arr) { - params (object) contains key-value pairs of attributes you want to set * or - param (string) name of the attribute - = (Element) + = (Element) the current element * or = (string) value of attribute > Usage @@ -1566,7 +1566,7 @@ function arrayFirstValue(arr) { * Gets or sets transformation of the element ** - tstr (string) transform string in Snap or SVG format - = (Element) + = (Element) the current element * or = (object) transformation descriptor: o { @@ -1619,7 +1619,7 @@ function arrayFirstValue(arr) { ** * Returns the element's parent ** - = (Element) parent + = (Element) the parent element \*/ elproto.parent = function () { return wrap(this.node.parentNode); @@ -1631,7 +1631,7 @@ function arrayFirstValue(arr) { * Appends the given element to current one ** - el (Element|Set) element to append - = (Element) parent + = (Element) the parent element \*/ /*\ * Element.add @@ -1659,7 +1659,7 @@ function arrayFirstValue(arr) { * Prepends the given element to the current one ** - el (Element) element to prepend - = (Element) parent + = (Element) the parent element \*/ elproto.prepend = function (el) { el = wrap(el); @@ -1674,7 +1674,7 @@ function arrayFirstValue(arr) { * Inserts given element before the current one ** - el (Element) element to insert - = (Element) parent + = (Element) the parent element \*/ // TODO make it work for sets too elproto.before = function (el) { @@ -1690,7 +1690,7 @@ function arrayFirstValue(arr) { * Inserts given element after the current one ** - el (Element) element to insert - = (Element) parent + = (Element) the parent element \*/ elproto.after = function (el) { el = wrap(el); @@ -1705,7 +1705,7 @@ function arrayFirstValue(arr) { * Inserts the element after the given one ** - el (Element) element next to whom insert to - = (Element) parent + = (Element) the parent element \*/ elproto.insertBefore = function (el) { el = wrap(el); @@ -1720,7 +1720,7 @@ function arrayFirstValue(arr) { * Inserts the element after the given one ** - el (Element) element next to whom insert to - = (Element) parent + = (Element) the parent element \*/ elproto.insertAfter = function (el) { el = wrap(el); @@ -1733,7 +1733,7 @@ function arrayFirstValue(arr) { [ method ] ** * Removes element from the DOM - = (Element) removed element + = (Element) the detached element \*/ elproto.remove = function () { this.node.parentNode && this.node.parentNode.removeChild(this.node); @@ -1793,7 +1793,7 @@ function arrayFirstValue(arr) { ** * Creates a `` element linked to the current element ** - = (Element) `` element + = (Element) the `` element \*/ elproto.use = function () { var use, @@ -1922,7 +1922,7 @@ function arrayFirstValue(arr) { - y (string|number) - width (string|number) - height (string|number) - = (Element) `` element + = (Element) the `` element * You can use pattern later on as an argument for `fill` attribute: | var p = paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({ | fill: "none", @@ -1972,7 +1972,7 @@ function arrayFirstValue(arr) { - height (number) - refX (number) - refY (number) - = (Element) `` element + = (Element) the `` element * You can specify the marker later as an argument for `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The `marker` attribute places the marker at every point along the path, and `marker-mid` places them at every point except the start and end. \*/ // TODO add usage for markers @@ -2043,7 +2043,7 @@ function arrayFirstValue(arr) { ** * Returns a set of animations that may be able to manipulate the current element VERIFY ** - = (object) in format + = (object) in format: o { o anim (object) animation object, o curStatus (number) 0..1 — status of the animation: 0 — just started, 1 — just finished, @@ -2113,7 +2113,7 @@ function arrayFirstValue(arr) { ** * Stops all the animations for the current element ** - = (Element) the element + = (Element) the current element \*/ elproto.stop = function () { var anims = this.inAnim(); @@ -2134,7 +2134,7 @@ function arrayFirstValue(arr) { - duration (number) duration of the animation in milliseconds - easing (function) #optional easing function from @mina or custom - callback (function) #optional callback function that executes when the animation ends VERIFY - = (Element) the element + = (Element) the current element \*/ elproto.animate = function (attrs, ms, easing, callback) { if (typeof easing == "function" && !easing.length) { @@ -2291,10 +2291,10 @@ function arrayFirstValue(arr) { * Snap.parse [ method ] ** - * Parses SVG fragment and converts it into @Fragment + * Parses SVG fragment and converts it into a @Fragment ** - svg (string) SVG string - = (Fragment) the fragment + = (Fragment) the @Fragment \*/ Snap.parse = function (svg) { var f = glob.doc.createDocumentFragment(), @@ -2538,7 +2538,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { ** - name (string) tag name - attr (object) attributes - = (Element) the element + = (Element) the current element > Usage | var c = paper.circle(10, 10, 10); // is the same as... | var c = paper.el("circle").attr({ @@ -2562,7 +2562,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - height (number) height - rx (number) #optional horizontal radius for rounded corners, default is 0 - ry (number) #optional vertical radius for rounded corners, default is rx or 0 - = (object) `rect` element + = (object) the `rect` element ** > Usage | // regular rectangle @@ -2602,7 +2602,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - x (number) x coordinate of the centre - y (number) y coordinate of the centre - r (number) radius - = (object) `circle` element + = (object) the `circle` element ** > Usage | var c = paper.circle(50, 50, 40); @@ -2632,7 +2632,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y offset position - width (number) width of the image - height (number) height of the image - = (object) `image` element + = (object) the `image` element * or = (object) Raphaël element object with type `image` ** @@ -2677,7 +2677,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y (number) y coordinate of the centre - rx (number) horizontal radius - ry (number) vertical radius - = (object) `ellipse` element + = (object) the `ellipse` element ** > Usage | var c = paper.ellipse(50, 50, 40, 20); @@ -2746,7 +2746,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { * Creates a group element ** - varargs (…) #optional elements to nest within the group - = (object) `g` element + = (object) the `g` element ** > Usage | var c1 = paper.circle(), @@ -2786,7 +2786,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - x (number) x coordinate position - y (number) y coordinate position - text (string|array) The text string to draw or array of strings to nest within separate `` elements - = (object) `text` element + = (object) the `text` element ** > Usage | var t1 = paper.text(50, 50, "Snap"); @@ -2815,7 +2815,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - y1 (number) y coordinate position of the start - x2 (number) x coordinate position of the end - y2 (number) y coordinate position of the end - = (object) `line` element + = (object) the `line` element ** > Usage | var t1 = paper.line(50, 50, 100, 100); @@ -2843,7 +2843,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - points (array) array of points * or - varargs (…) points - = (object) `polyline` element + = (object) the `polyline` element ** > Usage | var p1 = paper.polyline([10, 10, 100, 100]); @@ -2920,7 +2920,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { | paper.circle(50, 50, 40).attr({ | fill: g | }); - = (object) `gradient` element + = (object) the `gradient` element \*/ proto.gradient = function (str) { return gradient(this.defs, str); @@ -2968,7 +2968,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { - url (string) URL - callback (function) callback - scope (object) #optional scope of callback - = (XMLHttpRequest) XMLHttpRequest (just in case) + = (XMLHttpRequest) the XMLHttpRequest object, just in case \*/ Snap.ajax = function (url, postData, callback, scope){ var req = new XMLHttpRequest, From 0d2e937d67164b09306ed88eb0b8211ea31ea15a Mon Sep 17 00:00:00 2001 From: Mike Sierra Date: Thu, 10 Oct 2013 10:46:29 -0400 Subject: [PATCH 68/68] GLOBAL: standardize parameter values --- src/filter.js | 28 ++++++++++++++-------------- src/path.js | 2 +- src/svg.js | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/filter.js b/src/filter.js index 056e1b9..e36371b 100644 --- a/src/filter.js +++ b/src/filter.js @@ -25,7 +25,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Creates a `` element ** - - filstr (string) SVG fragment of filter provided as a string. + - filstr (string) SVG fragment of filter provided as a string = (object) @Element * Note: It is recommended to use filters embedded into the page inside an empty SVG element. > Usage @@ -90,8 +90,8 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the blur filter ** - - x (number) amount of horizontal blur in px. - - y (number) #optional amount of vertical blur in px. + - x (number) amount of horizontal blur, in pixels + - y (number) #optional amount of vertical blur, in pixels = (string) filter representation > Usage | var f = paper.filter(Snap.filter.blur(5, 10)), @@ -117,10 +117,10 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the shadow filter ** - - dx (number) horizontal shift of the shadow in px. - - dy (number) vertical shift of the shadow in px. - - blur (number) #optional amount of blur. - - color (string) #optional color of the shadow. + - dx (number) horizontal shift of the shadow, in pixels + - dy (number) vertical shift of the shadow, in pixels + - blur (number) #optional amount of blur + - color (string) #optional color of the shadow = (string) filter representation > Usage | var f = paper.filter(Snap.filter.shadow(0, 2, 3)), @@ -161,7 +161,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the grayscale filter ** - - amount (number) amount of filter (`0..1`). + - amount (number) amount of filter (`0..1`) = (string) filter representation \*/ Snap.filter.grayscale = function (amount) { @@ -188,7 +188,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the sepia filter ** - - amount (number) amount of filter (`0..1`). + - amount (number) amount of filter (`0..1`) = (string) filter representation \*/ Snap.filter.sepia = function (amount) { @@ -216,7 +216,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the saturate filter ** - - amount (number) amount of filter (`0..1`). + - amount (number) amount of filter (`0..1`) = (string) filter representation \*/ Snap.filter.saturate = function (amount) { @@ -236,7 +236,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the hue-rotate filter ** - - angle (number) angle of rotation. + - angle (number) angle of rotation = (string) filter representation \*/ Snap.filter.hueRotate = function (angle) { @@ -254,7 +254,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the invert filter ** - - amount (number) amount of filter (`0..1`). + - amount (number) amount of filter (`0..1`) = (string) filter representation \*/ Snap.filter.invert = function (amount) { @@ -275,7 +275,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the brightness filter ** - - amount (number) amount of filter (`0..1`). + - amount (number) amount of filter (`0..1`) = (string) filter representation \*/ Snap.filter.brightness = function (amount) { @@ -295,7 +295,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns an SVG markup string for the contrast filter ** - - amount (number) amount of filter (`0..1`). + - amount (number) amount of filter (`0..1`) = (string) filter representation \*/ Snap.filter.contrast = function (amount) { diff --git a/src/path.js b/src/path.js index 1c8ad68..6d709a1 100644 --- a/src/path.js +++ b/src/path.js @@ -1048,7 +1048,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { ** * Returns the length of the given path in pixels ** - - path (string) SVG path string. + - path (string) SVG path string ** = (number) length \*/ diff --git a/src/svg.js b/src/svg.js index bbddef8..d77d588 100644 --- a/src/svg.js +++ b/src/svg.js @@ -840,7 +840,7 @@ packageRGB = function (r, g, b, o) { [ method ] ** * Parses the color string and returns an object featuring the color's component values - - clr (string) color string in one of the supported formats. See @Snap.getRGB. + - clr (string) color string in one of the supported formats (see @Snap.getRGB) = (object) Combined RGB/HSB object in the following format: o { o r (number) red, @@ -2702,7 +2702,7 @@ function gradientRadial(defs, cx, cy, r, fx, fy) { [ method ] ** * Creates a `` element using the given string as the path's definition - - pathString (string) #optional path string in SVG format. + - pathString (string) #optional path string in SVG format * Path string consists of one-letter commands, followed by comma seprarated arguments in numerical form. Example: | "M10,20L30,40" * This example features two commands: `M`, with arguments `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands express coordinates in absolute terms, while lowercase commands express them in relative terms from the most recently declared coordinates.