@antv/component 0.3.7-beta.2 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/component.js +543 -318
- package/build/component.js.map +1 -1
- package/dist/component.min.js +1 -1
- package/lib/axis/base.js +13 -3
- package/lib/axis/circle.js +13 -3
- package/lib/axis/grid.js +23 -40
- package/lib/axis/helix.js +13 -3
- package/lib/axis/line.js +13 -3
- package/lib/axis/polyline.js +13 -3
- package/lib/base.js +11 -3
- package/lib/component.js +13 -3
- package/lib/guide/arc.js +13 -3
- package/lib/guide/base.js +13 -3
- package/lib/guide/data-marker.js +13 -3
- package/lib/guide/data-region.js +13 -3
- package/lib/guide/html.js +13 -3
- package/lib/guide/image.js +13 -3
- package/lib/guide/line.js +13 -3
- package/lib/guide/region.js +13 -3
- package/lib/guide/text.js +13 -3
- package/lib/label/base.js +13 -3
- package/lib/label/utils/greedy.js +1 -3
- package/lib/label/utils/simulate-anneal.js +13 -3
- package/lib/legend/base.js +13 -3
- package/lib/legend/cat-html.js +13 -3
- package/lib/legend/cat-page-html.js +13 -3
- package/lib/legend/category.js +13 -3
- package/lib/legend/color.js +13 -3
- package/lib/legend/continuous.js +13 -3
- package/lib/legend/size-circle.js +13 -3
- package/lib/legend/size.js +13 -3
- package/lib/legend/slider.js +47 -72
- package/lib/tooltip/base.js +13 -3
- package/lib/tooltip/canvas.js +11 -3
- package/lib/tooltip/crosshair.js +13 -3
- package/lib/tooltip/html.js +11 -4
- package/lib/tooltip/mini.js +13 -3
- package/lib/tooltip/mixin/marker-group.js +14 -10
- package/package.json +1 -1
- package/src/axis/grid.js +15 -10
- package/src/legend/slider.js +22 -18
- package/src/tooltip/html.js +0 -1
- package/src/tooltip/mixin/marker-group.js +13 -10
|
@@ -1,12 +1,22 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Base = require('../../base');
|
|
4
14
|
|
|
5
|
-
var SimulateAnneal =
|
|
6
|
-
/*#__PURE__*/
|
|
7
|
-
function (_Base) {
|
|
15
|
+
var SimulateAnneal = /*#__PURE__*/function (_Base) {
|
|
8
16
|
_inheritsLoose(SimulateAnneal, _Base);
|
|
9
17
|
|
|
18
|
+
var _super = _createSuper(SimulateAnneal);
|
|
19
|
+
|
|
10
20
|
function SimulateAnneal() {
|
|
11
21
|
return _Base.apply(this, arguments) || this;
|
|
12
22
|
}
|
package/lib/legend/base.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Util = require('../util');
|
|
@@ -7,11 +17,11 @@ var Component = require('../component');
|
|
|
7
17
|
var _require = require('../const'),
|
|
8
18
|
FONT_FAMILY = _require.FONT_FAMILY;
|
|
9
19
|
|
|
10
|
-
var Legend =
|
|
11
|
-
/*#__PURE__*/
|
|
12
|
-
function (_Component) {
|
|
20
|
+
var Legend = /*#__PURE__*/function (_Component) {
|
|
13
21
|
_inheritsLoose(Legend, _Component);
|
|
14
22
|
|
|
23
|
+
var _super = _createSuper(Legend);
|
|
24
|
+
|
|
15
25
|
var _proto = Legend.prototype;
|
|
16
26
|
|
|
17
27
|
_proto.getDefaultCfg = function getDefaultCfg() {
|
package/lib/legend/cat-html.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Util = require('../util');
|
|
@@ -56,11 +66,11 @@ function findItem(items, refer) {
|
|
|
56
66
|
return rst;
|
|
57
67
|
}
|
|
58
68
|
|
|
59
|
-
var CatHtml =
|
|
60
|
-
/*#__PURE__*/
|
|
61
|
-
function (_Category) {
|
|
69
|
+
var CatHtml = /*#__PURE__*/function (_Category) {
|
|
62
70
|
_inheritsLoose(CatHtml, _Category);
|
|
63
71
|
|
|
72
|
+
var _super = _createSuper(CatHtml);
|
|
73
|
+
|
|
64
74
|
function CatHtml() {
|
|
65
75
|
return _Category.apply(this, arguments) || this;
|
|
66
76
|
}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Util = require('../util');
|
|
@@ -19,11 +29,11 @@ function findNodeByClass(node, className) {
|
|
|
19
29
|
return node.getElementsByClassName(className)[0];
|
|
20
30
|
}
|
|
21
31
|
|
|
22
|
-
var CatPageHtml =
|
|
23
|
-
/*#__PURE__*/
|
|
24
|
-
function (_CatHtml) {
|
|
32
|
+
var CatPageHtml = /*#__PURE__*/function (_CatHtml) {
|
|
25
33
|
_inheritsLoose(CatPageHtml, _CatHtml);
|
|
26
34
|
|
|
35
|
+
var _super = _createSuper(CatPageHtml);
|
|
36
|
+
|
|
27
37
|
function CatPageHtml() {
|
|
28
38
|
return _CatHtml.apply(this, arguments) || this;
|
|
29
39
|
}
|
package/lib/legend/category.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Util = require('../util');
|
|
@@ -30,11 +40,11 @@ function findShapeByName(group, name) {
|
|
|
30
40
|
});
|
|
31
41
|
}
|
|
32
42
|
|
|
33
|
-
var Category =
|
|
34
|
-
/*#__PURE__*/
|
|
35
|
-
function (_Legend) {
|
|
43
|
+
var Category = /*#__PURE__*/function (_Legend) {
|
|
36
44
|
_inheritsLoose(Category, _Legend);
|
|
37
45
|
|
|
46
|
+
var _super = _createSuper(Category);
|
|
47
|
+
|
|
38
48
|
function Category() {
|
|
39
49
|
return _Legend.apply(this, arguments) || this;
|
|
40
50
|
}
|
package/lib/legend/color.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
/**
|
|
@@ -12,11 +22,11 @@ var Util = require('../util');
|
|
|
12
22
|
|
|
13
23
|
var Continuous = require('./continuous');
|
|
14
24
|
|
|
15
|
-
var Color =
|
|
16
|
-
/*#__PURE__*/
|
|
17
|
-
function (_Continuous) {
|
|
25
|
+
var Color = /*#__PURE__*/function (_Continuous) {
|
|
18
26
|
_inheritsLoose(Color, _Continuous);
|
|
19
27
|
|
|
28
|
+
var _super = _createSuper(Color);
|
|
29
|
+
|
|
20
30
|
function Color() {
|
|
21
31
|
return _Continuous.apply(this, arguments) || this;
|
|
22
32
|
}
|
package/lib/legend/continuous.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
/**
|
|
@@ -17,11 +27,11 @@ var TRIGGER_WIDTH = 8;
|
|
|
17
27
|
var Event = Util.Event;
|
|
18
28
|
var Group = Util.Group;
|
|
19
29
|
|
|
20
|
-
var Continuous =
|
|
21
|
-
/*#__PURE__*/
|
|
22
|
-
function (_Legend) {
|
|
30
|
+
var Continuous = /*#__PURE__*/function (_Legend) {
|
|
23
31
|
_inheritsLoose(Continuous, _Legend);
|
|
24
32
|
|
|
33
|
+
var _super = _createSuper(Continuous);
|
|
34
|
+
|
|
25
35
|
function Continuous() {
|
|
26
36
|
return _Legend.apply(this, arguments) || this;
|
|
27
37
|
}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
/**
|
|
@@ -15,11 +25,11 @@ var CIRCLE_GAP = 16;
|
|
|
15
25
|
var MAX_SIZE = 16;
|
|
16
26
|
var MIN_SIZE = 5;
|
|
17
27
|
|
|
18
|
-
var CircleSize =
|
|
19
|
-
/*#__PURE__*/
|
|
20
|
-
function (_Continuous) {
|
|
28
|
+
var CircleSize = /*#__PURE__*/function (_Continuous) {
|
|
21
29
|
_inheritsLoose(CircleSize, _Continuous);
|
|
22
30
|
|
|
31
|
+
var _super = _createSuper(CircleSize);
|
|
32
|
+
|
|
23
33
|
function CircleSize() {
|
|
24
34
|
return _Continuous.apply(this, arguments) || this;
|
|
25
35
|
}
|
package/lib/legend/size.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
/**
|
|
@@ -8,11 +18,11 @@ var Util = require('../util');
|
|
|
8
18
|
|
|
9
19
|
var Continuous = require('./continuous');
|
|
10
20
|
|
|
11
|
-
var Size =
|
|
12
|
-
/*#__PURE__*/
|
|
13
|
-
function (_Continuous) {
|
|
21
|
+
var Size = /*#__PURE__*/function (_Continuous) {
|
|
14
22
|
_inheritsLoose(Size, _Continuous);
|
|
15
23
|
|
|
24
|
+
var _super = _createSuper(Size);
|
|
25
|
+
|
|
16
26
|
function Size() {
|
|
17
27
|
return _Continuous.apply(this, arguments) || this;
|
|
18
28
|
}
|
package/lib/legend/slider.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* @fileOverview The class of slider
|
|
5
3
|
* @author sima.zhang
|
|
@@ -9,18 +7,13 @@ var Util = require('../util');
|
|
|
9
7
|
var DomUtil = Util.DomUtil;
|
|
10
8
|
var Group = Util.Group;
|
|
11
9
|
|
|
12
|
-
var Slider =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_inheritsLoose(Slider, _Group);
|
|
16
|
-
|
|
17
|
-
function Slider() {
|
|
18
|
-
return _Group.apply(this, arguments) || this;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var _proto = Slider.prototype;
|
|
10
|
+
var Slider = function Slider(cfg) {
|
|
11
|
+
Slider.superclass.constructor.call(this, cfg);
|
|
12
|
+
};
|
|
22
13
|
|
|
23
|
-
|
|
14
|
+
Util.extend(Slider, Group);
|
|
15
|
+
Util.augment(Slider, {
|
|
16
|
+
getDefaultCfg: function getDefaultCfg() {
|
|
24
17
|
return {
|
|
25
18
|
/**
|
|
26
19
|
* 范围
|
|
@@ -99,10 +92,9 @@ function (_Group) {
|
|
|
99
92
|
*/
|
|
100
93
|
pageY: null
|
|
101
94
|
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
_proto._beforeRenderUI = function _beforeRenderUI() {
|
|
95
|
+
},
|
|
96
|
+
// arrange the zindex and cursors of each element
|
|
97
|
+
_beforeRenderUI: function _beforeRenderUI() {
|
|
106
98
|
var layout = this.get('layout');
|
|
107
99
|
var backgroundElement = this.get('backgroundElement');
|
|
108
100
|
var minHandleElement = this.get('minHandleElement');
|
|
@@ -121,18 +113,16 @@ function (_Group) {
|
|
|
121
113
|
minHandleElement.attr('cursor', trigerCursor);
|
|
122
114
|
maxHandleElement.attr('cursor', trigerCursor);
|
|
123
115
|
this.sort();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
_proto._renderUI = function _renderUI() {
|
|
116
|
+
},
|
|
117
|
+
// rendering
|
|
118
|
+
_renderUI: function _renderUI() {
|
|
128
119
|
if (this.get('layout') === 'horizontal') {
|
|
129
120
|
this._renderHorizontal();
|
|
130
121
|
} else {
|
|
131
122
|
this._renderVertical();
|
|
132
123
|
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
_proto._transform = function _transform(layout) {
|
|
124
|
+
},
|
|
125
|
+
_transform: function _transform(layout) {
|
|
136
126
|
var range = this.get('range');
|
|
137
127
|
var minRatio = range[0] / 100;
|
|
138
128
|
var maxRatio = range[1] / 100;
|
|
@@ -163,22 +153,18 @@ function (_Group) {
|
|
|
163
153
|
minHandleElement.translate(1, (1 - minRatio) * height);
|
|
164
154
|
maxHandleElement.translate(1, (1 - maxRatio) * height);
|
|
165
155
|
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
_proto._renderHorizontal = function _renderHorizontal() {
|
|
156
|
+
},
|
|
157
|
+
_renderHorizontal: function _renderHorizontal() {
|
|
169
158
|
this._transform('horizontal');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
_proto._renderVertical = function _renderVertical() {
|
|
159
|
+
},
|
|
160
|
+
_renderVertical: function _renderVertical() {
|
|
173
161
|
this._transform('vertical');
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
_proto._bindUI = function _bindUI() {
|
|
162
|
+
},
|
|
163
|
+
_bindUI: function _bindUI() {
|
|
177
164
|
this.on('mousedown', Util.wrapBehavior(this, '_onMouseDown'));
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
_proto._isElement = function _isElement(target, name) {
|
|
165
|
+
},
|
|
166
|
+
// if the target matches name
|
|
167
|
+
_isElement: function _isElement(target, name) {
|
|
182
168
|
var element = this.get(name);
|
|
183
169
|
|
|
184
170
|
if (target === element) {
|
|
@@ -191,18 +177,16 @@ function (_Group) {
|
|
|
191
177
|
}
|
|
192
178
|
|
|
193
179
|
return false;
|
|
194
|
-
}
|
|
180
|
+
},
|
|
181
|
+
// get the result range after adding diff to range
|
|
195
182
|
// insure that the result out of the interval [0, 100]
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
_proto._getRange = function _getRange(diff, range) {
|
|
183
|
+
_getRange: function _getRange(diff, range) {
|
|
199
184
|
var rst = diff + range;
|
|
200
185
|
rst = rst > 100 ? 100 : rst;
|
|
201
186
|
rst = rst < 0 ? 0 : rst;
|
|
202
187
|
return rst;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
_proto._updateStatus = function _updateStatus(dim, ev) {
|
|
188
|
+
},
|
|
189
|
+
_updateStatus: function _updateStatus(dim, ev) {
|
|
206
190
|
var totalLength = dim === 'x' ? this.get('width') : this.get('height');
|
|
207
191
|
dim = Util.upperFirst(dim);
|
|
208
192
|
var range = this.get('range');
|
|
@@ -258,10 +242,9 @@ function (_Group) {
|
|
|
258
242
|
this.get('canvas').draw(); // need delete
|
|
259
243
|
|
|
260
244
|
return;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
_proto._onMouseDown = function _onMouseDown(ev) {
|
|
245
|
+
},
|
|
246
|
+
// the listener of mouse down
|
|
247
|
+
_onMouseDown: function _onMouseDown(ev) {
|
|
265
248
|
var currentTarget = ev.currentTarget;
|
|
266
249
|
var originEvent = ev.event;
|
|
267
250
|
var range = this.get('range');
|
|
@@ -274,18 +257,16 @@ function (_Group) {
|
|
|
274
257
|
this.set('rangeStash', [range[0], range[1]]);
|
|
275
258
|
|
|
276
259
|
this._bindCanvasEvents();
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
_proto._bindCanvasEvents = function _bindCanvasEvents() {
|
|
260
|
+
},
|
|
261
|
+
_bindCanvasEvents: function _bindCanvasEvents() {
|
|
280
262
|
var containerDOM = this.get('canvas').get('containerDOM'); // this.on('mousemove', Util.wrapBehavior(this, '_onCanvasMouseMove'));
|
|
281
263
|
|
|
282
264
|
this.onMouseMoveListener = DomUtil.addEventListener(containerDOM, 'mousemove', Util.wrapBehavior(this, '_onCanvasMouseMove'));
|
|
283
265
|
this.onMouseUpListener = DomUtil.addEventListener(containerDOM, 'mouseup', Util.wrapBehavior(this, '_onCanvasMouseUp'));
|
|
284
266
|
this.onMouseLeaveListener = DomUtil.addEventListener(containerDOM, 'mouseleave', Util.wrapBehavior(this, '_onCanvasMouseUp'));
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
_proto._onCanvasMouseMove = function _onCanvasMouseMove(ev) {
|
|
267
|
+
},
|
|
268
|
+
// listener of mouse click and move = drag
|
|
269
|
+
_onCanvasMouseMove: function _onCanvasMouseMove(ev) {
|
|
289
270
|
if (!this._mouseOutArea(ev)) {
|
|
290
271
|
var layout = this.get('layout');
|
|
291
272
|
|
|
@@ -295,21 +276,18 @@ function (_Group) {
|
|
|
295
276
|
this._updateStatus('y', ev);
|
|
296
277
|
}
|
|
297
278
|
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
_proto._onCanvasMouseUp = function _onCanvasMouseUp() {
|
|
279
|
+
},
|
|
280
|
+
// listener of mouse up
|
|
281
|
+
_onCanvasMouseUp: function _onCanvasMouseUp() {
|
|
302
282
|
this._removeDocumentEvents();
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
_proto._removeDocumentEvents = function _removeDocumentEvents() {
|
|
283
|
+
},
|
|
284
|
+
// remove listeners
|
|
285
|
+
_removeDocumentEvents: function _removeDocumentEvents() {
|
|
307
286
|
this.onMouseMoveListener.remove();
|
|
308
287
|
this.onMouseUpListener.remove();
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
_proto._mouseOutArea = function _mouseOutArea(ev) {
|
|
288
|
+
},
|
|
289
|
+
// if the mouse is out of the area
|
|
290
|
+
_mouseOutArea: function _mouseOutArea(ev) {
|
|
313
291
|
var el = this.get('canvas').get('el');
|
|
314
292
|
var el_bbox = el.getBoundingClientRect();
|
|
315
293
|
var parent = this.get('parent');
|
|
@@ -326,9 +304,6 @@ function (_Group) {
|
|
|
326
304
|
}
|
|
327
305
|
|
|
328
306
|
return false;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
return Slider;
|
|
332
|
-
}(Group);
|
|
333
|
-
|
|
307
|
+
}
|
|
308
|
+
});
|
|
334
309
|
module.exports = Slider;
|
package/lib/tooltip/base.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Component = require('../base');
|
|
4
14
|
|
|
5
15
|
var Util = require('../util');
|
|
6
16
|
|
|
7
|
-
var Tooltip =
|
|
8
|
-
/*#__PURE__*/
|
|
9
|
-
function (_Component) {
|
|
17
|
+
var Tooltip = /*#__PURE__*/function (_Component) {
|
|
10
18
|
_inheritsLoose(Tooltip, _Component);
|
|
11
19
|
|
|
20
|
+
var _super = _createSuper(Tooltip);
|
|
21
|
+
|
|
12
22
|
function Tooltip() {
|
|
13
23
|
return _Component.apply(this, arguments) || this;
|
|
14
24
|
}
|
package/lib/tooltip/canvas.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
1
5
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2
6
|
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
3
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
4
12
|
|
|
5
13
|
var G = require('@antv/g/lib');
|
|
@@ -20,11 +28,11 @@ var _require = require('../const'),
|
|
|
20
28
|
var DomUtil = Util.DomUtil;
|
|
21
29
|
var MatrixUtil = Util.MatrixUtil;
|
|
22
30
|
|
|
23
|
-
var CanvasTooltip =
|
|
24
|
-
/*#__PURE__*/
|
|
25
|
-
function (_Tooltip) {
|
|
31
|
+
var CanvasTooltip = /*#__PURE__*/function (_Tooltip) {
|
|
26
32
|
_inheritsLoose(CanvasTooltip, _Tooltip);
|
|
27
33
|
|
|
34
|
+
var _super = _createSuper(CanvasTooltip);
|
|
35
|
+
|
|
28
36
|
var _proto = CanvasTooltip.prototype;
|
|
29
37
|
|
|
30
38
|
_proto.getDefaultCfg = function getDefaultCfg() {
|
package/lib/tooltip/crosshair.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Component = require('../component');
|
|
4
14
|
|
|
5
15
|
var Util = require('../util');
|
|
6
16
|
|
|
7
|
-
var Crosshair =
|
|
8
|
-
/*#__PURE__*/
|
|
9
|
-
function (_Component) {
|
|
17
|
+
var Crosshair = /*#__PURE__*/function (_Component) {
|
|
10
18
|
_inheritsLoose(Crosshair, _Component);
|
|
11
19
|
|
|
20
|
+
var _super = _createSuper(Crosshair);
|
|
21
|
+
|
|
12
22
|
var _proto = Crosshair.prototype;
|
|
13
23
|
|
|
14
24
|
_proto.getDefaultCfg = function getDefaultCfg() {
|
package/lib/tooltip/html.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
4
|
+
|
|
5
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
6
|
+
|
|
3
7
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
4
8
|
|
|
9
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
+
|
|
11
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
+
|
|
5
13
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
6
14
|
|
|
7
15
|
var G = require('@antv/g/lib');
|
|
@@ -42,11 +50,11 @@ function mergeStyles(styles, cfg) {
|
|
|
42
50
|
return styles;
|
|
43
51
|
}
|
|
44
52
|
|
|
45
|
-
var HtmlTooltip =
|
|
46
|
-
/*#__PURE__*/
|
|
47
|
-
function (_Tooltip) {
|
|
53
|
+
var HtmlTooltip = /*#__PURE__*/function (_Tooltip) {
|
|
48
54
|
_inheritsLoose(HtmlTooltip, _Tooltip);
|
|
49
55
|
|
|
56
|
+
var _super = _createSuper(HtmlTooltip);
|
|
57
|
+
|
|
50
58
|
var _proto = HtmlTooltip.prototype;
|
|
51
59
|
|
|
52
60
|
_proto.getDefaultCfg = function getDefaultCfg() {
|
|
@@ -150,7 +158,6 @@ function (_Tooltip) {
|
|
|
150
158
|
var container = self._getHtmlContent();
|
|
151
159
|
|
|
152
160
|
outterNode.appendChild(container);
|
|
153
|
-
DomUtil.modifyCSS(container, self.style[CONTAINER_CLASS]);
|
|
154
161
|
self.set('container', container);
|
|
155
162
|
} else {
|
|
156
163
|
self._renderTpl();
|
package/lib/tooltip/mini.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
2
|
+
|
|
3
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
4
|
+
|
|
5
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
6
|
+
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
|
|
9
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
10
|
+
|
|
1
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
12
|
|
|
3
13
|
var Util = require('../util');
|
|
@@ -10,11 +20,11 @@ var _require = require('../const'),
|
|
|
10
20
|
var DomUtil = Util.DomUtil;
|
|
11
21
|
var MatrixUtil = Util.MatrixUtil;
|
|
12
22
|
|
|
13
|
-
var MiniTooltip =
|
|
14
|
-
/*#__PURE__*/
|
|
15
|
-
function (_CanvasTooltip) {
|
|
23
|
+
var MiniTooltip = /*#__PURE__*/function (_CanvasTooltip) {
|
|
16
24
|
_inheritsLoose(MiniTooltip, _CanvasTooltip);
|
|
17
25
|
|
|
26
|
+
var _super = _createSuper(MiniTooltip);
|
|
27
|
+
|
|
18
28
|
function MiniTooltip() {
|
|
19
29
|
return _CanvasTooltip.apply(this, arguments) || this;
|
|
20
30
|
}
|