Lines Matching +defs:h +defs:a

7 // You may obtain a copy of the License at
23 // You may obtain a copy of the License at
45 numsort = function (a, b) {
46 return a - b;
193 * Binds given event handler with a given name. You can use wildcards “`*`” for the names:
203 = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
210 * If you want to put your handler before non-indexed handlers, specify a negative value.
250 | eve.on("click", function (a, b, c) {
251 | console.log(a, b, c); // 1, 2, [event object]
390 * Binds given event handler with a given name to only run once then unbind itself.
445 // You may obtain a copy of the License at
464 isArray = Array.isArray || function (a) {
465 return a instanceof Array ||
466 Object.prototype.toString.call(a) == "[object Array]";
473 diff = function (a, b, A, B) {
474 if (isArray(a)) {
476 for (var i = 0, ii = a.length; i < ii; i++) {
477 res[i] = diff(a[i], b, A[i], B);
481 var dif = (A - a) / (B - b);
483 return a + dif * (bb - b);
490 var a = this;
492 return a.s;
494 var ds = a.s - val;
495 a.b += a.dur * ds;
496 a.B += a.dur * ds;
497 a.s = val;
500 var a = this;
502 return a.spd;
504 a.spd = val;
507 var a = this;
509 return a.dur;
511 a.s = a.s * val / a.dur;
512 a.dur = val;
515 var a = this;
516 delete animations[a.id];
517 a.update();
518 eve("mina.stop." + a.id, a);
521 var a = this;
522 if (a.pdif) {
525 delete animations[a.id];
526 a.update();
527 a.pdif = a.get() - a.b;
530 var a = this;
531 if (!a.pdif) {
534 a.b = a.get() - a.pdif;
535 delete a.pdif;
536 animations[a.id] = a;
539 var a = this,
541 if (isArray(a.start)) {
543 for (var j = 0, jj = a.start.length; j < jj; j++) {
544 res[j] = +a.start[j] +
545 (a.end[j] - a.start[j]) * a.easing(a.s);
548 res = +a.start + (a.end - a.start) * a.easing(a.s);
550 a.set(res);
555 var a = animations[i],
556 b = a.get(),
559 a.s = (b - a.b) / (a.dur / a.spd);
560 if (a.s >= 1) {
562 a.s = 1;
564 (function (a) {
566 eve("mina.finish." + a.id, a);
568 }(a));
570 a.update();
580 - a (number) start _slave_ number
608 mina = function (a, A, b, B, get, set, easing) {
611 start: a,
801 // You may obtain a copy of the License at
817 * Creates a drawing surface or wraps existing SVG element.
829 function Snap(w, h) {
840 if (h == null) {
846 h = h == null ? "100%" : h;
847 return new Paper(w, h);
873 colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
880 pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
982 - json (object) object which properties are used as a replacement
985 | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z"
986 | paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']}z", {
1222 * Returns closest point to a given one on a given path.
1225 - x (number) x coord of a point
1226 - y (number) y coord of a point
1437 * Converts HSB values to a hex representation of the color
1438 - h (number) hue
1443 Snap.hsb = cacher(function (h, s, b) {
1444 return Snap.hsb2rgb(h, s, b).hex;
1450 * Converts HSL values to a hex representation of the color
1451 - h (number) hue
1456 Snap.hsl = cacher(function (h, s, l) {
1457 return Snap.hsl2rgb(h, s, l).hex;
1463 * Converts RGB values to a hex representation of the color
1491 return "hsb(" + [this.h, this.s, this.b] + ")";
1494 return "hsl(" + [this.h, this.s, this.l] + ")";
1549 o h (number) hue,
1557 if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
1564 } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
1577 clr.h = rgb.h;
1584 clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
1596 - h (number) hue
1607 Snap.hsb2rgb = function (h, s, v, o) {
1608 if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
1609 v = h.b;
1610 s = h.s;
1611 o = h.o;
1612 h = h.h;
1614 h *= 360;
1616 h = (h % 360) / 60;
1618 X = C * (1 - abs(h % 2 - 1));
1621 h = ~~h;
1622 R += [C, X, 0, 0, X, C][h];
1623 G += [X, C, C, X, 0, 0][h];
1624 B += [0, 0, X, C, C, X][h];
1632 - h (number) hue
1643 Snap.hsl2rgb = function (h, s, l, o) {
1644 if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
1645 l = h.l;
1646 s = h.s;
1647 h = h.h;
1649 if (h > 1 || s > 1 || l > 1) {
1650 h /= 360;
1654 h *= 360;
1656 h = (h % 360) / 60;
1658 X = C * (1 - abs(h % 2 - 1));
1661 h = ~~h;
1662 R += [C, X, 0, 0, X, C][h];
1663 G += [X, C, C, X, 0, 0][h];
1664 B += [0, 0, X, C, C, X][h];
1677 o h (number) hue,
1698 return {h: H, s: S, b: V, toString: hsbtoString};
1710 o h (number) hue,
1734 return {h: H, s: S, l: L, toString: hsltoString};
1757 var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
1763 Str(pathString).replace(pathCommand, function (a, b, c) {
1766 c.replace(pathValues, function (a, b) {
1811 Str(TString).replace(tCommand, function (a, b, c) {
1814 c.replace(pathValues, function (a, b) {
1852 Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
1924 function (a, b) {
1925 var adown = a.nodeType == 9 ? a.documentElement : a,
1927 return a == bup || !!(bup && bup.nodeType == 1 && (
1930 a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
1933 function (a, b) {
1937 if (b == a) {
2057 * Wraps a DOM element specified by CSS selector as @Element
2127 * Gives you a reference to the DOM object, so you can assign event handlers or just mess around.
2129 | // draw a circle at coordinate 10,10 with radius of 10
2223 * Parses SVG fragment and converts it into a @Fragment
2257 * Creates a DOM fragment from a given list of elements or strings
2286 function Paper(w, h) {
2316 height: h,
2346 * Creates an element on paper with a given name and no attributes
2568 * Loads external SVG file as a @Fragment (see @Snap.ajax for more advanced AJAX)
2629 * Let you write plugins. You pass in a function with five arguments, like this:
2651 // You may obtain a copy of the License at
2680 o h: (number) height,
2683 o r0: (number) radius of a circle that fully encloses the box,
2686 o vb: (string) box as a viewbox command,
3076 * Returns given attribute of the element as a `px` value (not %, em, etc.)
3088 // SIERRA Element.use(): I suggest adding a note about how to access the original element the returned <use> instantiates. It's a part of SVG with which ordinary web developers may be least familiar.
3093 * Creates a `<use>` element linked to the current element
3184 * Creates a clone of the element and inserts it after the element
3214 * Creates a `<pattern>` element from the current element
3216 * To create a pattern you have to specify the pattern rect:
3256 // 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.
3262 * Creates a `<marker>` element from the current element
3264 * To create a marker you have to specify the bounding rect and reference point:
3340 * Returns a set of animations that may be able to manipulate the current element
3355 (function (a) {
3357 anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
3358 mina: a,
3359 curStatus: a.status(),
3361 return a.status(val);
3364 a.stop();
3375 * Runs generic animation of one number into another with a caring function
3632 // You may obtain a copy of the License at
3646 function Matrix(a, b, c, d, e, f) {
3647 if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
3648 this.a = a.a;
3649 this.b = a.b;
3650 this.c = a.c;
3651 this.d = a.d;
3652 this.e = a.e;
3653 this.f = a.f;
3656 if (a != null) {
3657 this.a = +a;
3664 this.a = 1;
3678 - a (number)
3687 matrixproto.add = function (a, b, c, d, e, f) {
3689 m = [[this.a, this.c, this.e], [this.b, this.d, this.f], [0, 0, 1]],
3690 matrix = [[a, c, e], [b, d, f], [0, 0, 1]],
3693 if (a && a instanceof Matrix) {
3694 matrix = [[a.a, a.c, a.e], [a.b, a.d, a.f], [0, 0, 1]];
3706 this.a = out[0][0];
3723 x = me.a * me.d - me.b * me.c;
3724 return new Matrix(me.d / x, -me.b / x, -me.c / x, me.a / x, (me.c * me.f - me.d * me.e) / x, (me.b * me.e - me.a * me.f) / x);
3730 * Returns a copy of the matrix
3734 return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
3770 - a (number) angle of rotation, in degrees
3774 matrixproto.rotate = function (a, x, y) {
3775 a = Snap.rad(a);
3778 var cos = +math.cos(a).toFixed(9),
3779 sin = +math.sin(a).toFixed(9);
3793 return x * this.a + y * this.c + this.e;
3816 function norm(a) {
3817 return a[0] * a[0] + a[1] * a[1];
3819 function normalize(a) {
3820 var mag = math.sqrt(norm(a));
3821 a[0] && (a[0] /= mag);
3822 a[1] && (a[1] /= mag);
3832 return this.a * this.d - this.b * this.c;
3855 var row = [[this.a, this.c], [this.b, this.d]];
3922 * Returns a matrix based on the given parameters
3923 - a (number)
3933 Snap.matrix = function (a, b, c, d, e, f) {
3934 return new Matrix(a, b, c, d, e, f);
3941 // You may obtain a copy of the License at
4353 // You may obtain a copy of the License at
4441 * Checks if the element has a given class name in the list of class names applied to it.
4501 // You may obtain a copy of the License at
4526 reUnit = /[a-z]+$/i,
4541 a = this.attr(name),
4545 aUnit = a.match(reUnit),
4548 val = op(parseFloat(a), +plus[2]);
4550 a = this.asPX(name);
4553 if (isNaN(a) || isNaN(val)) {
4561 var A, B, a = Str(this.attr(name) || ""),
4567 aUnit = a.match(reUnit),
4571 from: parseFloat(a),
4572 to: op(parseFloat(a), +bplus[2]),
4576 a = this.asPX(name);
4578 from: a,
4579 to: op(a, this.asPX(name, bplus[2] + unit)),
4590 // You may obtain a copy of the License at
4606 * Draws a rectangle
4622 proto.rect = function (x, y, w, h, rx, ry) {
4634 height: h
4647 * Draws a circle
4765 // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is, and why it would make life any easier.
4770 * Creates a `<path>` element using the given string as the path's definition
4776 # <p>Here is short list of commands available, for more details see <a href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a path's data attribute's format are described in the SVG specification.">SVG path string format</a> or <a href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about path strings at MDN</a>.</p>
4788 # <tr><td>R</td><td><a href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table>
4789 * * _Catmull-Rom curveto_ is a not standard SVG command and added to make life easier.
4790 * 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.
4793 | // draw a diagonal line:
4809 * Creates a group element
4844 * Creates a nested SVG element.
4884 * Equivalent in behaviour to @Paper.g, except it’s a mask.
4903 * Equivalent in behaviour to @Paper.g, except it’s a pattern.
4945 * Creates a <use> element.
4973 * Creates a <symbol> element.
4993 * Draws a text string
5002 | var t2 = paper.text(50, 50, ["S","n","a","p"]);
5026 * Draws a line
5055 * Draws a polyline
5082 * Draws a polygon. See @Paper.polyline
5211 * Creates a gradient element
5221 * applied. Coordinates specify a linear gradient vector as
5222 * `x1`, `y1`, `x2`, `y2`, or a radial gradient as `cx`, `cy`,
5223 * `r` and optional `fx`, `fy` specifying a focal point away
5224 * from the center of the circle. Specify `<colors>` as a list
5226 * followed by a custom offset value, separated with a colon
5311 // You may obtain a copy of the License at
5325 p2s = /,?([a-z]),?/gi,
5366 h: height,
5757 function rectPath(x, y, w, h, r) {
5762 ["a", r, r, 0, 0, 1, r, r],
5763 ["l", 0, h - r * 2],
5764 ["a", r, r, 0, 0, 1, -r, r],
5766 ["a", r, r, 0, 0, 1, -r, -r],
5767 ["l", 0, r * 2 - h],
5768 ["a", r, r, 0, 0, 1, r, -r],
5772 var res = [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
5776 function ellipsePath(x, y, rx, ry, a) {
5777 if (a == null && ry == null) {
5784 if (a != null) {
5787 x2 = x + rx * Math.cos(-a * rad),
5789 y2 = y + rx * Math.sin(-a * rad),
5790 res = [["M", x1, y1], ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]];
5795 ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
5796 ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
5867 case "a":
5903 case "h":
6081 var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
6082 if (h > 1) {
6083 h = math.sqrt(h);
6084 rx = h * rx;
6085 ry = h * ry;
6162 a, b, c, t, t1, t2, b2ac, sqrtb2ac;
6166 a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
6170 a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
6173 if (abs(a) < 1e-12) {
6183 b2ac = b * b - 4 * c * a;
6188 t1 = (-b + sqrtb2ac) / (2 * a);
6192 t2 = (-b - sqrtb2ac) / (2 * a);
6257 d.qx = d.x * 2 - d.qx; // And make a reflection similar
6455 * Returns the subpath of a given path between given start and end lengths
6467 var a = getSubpathsAtLength(path, to, 1);
6468 return from ? getSubpathsAtLength(a, from).end : a;
6482 // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path> 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?
6501 // 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.
6506 * Returns subpath of a given element from given start and end lengths (only works for `path` elements)
6563 * Returns the bounding box of a given cubic beziér curve
6686 * Returns `true` if given point is inside a given closed path.
6701 * Returns the bounding box of a given path
6743 * Converts path to a new path where all segments are cubic beziér curves
6766 // You may obtain a copy of the License at
6916 * Specifies how to handle a specific attribute when applied
6917 * to a set.
6931 setproto.bind = function (attr, a, b) {
6933 if (typeof a == "function") {
6934 this.bindings[attr] = a;
6939 a.attr(data);
7082 // You may obtain a copy of the License at
7093 reUnit = /[a-z]+$/i,
7133 from = [["m", t1.a, t1.b, t1.c, t1.d, t1.e, t1.f]];
7134 to = [["m", t2.a, t2.b, t2.c, t2.d, t2.e, t2.f]];
7165 var k = 0, i, ii, j, jj, out, a, b = [];
7168 a = ['"' + path[i][0] + '"'];
7170 a[j] = "val[" + (k++) + "]";
7172 out += a + "]";
7199 var A, B, a = Str(this.attr(name) || ""),
7201 if (isNumeric(a) && isNumeric(b)) {
7203 from: parseFloat(a),
7209 A = Snap.color(a);
7233 return equaliseTransform(a, b, function () {
7238 A = Snap.path.toCubic(a, b);
7246 A = Str(a).split(Snap._.separator);
7254 var aUnit = a.match(reUnit),
7258 from: parseFloat(a),
7276 // You may obtain a copy of the License at
7410 * Adds a click event handler to the element
7418 * Removes a click event handler from the element
7427 * Adds a double click event handler to the element
7435 * Removes a double click event handler from the element
7444 * Adds a mousedown event handler to the element
7452 * Removes a mousedown event handler from the element
7461 * Adds a mousemove event handler to the element
7469 * Removes a mousemove event handler from the element
7478 * Adds a mouseout event handler to the element
7486 * Removes a mouseout event handler from the element
7495 * Adds a mouseover event handler to the element
7503 * Removes a mouseover event handler from the element
7512 * Adds a mouseup event handler to the element
7520 * Removes a mouseup event handler from the element
7529 * Adds a touchstart event handler to the element
7537 * Removes a touchstart event handler from the element
7546 * Adds a touchmove event handler to the element
7554 * Removes a touchmove event handler from the element
7563 * Adds a touchend event handler to the element
7571 * Removes a touchend event handler from the element
7580 * Adds a touchcancel event handler to the element
7588 * Removes a touchcancel event handler from the element
7656 // SIERRA Unclear about this sentence: _Additionally following drag events will be triggered: drag.start.<id> on start, drag.end.<id> on end and drag.move.<id> on every move._ Is there a global _drag_ object to which you can assign handlers keyed by an element's ID?
7753 // You may obtain a copy of the License at
7773 * Creates a `<filter>` element
7775 - filstr (string) SVG fragment of filter provided as a string
7931 return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {b} {h} 0 0 0 0 0 1 0"/>', {
7932 a: 0.2126 + 0.7874 * (1 - amount),
7939 h: 0.0722 + 0.9278 * (1 - amount)
7958 return Snap.format('<feColorMatrix type="matrix" values="{a} {b} {c} 0 0 {d} {e} {f} 0 0 {g} {h} {i} 0 0 0 0 0 1 0"/>', {
7959 a: 0.393 + 0.607 * (1 - amount),
7966 h: 0.534 - 0.534 * (1 - amount),
8080 // You may obtain a copy of the License at
8092 firstLetter = /^[^a-z]*([tbmlrc])/i,
8104 = (object|string) Object in format `{dx: , dy: }` also has a string representation as a transformation string