- added `npm build:dev` to let you develop without getting too annoyed
- added `beziere()` and `steps()` to generate easing functions
- added `insertAfter()` and `insertBefore`
-- added `SVG.Style` which can be created with `style()` or `fontface()`
+- added `SVG.Style` which can be created with `style()` or `fontface()` (#517)
+- added `EventTarget` which is a baseclass to get event abilities (#641)
+- added `Dom` which is a baseclass to get dom abilities
### Removed
- removed `SVG.Array.split()` function
* @copyright Wout Fierens <wout@mick-wout.com>
* @license MIT
*
-* BUILT: Thu Nov 08 2018 11:29:15 GMT+0100 (GMT+01:00)
+* BUILT: Thu Nov 08 2018 12:02:46 GMT+0100 (GMT+01:00)
*/;
var SVG = (function () {
'use strict';
function height(height) {
return height == null ? this.ry() * 2 : this.ry(new SVGNumber(height).divide(2));
- } // Custom size function
-
- function size(width, height) {
- var p = proportionalSize(this, width, height);
- return this.rx(new SVGNumber(p.width).divide(2)).ry(new SVGNumber(p.height).divide(2));
}
var circled = /*#__PURE__*/Object.freeze({
cx: cx,
cy: cy,
width: width,
- height: height,
- size: size
+ height: height
});
var Queue =
return this.cx(x$$1).cy(y$$1);
},
// Add animatable size
- size: function size$$1(width$$1, height$$1) {
+ size: function size(width$$1, height$$1) {
// animate bbox based size for all other elements
var box;
value: function ry$$1(_ry) {
return this.rx(_ry);
}
+ }, {
+ key: "size",
+ value: function size(_size) {
+ return this.radius(new SVGNumber(_size).divide(2));
+ }
}]);
return Circle;
cx: cx,
cy: cy,
width: width,
- height: height,
- size: size
+ height: height
});
registerMethods({
Element: {
// Create circle element
- circle: function circle(size$$1) {
- return this.put(new Circle()).radius(new SVGNumber(size$$1).divide(2)).move(0, 0);
+ circle: function circle(size) {
+ return this.put(new Circle()).size(size).move(0, 0);
}
}
});
return _possibleConstructorReturn(this, _getPrototypeOf(Ellipse).call(this, nodeOrNew('ellipse', node), Ellipse));
}
+ _createClass(Ellipse, [{
+ key: "size",
+ value: function size(width$$1, height$$1) {
+ var p = proportionalSize(this, width$$1, height$$1);
+ return this.rx(new SVGNumber(p.width).divide(2)).ry(new SVGNumber(p.height).divide(2));
+ }
+ }]);
+
return Ellipse;
}(Shape);
extend(Ellipse, circled);
return this.attr('points', this.array().move(x, y));
} // Set element size to given width and height
- function size$1(width, height) {
+ function size(width, height) {
var p = proportionalSize(this, width, height);
return this.attr('points', this.array().size(p.width, p.height));
}
plot: plot,
clear: clear,
move: move,
- size: size$1
+ size: size
});
var Polygon =
-import { cx, cy, height, size, width, x, y } from '../modules/core/circled.js'
+import { cx, cy, height, width, x, y } from '../modules/core/circled.js'
import { extend, nodeOrNew, register } from '../utils/adopter.js'
import { registerMethods } from '../utils/methods.js'
import SVGNumber from '../types/SVGNumber.js'
ry (ry) {
return this.rx(ry)
}
+
+ size (size) {
+ return this.radius(new SVGNumber(size).divide(2))
+ }
}
-extend(Circle, { x, y, cx, cy, width, height, size })
+extend(Circle, { x, y, cx, cy, width, height })
registerMethods({
Element: {
// Create circle element
circle (size) {
return this.put(new Circle())
- .radius(new SVGNumber(size).divide(2))
+ .size(size)
.move(0, 0)
}
}
import { extend, nodeOrNew, register } from '../utils/adopter.js'
+import { proportionalSize } from '../utils/utils.js'
import { registerMethods } from '../utils/methods.js'
+import SVGNumber from '../types/SVGNumber.js'
import Shape from './Shape.js'
import * as circled from '../modules/core/circled.js'
constructor (node) {
super(nodeOrNew('ellipse', node), Ellipse)
}
+
+ size (width, height) {
+ var p = proportionalSize(this, width, height)
+
+ return this
+ .rx(new SVGNumber(p.width).divide(2))
+ .ry(new SVGNumber(p.height).divide(2))
+ }
}
extend(Ellipse, circled)
-import { proportionalSize } from '../../utils/utils.js'
import SVGNumber from '../../types/SVGNumber.js'
// Radius x value
? this.ry() * 2
: this.ry(new SVGNumber(height).divide(2))
}
-
-// Custom size function
-export function size (width, height) {
- var p = proportionalSize(this, width, height)
-
- return this
- .rx(new SVGNumber(p.width).divide(2))
- .ry(new SVGNumber(p.height).divide(2))
-}