@tabler/core 1.3.1 → 1.4.0
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/README.md +42 -0
- package/dist/css/tabler-flags.css +1 -1
- package/dist/css/tabler-flags.min.css +1 -1
- package/dist/css/tabler-flags.rtl.css +1 -1
- package/dist/css/tabler-flags.rtl.min.css +1 -1
- package/dist/css/tabler-marketing.css +1 -1
- package/dist/css/tabler-marketing.min.css +1 -1
- package/dist/css/tabler-marketing.rtl.css +1 -1
- package/dist/css/tabler-marketing.rtl.min.css +1 -1
- package/dist/css/tabler-payments.css +1 -1
- package/dist/css/tabler-payments.min.css +1 -1
- package/dist/css/tabler-payments.rtl.css +1 -1
- package/dist/css/tabler-payments.rtl.min.css +1 -1
- package/dist/css/tabler-props.css +74 -74
- package/dist/css/tabler-props.css.map +1 -1
- package/dist/css/tabler-props.min.css +2 -2
- package/dist/css/tabler-props.min.css.map +1 -1
- package/dist/css/tabler-props.rtl.css +74 -74
- package/dist/css/tabler-props.rtl.css.map +1 -1
- package/dist/css/tabler-props.rtl.min.css +2 -2
- package/dist/css/tabler-props.rtl.min.css.map +1 -1
- package/dist/css/tabler-socials.css +1 -1
- package/dist/css/tabler-socials.min.css +1 -1
- package/dist/css/tabler-socials.rtl.css +1 -1
- package/dist/css/tabler-socials.rtl.min.css +1 -1
- package/dist/css/tabler-themes.css +1 -1
- package/dist/css/tabler-themes.min.css +1 -1
- package/dist/css/tabler-themes.rtl.css +1 -1
- package/dist/css/tabler-themes.rtl.min.css +1 -1
- package/dist/css/tabler-vendors.css +1 -1
- package/dist/css/tabler-vendors.min.css +1 -1
- package/dist/css/tabler-vendors.rtl.css +1 -1
- package/dist/css/tabler-vendors.rtl.min.css +1 -1
- package/dist/css/tabler.css +649 -428
- package/dist/css/tabler.css.map +1 -1
- package/dist/css/tabler.min.css +2 -2
- package/dist/css/tabler.min.css.map +1 -1
- package/dist/css/tabler.rtl.css +647 -428
- package/dist/css/tabler.rtl.css.map +1 -1
- package/dist/css/tabler.rtl.min.css +2 -2
- package/dist/css/tabler.rtl.min.css.map +1 -1
- package/dist/js/tabler-theme.esm.js +1 -1
- package/dist/js/tabler-theme.esm.js.map +1 -1
- package/dist/js/tabler-theme.esm.min.js +1 -1
- package/dist/js/tabler-theme.js +1 -1
- package/dist/js/tabler-theme.js.map +1 -1
- package/dist/js/tabler-theme.min.js +2 -2
- package/dist/js/tabler-theme.min.js.map +1 -1
- package/dist/js/tabler.esm.js +4 -4
- package/dist/js/tabler.esm.js.map +1 -1
- package/dist/js/tabler.esm.min.js +4 -4
- package/dist/js/tabler.esm.min.js.map +1 -1
- package/dist/js/tabler.js +4 -4
- package/dist/js/tabler.js.map +1 -1
- package/dist/js/tabler.min.js +4 -4
- package/dist/js/tabler.min.js.map +1 -1
- package/dist/libs/@melloware/coloris/dist/esm/coloris.js +9 -3
- package/dist/libs/@melloware/coloris/dist/esm/coloris.min.js +1 -1
- package/dist/libs/@melloware/coloris/dist/umd/coloris.js +9 -3
- package/dist/libs/@melloware/coloris/dist/umd/coloris.min.js +1 -1
- package/dist/libs/@melloware/coloris/package.json +1 -1
- package/dist/libs/countup.js/README.md +2 -2
- package/dist/libs/countup.js/dist/countUp.d.ts +3 -2
- package/dist/libs/countup.js/dist/countUp.js +11 -2
- package/dist/libs/countup.js/dist/countUp.min.js +1 -1
- package/dist/libs/countup.js/dist/countUp.umd.js +1 -1
- package/dist/libs/countup.js/package.json +1 -1
- package/dist/libs/countup.js/src/countUp.spec.ts +75 -25
- package/dist/libs/countup.js/src/countUp.ts +13 -3
- package/dist/libs/fslightbox/index.js +1 -1
- package/dist/libs/fslightbox/package.json +1 -1
- package/dist/libs/fullcalendar/index.global.js +49 -20
- package/dist/libs/fullcalendar/index.global.min.js +2 -2
- package/dist/libs/fullcalendar/package.json +7 -7
- package/dist/libs/jsvectormap/dist/jsvectormap.cjs +240 -224
- package/dist/libs/jsvectormap/dist/jsvectormap.css +83 -57
- package/dist/libs/jsvectormap/dist/jsvectormap.esm.js +240 -224
- package/dist/libs/jsvectormap/dist/jsvectormap.js +240 -224
- package/dist/libs/jsvectormap/dist/jsvectormap.min.css +1 -1
- package/dist/libs/jsvectormap/dist/jsvectormap.min.js +1 -1
- package/dist/libs/jsvectormap/package.json +1 -1
- package/dist/libs/jsvectormap/src/js/components/base.js +0 -5
- package/dist/libs/jsvectormap/src/js/components/concerns/interactable.js +2 -7
- package/dist/libs/jsvectormap/src/js/components/line.js +38 -10
- package/dist/libs/jsvectormap/src/js/components/marker.js +72 -33
- package/dist/libs/jsvectormap/src/js/components/region.js +0 -5
- package/dist/libs/jsvectormap/src/js/components/route.js +76 -0
- package/dist/libs/jsvectormap/src/js/components/tooltip.js +0 -5
- package/dist/libs/jsvectormap/src/js/core/createLines.js +25 -24
- package/dist/libs/jsvectormap/src/js/core/createMarkers.js +15 -20
- package/dist/libs/jsvectormap/src/js/core/createRoutes.js +16 -0
- package/dist/libs/jsvectormap/src/js/core/repositionLines.js +22 -18
- package/dist/libs/jsvectormap/src/js/core/setupContainerEvents.js +2 -2
- package/dist/libs/jsvectormap/src/js/core/setupContainerTouchEvents.js +2 -2
- package/dist/libs/jsvectormap/src/js/core/setupElementEvents.js +7 -3
- package/dist/libs/jsvectormap/src/js/core/setupZoomButtons.js +23 -6
- package/dist/libs/jsvectormap/src/js/defaults/options.js +1 -0
- package/dist/libs/jsvectormap/src/js/eventHandler.js +0 -5
- package/dist/libs/jsvectormap/src/js/index.js +0 -5
- package/dist/libs/jsvectormap/src/js/legend.js +1 -9
- package/dist/libs/jsvectormap/src/js/map.js +36 -13
- package/dist/libs/jsvectormap/src/js/scales/ordinalScale.js +0 -5
- package/dist/libs/jsvectormap/src/js/series.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/baseElement.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/canvasElement.js +2 -7
- package/dist/libs/jsvectormap/src/js/svg/imageElement.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/shapeElement.js +0 -5
- package/dist/libs/jsvectormap/src/js/svg/textElement.js +0 -5
- package/dist/libs/jsvectormap/src/scss/_variables.scss +37 -0
- package/dist/libs/jsvectormap/src/scss/jsvectormap.scss +104 -112
- package/dist/libs/signature_pad/dist/signature_pad.js +133 -87
- package/dist/libs/signature_pad/dist/signature_pad.js.map +1 -1
- package/dist/libs/signature_pad/dist/signature_pad.min.js +2 -2
- package/dist/libs/signature_pad/dist/signature_pad.min.js.map +1 -1
- package/dist/libs/signature_pad/dist/signature_pad.umd.js +133 -87
- package/dist/libs/signature_pad/dist/signature_pad.umd.js.map +1 -1
- package/dist/libs/signature_pad/dist/signature_pad.umd.min.js +2 -2
- package/dist/libs/signature_pad/dist/signature_pad.umd.min.js.map +1 -1
- package/dist/libs/signature_pad/dist/types/signature_pad.d.ts +4 -1
- package/dist/libs/signature_pad/docs/js/signature_pad.umd.min.js +2 -2
- package/dist/libs/signature_pad/docs/js/signature_pad.umd.min.js.map +1 -1
- package/dist/libs/signature_pad/package.json +19 -19
- package/dist/libs/signature_pad/src/signature_pad.ts +84 -28
- package/package.json +9 -9
- package/scss/_bootstrap-components.scss +0 -1
- package/scss/_core.scss +1 -0
- package/scss/_variables.scss +78 -48
- package/scss/layout/_animations.scss +52 -17
- package/scss/layout/_navbar.scss +8 -4
- package/scss/ui/_breadcrumbs.scss +31 -0
- package/scss/ui/_buttons.scss +92 -20
- package/scss/ui/_cards.scss +4 -2
- package/scss/ui/_dropdowns.scss +1 -1
- package/scss/ui/_grid.scss +2 -2
- package/scss/ui/_lists.scss +8 -8
- package/scss/ui/_nav.scss +1 -1
- package/scss/ui/_pagination.scss +4 -4
- package/scss/ui/_stars.scss +0 -4
- package/scss/ui/_switch-icon.scss +6 -2
- package/scss/ui/_tables.scss +1 -1
- package/scss/utils/_hover.scss +47 -0
- package/scss/vendor/_nouislider.scss +2 -2
|
@@ -159,12 +159,6 @@ var inherit = function inherit(target, source) {
|
|
|
159
159
|
|
|
160
160
|
var eventRegistry = {};
|
|
161
161
|
var eventUid = 1;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* ------------------------------------------------------------------------
|
|
165
|
-
* Event Handler
|
|
166
|
-
* ------------------------------------------------------------------------
|
|
167
|
-
*/
|
|
168
162
|
var EventHandler = {
|
|
169
163
|
on: function on(element, event, handler, options) {
|
|
170
164
|
if (options === void 0) {
|
|
@@ -235,8 +229,8 @@ function setupContainerEvents() {
|
|
|
235
229
|
EventHandler.on(this.container, 'wheel', function (event) {
|
|
236
230
|
var deltaY = ((event.deltaY || -event.wheelDelta || event.detail) >> 10 || 1) * 75;
|
|
237
231
|
var rect = _this.container.getBoundingClientRect();
|
|
238
|
-
var offsetX = event.pageX - rect.left - window.
|
|
239
|
-
var offsetY = event.pageY - rect.top - window.
|
|
232
|
+
var offsetX = event.pageX - rect.left - window.scrollX;
|
|
233
|
+
var offsetY = event.pageY - rect.top - window.scrollY;
|
|
240
234
|
var zoomStep = Math.pow(1 + map.params.zoomOnScrollSpeed / 1000, -1.5 * deltaY);
|
|
241
235
|
if (map.tooltip) {
|
|
242
236
|
map._tooltip.hide();
|
|
@@ -303,8 +297,10 @@ function setupElementEvents() {
|
|
|
303
297
|
data.element.hover(true);
|
|
304
298
|
if (showTooltip) {
|
|
305
299
|
map._tooltip.text(data.tooltipText);
|
|
306
|
-
map._tooltip.show();
|
|
307
300
|
map._emit(data.event, [event, map._tooltip, data.code]);
|
|
301
|
+
if (!event.defaultPrevented) {
|
|
302
|
+
map._tooltip.show();
|
|
303
|
+
}
|
|
308
304
|
}
|
|
309
305
|
} else {
|
|
310
306
|
data.element.hover(false);
|
|
@@ -325,14 +321,14 @@ function setupElementEvents() {
|
|
|
325
321
|
|
|
326
322
|
// We're checking if regions/markers|SelectableOne option is presented
|
|
327
323
|
if (map.params[data.type + "sSelectableOne"]) {
|
|
328
|
-
|
|
324
|
+
data.type === 'region' ? map.clearSelectedRegions() : map.clearSelectedMarkers();
|
|
329
325
|
}
|
|
330
326
|
if (data.element.isSelected) {
|
|
331
327
|
element.select(false);
|
|
332
328
|
} else {
|
|
333
329
|
element.select(true);
|
|
334
330
|
}
|
|
335
|
-
map._emit(data.event, [data.code, element.isSelected,
|
|
331
|
+
map._emit(data.event, [data.code, element.isSelected, data.type === 'region' ? map.getSelectedRegions() : map.getSelectedMarkers()]);
|
|
336
332
|
}
|
|
337
333
|
});
|
|
338
334
|
|
|
@@ -347,10 +343,19 @@ function setupElementEvents() {
|
|
|
347
343
|
|
|
348
344
|
function setupZoomButtons() {
|
|
349
345
|
var _this = this;
|
|
350
|
-
var
|
|
351
|
-
var
|
|
352
|
-
|
|
353
|
-
|
|
346
|
+
var zoomInOption = this.params.zoomInButton;
|
|
347
|
+
var zoomOutOption = this.params.zoomOutButton;
|
|
348
|
+
var getZoomButton = function getZoomButton(zoomOption) {
|
|
349
|
+
return typeof zoomOption === 'string' ? document.querySelector(zoomOption) : zoomOption;
|
|
350
|
+
};
|
|
351
|
+
var zoomIn = zoomInOption ? getZoomButton(zoomInOption) : createElement('div', 'jvm-zoom-btn jvm-zoomin', '+', true);
|
|
352
|
+
var zoomOut = zoomOutOption ? getZoomButton(zoomOutOption) : createElement('div', 'jvm-zoom-btn jvm-zoomout', '−', true);
|
|
353
|
+
if (!zoomInOption) {
|
|
354
|
+
this.container.appendChild(zoomIn);
|
|
355
|
+
}
|
|
356
|
+
if (!zoomOutOption) {
|
|
357
|
+
this.container.appendChild(zoomOut);
|
|
358
|
+
}
|
|
354
359
|
var handler = function handler(zoomin) {
|
|
355
360
|
if (zoomin === void 0) {
|
|
356
361
|
zoomin = true;
|
|
@@ -359,8 +364,8 @@ function setupZoomButtons() {
|
|
|
359
364
|
return _this._setScale(zoomin ? _this.scale * _this.params.zoomStep : _this.scale / _this.params.zoomStep, _this._width / 2, _this._height / 2, false, _this.params.zoomAnimate);
|
|
360
365
|
};
|
|
361
366
|
};
|
|
362
|
-
EventHandler.on(
|
|
363
|
-
EventHandler.on(
|
|
367
|
+
EventHandler.on(zoomIn, 'click', handler());
|
|
368
|
+
EventHandler.on(zoomOut, 'click', handler(false));
|
|
364
369
|
}
|
|
365
370
|
|
|
366
371
|
function setupContainerTouchEvents() {
|
|
@@ -380,11 +385,12 @@ function setupContainerTouchEvents() {
|
|
|
380
385
|
}
|
|
381
386
|
if (touches.length == 1) {
|
|
382
387
|
if (lastTouchesLength == 1) {
|
|
388
|
+
var _map$_tooltip;
|
|
383
389
|
transXOld = map.transX;
|
|
384
390
|
transYOld = map.transY;
|
|
385
391
|
map.transX -= (touchX - touches[0].pageX) / map.scale;
|
|
386
392
|
map.transY -= (touchY - touches[0].pageY) / map.scale;
|
|
387
|
-
map._tooltip.hide();
|
|
393
|
+
(_map$_tooltip = map._tooltip) == null || _map$_tooltip.hide();
|
|
388
394
|
map._applyTransform();
|
|
389
395
|
if (transXOld != map.transX || transYOld != map.transY) {
|
|
390
396
|
e.preventDefault();
|
|
@@ -394,9 +400,10 @@ function setupContainerTouchEvents() {
|
|
|
394
400
|
touchY = touches[0].pageY;
|
|
395
401
|
} else if (touches.length == 2) {
|
|
396
402
|
if (lastTouchesLength == 2) {
|
|
403
|
+
var _map$_tooltip2;
|
|
397
404
|
scale = Math.sqrt(Math.pow(touches[0].pageX - touches[1].pageX, 2) + Math.pow(touches[0].pageY - touches[1].pageY, 2)) / touchStartDistance;
|
|
398
405
|
map._setScale(touchStartScale * scale, centerTouchX, centerTouchY);
|
|
399
|
-
map._tooltip.hide();
|
|
406
|
+
(_map$_tooltip2 = map._tooltip) == null || _map$_tooltip2.hide();
|
|
400
407
|
e.preventDefault();
|
|
401
408
|
} else {
|
|
402
409
|
var rect = map.container.getBoundingClientRect();
|
|
@@ -435,6 +442,17 @@ function _assertThisInitialized(e) {
|
|
|
435
442
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
436
443
|
return e;
|
|
437
444
|
}
|
|
445
|
+
function _defineProperties(e, r) {
|
|
446
|
+
for (var t = 0; t < r.length; t++) {
|
|
447
|
+
var o = r[t];
|
|
448
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function _createClass(e, r, t) {
|
|
452
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
453
|
+
writable: !1
|
|
454
|
+
}), e;
|
|
455
|
+
}
|
|
438
456
|
function _createForOfIteratorHelperLoose(r, e) {
|
|
439
457
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
440
458
|
if (t) return (t = t.call(r)).next.bind(t);
|
|
@@ -464,11 +482,34 @@ function _extends() {
|
|
|
464
482
|
function _inheritsLoose(t, o) {
|
|
465
483
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
466
484
|
}
|
|
485
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
486
|
+
if (null == r) return {};
|
|
487
|
+
var t = {};
|
|
488
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
489
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
490
|
+
t[n] = r[n];
|
|
491
|
+
}
|
|
492
|
+
return t;
|
|
493
|
+
}
|
|
467
494
|
function _setPrototypeOf(t, e) {
|
|
468
495
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
469
496
|
return t.__proto__ = e, t;
|
|
470
497
|
}, _setPrototypeOf(t, e);
|
|
471
498
|
}
|
|
499
|
+
function _toPrimitive(t, r) {
|
|
500
|
+
if ("object" != typeof t || !t) return t;
|
|
501
|
+
var e = t[Symbol.toPrimitive];
|
|
502
|
+
if (void 0 !== e) {
|
|
503
|
+
var i = e.call(t, r || "default");
|
|
504
|
+
if ("object" != typeof i) return i;
|
|
505
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
506
|
+
}
|
|
507
|
+
return ("string" === r ? String : Number)(t);
|
|
508
|
+
}
|
|
509
|
+
function _toPropertyKey(t) {
|
|
510
|
+
var i = _toPrimitive(t, "string");
|
|
511
|
+
return "symbol" == typeof i ? i : i + "";
|
|
512
|
+
}
|
|
472
513
|
function _unsupportedIterableToArray(r, a) {
|
|
473
514
|
if (r) {
|
|
474
515
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
@@ -477,11 +518,6 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
477
518
|
}
|
|
478
519
|
}
|
|
479
520
|
|
|
480
|
-
/**
|
|
481
|
-
* ------------------------------------------------------------------------
|
|
482
|
-
* Class Definition
|
|
483
|
-
* ------------------------------------------------------------------------
|
|
484
|
-
*/
|
|
485
521
|
var BaseComponent = /*#__PURE__*/function () {
|
|
486
522
|
function BaseComponent() {}
|
|
487
523
|
var _proto = BaseComponent.prototype;
|
|
@@ -500,11 +536,6 @@ var BaseComponent = /*#__PURE__*/function () {
|
|
|
500
536
|
return BaseComponent;
|
|
501
537
|
}();
|
|
502
538
|
|
|
503
|
-
/**
|
|
504
|
-
* ------------------------------------------------------------------------
|
|
505
|
-
* Interactable
|
|
506
|
-
* ------------------------------------------------------------------------
|
|
507
|
-
*/
|
|
508
539
|
var Interactable = {
|
|
509
540
|
getLabelText: function getLabelText(key, label) {
|
|
510
541
|
if (!label) {
|
|
@@ -514,8 +545,8 @@ var Interactable = {
|
|
|
514
545
|
var params = [];
|
|
515
546
|
|
|
516
547
|
// Pass additional paramater (Marker config object) in case it's a Marker.
|
|
517
|
-
if (this.
|
|
518
|
-
params.push(this.
|
|
548
|
+
if (this.constructor.Name === 'marker') {
|
|
549
|
+
params.push(this.getConfig());
|
|
519
550
|
}
|
|
520
551
|
|
|
521
552
|
// Becuase we need to add the key always at the end
|
|
@@ -560,11 +591,6 @@ var Interactable = {
|
|
|
560
591
|
}
|
|
561
592
|
};
|
|
562
593
|
|
|
563
|
-
/**
|
|
564
|
-
* ------------------------------------------------------------------------
|
|
565
|
-
* Class Definition
|
|
566
|
-
* ------------------------------------------------------------------------
|
|
567
|
-
*/
|
|
568
594
|
var Region = /*#__PURE__*/function (_BaseComponent) {
|
|
569
595
|
function Region(_ref) {
|
|
570
596
|
var _this;
|
|
@@ -639,33 +665,16 @@ function createRegions() {
|
|
|
639
665
|
}
|
|
640
666
|
}
|
|
641
667
|
|
|
642
|
-
|
|
643
|
-
* ------------------------------------------------------------------------
|
|
644
|
-
* Class Definition
|
|
645
|
-
* ------------------------------------------------------------------------
|
|
646
|
-
*/
|
|
668
|
+
var LINE_CLASS = 'jvm-line';
|
|
647
669
|
var Line = /*#__PURE__*/function (_BaseComponent) {
|
|
648
|
-
function Line(
|
|
670
|
+
function Line(options, style) {
|
|
649
671
|
var _this;
|
|
650
|
-
var index = _ref.index,
|
|
651
|
-
map = _ref.map,
|
|
652
|
-
style = _ref.style,
|
|
653
|
-
x1 = _ref.x1,
|
|
654
|
-
y1 = _ref.y1,
|
|
655
|
-
x2 = _ref.x2,
|
|
656
|
-
y2 = _ref.y2,
|
|
657
|
-
group = _ref.group,
|
|
658
|
-
config = _ref.config;
|
|
659
672
|
_this = _BaseComponent.call(this) || this;
|
|
660
|
-
_this.
|
|
661
|
-
_this.
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
y2: y2,
|
|
666
|
-
dataIndex: index
|
|
667
|
-
}, style, group);
|
|
668
|
-
_this.shape.addClass('jvm-line');
|
|
673
|
+
_this._options = options;
|
|
674
|
+
_this._style = {
|
|
675
|
+
initial: style
|
|
676
|
+
};
|
|
677
|
+
_this._draw();
|
|
669
678
|
return _this;
|
|
670
679
|
}
|
|
671
680
|
_inheritsLoose(Line, _BaseComponent);
|
|
@@ -673,113 +682,148 @@ var Line = /*#__PURE__*/function (_BaseComponent) {
|
|
|
673
682
|
_proto.setStyle = function setStyle(property, value) {
|
|
674
683
|
this.shape.setStyle(property, value);
|
|
675
684
|
};
|
|
685
|
+
_proto.getConfig = function getConfig() {
|
|
686
|
+
return this._options.config;
|
|
687
|
+
};
|
|
688
|
+
_proto._draw = function _draw() {
|
|
689
|
+
var _this$_options = this._options,
|
|
690
|
+
index = _this$_options.index,
|
|
691
|
+
group = _this$_options.group,
|
|
692
|
+
map = _this$_options.map;
|
|
693
|
+
var config = {
|
|
694
|
+
d: this._getDAttribute(),
|
|
695
|
+
fill: 'none',
|
|
696
|
+
dataIndex: index
|
|
697
|
+
};
|
|
698
|
+
this.shape = map.canvas.createPath(config, this._style, group);
|
|
699
|
+
this.shape.addClass(LINE_CLASS);
|
|
700
|
+
};
|
|
701
|
+
_proto._getDAttribute = function _getDAttribute() {
|
|
702
|
+
var _this$_options2 = this._options,
|
|
703
|
+
x1 = _this$_options2.x1,
|
|
704
|
+
y1 = _this$_options2.y1,
|
|
705
|
+
x2 = _this$_options2.x2,
|
|
706
|
+
y2 = _this$_options2.y2,
|
|
707
|
+
curvature = _this$_options2.curvature;
|
|
708
|
+
return "M" + x1 + "," + y1 + this._getQCommand(x1, y1, x2, y2, curvature) + x2 + "," + y2;
|
|
709
|
+
};
|
|
710
|
+
_proto._getQCommand = function _getQCommand(x1, y1, x2, y2, curvature) {
|
|
711
|
+
if (!curvature) {
|
|
712
|
+
return ' ';
|
|
713
|
+
}
|
|
714
|
+
var curveX = (x1 + x2) / 2 + curvature * (y2 - y1);
|
|
715
|
+
var curveY = (y1 + y2) / 2 - curvature * (x2 - x1);
|
|
716
|
+
return " Q" + curveX + "," + curveY + " ";
|
|
717
|
+
};
|
|
676
718
|
return Line;
|
|
677
719
|
}(BaseComponent);
|
|
678
720
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
721
|
+
var _excluded = ["curvature"],
|
|
722
|
+
_excluded2 = ["curvature"];
|
|
723
|
+
function createLines(lines) {
|
|
683
724
|
var point1 = false,
|
|
684
725
|
point2 = false;
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
// after the map has loaded so we will append the futured lines to this group as well.
|
|
689
|
-
this.linesGroup = this.linesGroup || this.canvas.createGroup('jvm-lines-group');
|
|
726
|
+
var _this$params$lineStyl = this.params.lineStyle,
|
|
727
|
+
curvature = _this$params$lineStyl.curvature,
|
|
728
|
+
lineStyle = _objectWithoutPropertiesLoose(_this$params$lineStyl, _excluded);
|
|
690
729
|
for (var index in lines) {
|
|
691
|
-
var
|
|
692
|
-
for (var
|
|
693
|
-
var markerConfig =
|
|
694
|
-
if (markerConfig.name ===
|
|
730
|
+
var lineConfig = lines[index];
|
|
731
|
+
for (var _i = 0, _Object$values = Object.values(this._markers); _i < _Object$values.length; _i++) {
|
|
732
|
+
var markerConfig = _Object$values[_i].config;
|
|
733
|
+
if (markerConfig.name === lineConfig.from) {
|
|
695
734
|
point1 = this.getMarkerPosition(markerConfig);
|
|
696
735
|
}
|
|
697
|
-
if (markerConfig.name ===
|
|
736
|
+
if (markerConfig.name === lineConfig.to) {
|
|
698
737
|
point2 = this.getMarkerPosition(markerConfig);
|
|
699
738
|
}
|
|
700
739
|
}
|
|
701
740
|
if (point1 !== false && point2 !== false) {
|
|
741
|
+
var _ref = lineConfig.style || {},
|
|
742
|
+
curvatureOption = _ref.curvature,
|
|
743
|
+
style = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
744
|
+
|
|
702
745
|
// Register lines with unique keys
|
|
703
|
-
this._lines[getLineUid(
|
|
746
|
+
this._lines[getLineUid(lineConfig.from, lineConfig.to)] = new Line({
|
|
704
747
|
index: index,
|
|
705
748
|
map: this,
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
initial: this.params.lineStyle
|
|
709
|
-
}, {
|
|
710
|
-
initial: config.style || {}
|
|
711
|
-
}, true),
|
|
749
|
+
group: this._linesGroup,
|
|
750
|
+
config: lineConfig,
|
|
712
751
|
x1: point1.x,
|
|
713
752
|
y1: point1.y,
|
|
714
753
|
x2: point2.x,
|
|
715
754
|
y2: point2.y,
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
});
|
|
755
|
+
curvature: curvatureOption == 0 ? 0 : curvatureOption || curvature
|
|
756
|
+
}, merge(lineStyle, style, true));
|
|
719
757
|
}
|
|
720
758
|
}
|
|
721
759
|
}
|
|
722
760
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
*/
|
|
761
|
+
var NAME = 'marker';
|
|
762
|
+
var JVM_PREFIX$1 = 'jvm-';
|
|
763
|
+
var MARKER_CLASS = JVM_PREFIX$1 + "element " + JVM_PREFIX$1 + "marker";
|
|
764
|
+
var MARKER_LABEL_CLASS = JVM_PREFIX$1 + "element " + JVM_PREFIX$1 + "label";
|
|
728
765
|
var Marker = /*#__PURE__*/function (_BaseComponent) {
|
|
729
|
-
function Marker(
|
|
766
|
+
function Marker(options, style) {
|
|
730
767
|
var _this;
|
|
731
|
-
var index = _ref.index,
|
|
732
|
-
style = _ref.style,
|
|
733
|
-
label = _ref.label,
|
|
734
|
-
cx = _ref.cx,
|
|
735
|
-
cy = _ref.cy,
|
|
736
|
-
map = _ref.map,
|
|
737
|
-
group = _ref.group;
|
|
738
768
|
_this = _BaseComponent.call(this) || this;
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
_this.
|
|
769
|
+
_this._options = options;
|
|
770
|
+
_this._style = style;
|
|
771
|
+
_this._labelX = null;
|
|
772
|
+
_this._labelY = null;
|
|
773
|
+
_this._offsets = null;
|
|
742
774
|
_this._isImage = !!style.initial.image;
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
dataIndex: index,
|
|
748
|
-
cx: cx,
|
|
749
|
-
cy: cy
|
|
750
|
-
}, style, group);
|
|
751
|
-
_this.shape.addClass('jvm-marker jvm-element');
|
|
775
|
+
_this._draw();
|
|
776
|
+
if (_this._options.label) {
|
|
777
|
+
_this._drawLabel();
|
|
778
|
+
}
|
|
752
779
|
if (_this._isImage) {
|
|
753
780
|
_this.updateLabelPosition();
|
|
754
781
|
}
|
|
755
|
-
if (label) {
|
|
756
|
-
_this._createLabel(_this.config);
|
|
757
|
-
}
|
|
758
782
|
return _this;
|
|
759
783
|
}
|
|
760
784
|
_inheritsLoose(Marker, _BaseComponent);
|
|
761
785
|
var _proto = Marker.prototype;
|
|
786
|
+
_proto.getConfig = function getConfig() {
|
|
787
|
+
return this._options.config;
|
|
788
|
+
};
|
|
762
789
|
_proto.updateLabelPosition = function updateLabelPosition() {
|
|
790
|
+
var map = this._options.map;
|
|
763
791
|
if (this.label) {
|
|
764
792
|
this.label.set({
|
|
765
|
-
x: this._labelX *
|
|
766
|
-
y: this._labelY *
|
|
793
|
+
x: this._labelX * map.scale + this._offsets[0] + map.transX * map.scale + 5 + (this._isImage ? (this.shape.width || 0) / 2 : this.shape.node.r.baseVal.value),
|
|
794
|
+
y: this._labelY * map.scale + map.transY * this._options.map.scale + this._offsets[1]
|
|
767
795
|
});
|
|
768
796
|
}
|
|
769
797
|
};
|
|
770
|
-
_proto.
|
|
771
|
-
var
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
cx =
|
|
776
|
-
cy =
|
|
777
|
-
|
|
778
|
-
|
|
798
|
+
_proto._draw = function _draw() {
|
|
799
|
+
var _this$_options = this._options,
|
|
800
|
+
index = _this$_options.index,
|
|
801
|
+
map = _this$_options.map,
|
|
802
|
+
group = _this$_options.group,
|
|
803
|
+
cx = _this$_options.cx,
|
|
804
|
+
cy = _this$_options.cy;
|
|
805
|
+
var shapeType = this._isImage ? 'createImage' : 'createCircle';
|
|
806
|
+
this.shape = map.canvas[shapeType]({
|
|
807
|
+
dataIndex: index,
|
|
808
|
+
cx: cx,
|
|
809
|
+
cy: cy
|
|
810
|
+
}, this._style, group);
|
|
811
|
+
this.shape.addClass(MARKER_CLASS);
|
|
812
|
+
};
|
|
813
|
+
_proto._drawLabel = function _drawLabel() {
|
|
814
|
+
var _this$_options2 = this._options,
|
|
815
|
+
index = _this$_options2.index,
|
|
816
|
+
map = _this$_options2.map,
|
|
817
|
+
label = _this$_options2.label,
|
|
818
|
+
labelsGroup = _this$_options2.labelsGroup,
|
|
819
|
+
cx = _this$_options2.cx,
|
|
820
|
+
cy = _this$_options2.cy,
|
|
821
|
+
config = _this$_options2.config,
|
|
822
|
+
isRecentlyCreated = _this$_options2.isRecentlyCreated;
|
|
779
823
|
var labelText = this.getLabelText(index, label);
|
|
780
824
|
this._labelX = cx / map.scale - map.transX;
|
|
781
825
|
this._labelY = cy / map.scale - map.transY;
|
|
782
|
-
this._offsets = isRecentlyCreated &&
|
|
826
|
+
this._offsets = isRecentlyCreated && config.offsets ? config.offsets : this.getLabelOffsets(index, label);
|
|
783
827
|
this.label = map.canvas.createText({
|
|
784
828
|
text: labelText,
|
|
785
829
|
dataIndex: index,
|
|
@@ -787,12 +831,17 @@ var Marker = /*#__PURE__*/function (_BaseComponent) {
|
|
|
787
831
|
y: this._labelY,
|
|
788
832
|
dy: '0.6ex'
|
|
789
833
|
}, map.params.markerLabelStyle, labelsGroup);
|
|
790
|
-
this.label.addClass(
|
|
834
|
+
this.label.addClass(MARKER_LABEL_CLASS);
|
|
791
835
|
if (isRecentlyCreated) {
|
|
792
836
|
this.updateLabelPosition();
|
|
793
837
|
}
|
|
794
838
|
};
|
|
795
|
-
return Marker
|
|
839
|
+
return _createClass(Marker, null, [{
|
|
840
|
+
key: "Name",
|
|
841
|
+
get: function get() {
|
|
842
|
+
return NAME;
|
|
843
|
+
}
|
|
844
|
+
}]);
|
|
796
845
|
}(BaseComponent);
|
|
797
846
|
inherit(Marker, Interactable);
|
|
798
847
|
|
|
@@ -804,11 +853,6 @@ function createMarkers(markers, isRecentlyCreated) {
|
|
|
804
853
|
if (isRecentlyCreated === void 0) {
|
|
805
854
|
isRecentlyCreated = false;
|
|
806
855
|
}
|
|
807
|
-
// Create groups for holding markers and markers labels
|
|
808
|
-
// We're checking if `markersGroup` exists or not becuase we may add markers after the map has loaded
|
|
809
|
-
// So we will append the futured markers to this group as well.
|
|
810
|
-
this._markersGroup = this._markersGroup || this.canvas.createGroup('jvm-markers-group');
|
|
811
|
-
this._markerLabelsGroup = this._markerLabelsGroup || this.canvas.createGroup('jvm-markers-labels-group');
|
|
812
856
|
var _loop = function _loop() {
|
|
813
857
|
var config = markers[index];
|
|
814
858
|
var point = _this.getMarkerPosition(config);
|
|
@@ -831,16 +875,14 @@ function createMarkers(markers, isRecentlyCreated) {
|
|
|
831
875
|
var marker = new Marker({
|
|
832
876
|
index: index,
|
|
833
877
|
map: _this,
|
|
834
|
-
// Merge the `markerStyle` object with the marker config `style` if presented.
|
|
835
|
-
style: merge(_this.params.markerStyle, _extends({}, config.style || {}), true),
|
|
836
878
|
label: _this.params.labels && _this.params.labels.markers,
|
|
837
879
|
labelsGroup: _this._markerLabelsGroup,
|
|
838
880
|
cx: point.x,
|
|
839
881
|
cy: point.y,
|
|
840
882
|
group: _this._markersGroup,
|
|
841
|
-
|
|
883
|
+
config: config,
|
|
842
884
|
isRecentlyCreated: isRecentlyCreated
|
|
843
|
-
});
|
|
885
|
+
}, merge(_this.params.markerStyle, _extends({}, config.style || {}), true));
|
|
844
886
|
|
|
845
887
|
// Check for marker duplication
|
|
846
888
|
// this is useful when for example: a user clicks a button for creating marker two times
|
|
@@ -861,11 +903,6 @@ function createMarkers(markers, isRecentlyCreated) {
|
|
|
861
903
|
}
|
|
862
904
|
}
|
|
863
905
|
|
|
864
|
-
/**
|
|
865
|
-
* ------------------------------------------------------------------------
|
|
866
|
-
* Class Definition
|
|
867
|
-
* ------------------------------------------------------------------------
|
|
868
|
-
*/
|
|
869
906
|
var Legend = /*#__PURE__*/function () {
|
|
870
907
|
function Legend(options) {
|
|
871
908
|
if (options === void 0) {
|
|
@@ -888,13 +925,11 @@ var Legend = /*#__PURE__*/function () {
|
|
|
888
925
|
var _proto = Legend.prototype;
|
|
889
926
|
_proto.render = function render() {
|
|
890
927
|
var ticks = this._series.scale.getTicks();
|
|
891
|
-
var inner = createElement('div', 'jvm-legend-inner');
|
|
892
928
|
this._body.innderHTML = '';
|
|
893
929
|
if (this._options.title) {
|
|
894
930
|
var legendTitle = createElement('div', 'jvm-legend-title', this._options.title);
|
|
895
931
|
this._body.appendChild(legendTitle);
|
|
896
932
|
}
|
|
897
|
-
this._body.appendChild(inner);
|
|
898
933
|
for (var i = 0; i < ticks.length; i++) {
|
|
899
934
|
var tick = createElement('div', 'jvm-legend-tick');
|
|
900
935
|
var sample = createElement('div', 'jvm-legend-tick-sample');
|
|
@@ -921,17 +956,12 @@ var Legend = /*#__PURE__*/function () {
|
|
|
921
956
|
}
|
|
922
957
|
var tickText = createElement('div', 'jvm-legend-tick-text', label);
|
|
923
958
|
tick.appendChild(tickText);
|
|
924
|
-
|
|
959
|
+
this._body.appendChild(tick);
|
|
925
960
|
}
|
|
926
961
|
};
|
|
927
962
|
return Legend;
|
|
928
963
|
}();
|
|
929
964
|
|
|
930
|
-
/**
|
|
931
|
-
* ------------------------------------------------------------------------
|
|
932
|
-
* Class Definition
|
|
933
|
-
* ------------------------------------------------------------------------
|
|
934
|
-
*/
|
|
935
965
|
var OrdinalScale = /*#__PURE__*/function () {
|
|
936
966
|
function OrdinalScale(scale) {
|
|
937
967
|
this._scale = scale;
|
|
@@ -953,11 +983,6 @@ var OrdinalScale = /*#__PURE__*/function () {
|
|
|
953
983
|
return OrdinalScale;
|
|
954
984
|
}();
|
|
955
985
|
|
|
956
|
-
/**
|
|
957
|
-
* ------------------------------------------------------------------------
|
|
958
|
-
* Class Definition
|
|
959
|
-
* ------------------------------------------------------------------------
|
|
960
|
-
*/
|
|
961
986
|
var Series = /*#__PURE__*/function () {
|
|
962
987
|
function Series(config, elements, map) {
|
|
963
988
|
if (config === void 0) {
|
|
@@ -1339,27 +1364,34 @@ function getMarkerPosition(_ref) {
|
|
|
1339
1364
|
}
|
|
1340
1365
|
|
|
1341
1366
|
function repositionLines() {
|
|
1342
|
-
var
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
var
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
x2
|
|
1359
|
-
y2
|
|
1367
|
+
var _this = this;
|
|
1368
|
+
var curvature = this.params.lineStyle.curvature;
|
|
1369
|
+
Object.values(this._lines).forEach(function (line) {
|
|
1370
|
+
var startMarker = Object.values(_this._markers).find(function (_ref) {
|
|
1371
|
+
var config = _ref.config;
|
|
1372
|
+
return config.name === line.getConfig().from;
|
|
1373
|
+
});
|
|
1374
|
+
var endMarker = Object.values(_this._markers).find(function (_ref2) {
|
|
1375
|
+
var config = _ref2.config;
|
|
1376
|
+
return config.name === line.getConfig().to;
|
|
1377
|
+
});
|
|
1378
|
+
if (startMarker && endMarker) {
|
|
1379
|
+
var _this$getMarkerPositi = _this.getMarkerPosition(startMarker.config),
|
|
1380
|
+
x1 = _this$getMarkerPositi.x,
|
|
1381
|
+
y1 = _this$getMarkerPositi.y;
|
|
1382
|
+
var _this$getMarkerPositi2 = _this.getMarkerPosition(endMarker.config),
|
|
1383
|
+
x2 = _this$getMarkerPositi2.x,
|
|
1384
|
+
y2 = _this$getMarkerPositi2.y;
|
|
1385
|
+
var curvatureOption = line._options.curvature == 0 ? 0 : line._options.curvature || curvature;
|
|
1386
|
+
var midX = (x1 + x2) / 2;
|
|
1387
|
+
var midY = (y1 + y2) / 2;
|
|
1388
|
+
var curveX = midX + curvatureOption * (y2 - y1);
|
|
1389
|
+
var curveY = midY - curvatureOption * (x2 - x1);
|
|
1390
|
+
line.setStyle({
|
|
1391
|
+
d: "M" + x1 + "," + y1 + " Q" + curveX + "," + curveY + " " + x2 + "," + y2
|
|
1360
1392
|
});
|
|
1361
1393
|
}
|
|
1362
|
-
}
|
|
1394
|
+
});
|
|
1363
1395
|
}
|
|
1364
1396
|
|
|
1365
1397
|
function repositionMarkers() {
|
|
@@ -1432,6 +1464,7 @@ var Defaults = {
|
|
|
1432
1464
|
bindTouchEvents: true,
|
|
1433
1465
|
// Line options
|
|
1434
1466
|
lineStyle: {
|
|
1467
|
+
curvature: 0,
|
|
1435
1468
|
stroke: '#808080',
|
|
1436
1469
|
strokeWidth: 1,
|
|
1437
1470
|
strokeLinecap: 'round'
|
|
@@ -1504,11 +1537,6 @@ var Defaults = {
|
|
|
1504
1537
|
}
|
|
1505
1538
|
};
|
|
1506
1539
|
|
|
1507
|
-
/**
|
|
1508
|
-
* ------------------------------------------------------------------------
|
|
1509
|
-
* Class Definition
|
|
1510
|
-
* ------------------------------------------------------------------------
|
|
1511
|
-
*/
|
|
1512
1540
|
var SVGElement = /*#__PURE__*/function () {
|
|
1513
1541
|
function SVGElement(name, config) {
|
|
1514
1542
|
this.node = this._createElement(name);
|
|
@@ -1553,11 +1581,6 @@ var SVGElement = /*#__PURE__*/function () {
|
|
|
1553
1581
|
return SVGElement;
|
|
1554
1582
|
}();
|
|
1555
1583
|
|
|
1556
|
-
/**
|
|
1557
|
-
* ------------------------------------------------------------------------
|
|
1558
|
-
* Class Definition
|
|
1559
|
-
* ------------------------------------------------------------------------
|
|
1560
|
-
*/
|
|
1561
1584
|
var SVGShapeElement = /*#__PURE__*/function (_SVGElement) {
|
|
1562
1585
|
function SVGShapeElement(name, config, style) {
|
|
1563
1586
|
var _this;
|
|
@@ -1601,11 +1624,6 @@ var SVGShapeElement = /*#__PURE__*/function (_SVGElement) {
|
|
|
1601
1624
|
return SVGShapeElement;
|
|
1602
1625
|
}(SVGElement);
|
|
1603
1626
|
|
|
1604
|
-
/**
|
|
1605
|
-
* ------------------------------------------------------------------------
|
|
1606
|
-
* Class Definition
|
|
1607
|
-
* ------------------------------------------------------------------------
|
|
1608
|
-
*/
|
|
1609
1627
|
var SVGTextElement = /*#__PURE__*/function (_SVGShapeElement) {
|
|
1610
1628
|
function SVGTextElement(config, style) {
|
|
1611
1629
|
return _SVGShapeElement.call(this, 'text', config, style) || this;
|
|
@@ -1618,11 +1636,6 @@ var SVGTextElement = /*#__PURE__*/function (_SVGShapeElement) {
|
|
|
1618
1636
|
return SVGTextElement;
|
|
1619
1637
|
}(SVGShapeElement);
|
|
1620
1638
|
|
|
1621
|
-
/**
|
|
1622
|
-
* ------------------------------------------------------------------------
|
|
1623
|
-
* Class Definition
|
|
1624
|
-
* ------------------------------------------------------------------------
|
|
1625
|
-
*/
|
|
1626
1639
|
var SVGImageElement = /*#__PURE__*/function (_SVGShapeElement) {
|
|
1627
1640
|
function SVGImageElement(config, style) {
|
|
1628
1641
|
return _SVGShapeElement.call(this, 'image', config, style) || this;
|
|
@@ -1667,11 +1680,6 @@ var SVGImageElement = /*#__PURE__*/function (_SVGShapeElement) {
|
|
|
1667
1680
|
return SVGImageElement;
|
|
1668
1681
|
}(SVGShapeElement);
|
|
1669
1682
|
|
|
1670
|
-
/**
|
|
1671
|
-
* ------------------------------------------------------------------------
|
|
1672
|
-
* Class Definition
|
|
1673
|
-
* ------------------------------------------------------------------------
|
|
1674
|
-
*/
|
|
1675
1683
|
var SVGCanvasElement = /*#__PURE__*/function (_SVGElement) {
|
|
1676
1684
|
function SVGCanvasElement(container) {
|
|
1677
1685
|
var _this;
|
|
@@ -1709,10 +1717,10 @@ var SVGCanvasElement = /*#__PURE__*/function (_SVGElement) {
|
|
|
1709
1717
|
|
|
1710
1718
|
// Create `path` element
|
|
1711
1719
|
;
|
|
1712
|
-
_proto.createPath = function createPath(config, style) {
|
|
1720
|
+
_proto.createPath = function createPath(config, style, group) {
|
|
1713
1721
|
var path = new SVGShapeElement('path', config, style);
|
|
1714
1722
|
path.node.setAttribute('fill-rule', 'evenodd');
|
|
1715
|
-
return this._add(path);
|
|
1723
|
+
return this._add(path, group);
|
|
1716
1724
|
}
|
|
1717
1725
|
|
|
1718
1726
|
// Create `circle` element
|
|
@@ -1765,11 +1773,6 @@ var SVGCanvasElement = /*#__PURE__*/function (_SVGElement) {
|
|
|
1765
1773
|
return SVGCanvasElement;
|
|
1766
1774
|
}(SVGElement);
|
|
1767
1775
|
|
|
1768
|
-
/**
|
|
1769
|
-
* ------------------------------------------------------------------------
|
|
1770
|
-
* Class Definition
|
|
1771
|
-
* ------------------------------------------------------------------------
|
|
1772
|
-
*/
|
|
1773
1776
|
var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
|
1774
1777
|
function Tooltip(map) {
|
|
1775
1778
|
var _this;
|
|
@@ -1922,11 +1925,14 @@ var DataVisualization = /*#__PURE__*/function () {
|
|
|
1922
1925
|
return DataVisualization;
|
|
1923
1926
|
}();
|
|
1924
1927
|
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1928
|
+
var JVM_PREFIX = 'jvm-';
|
|
1929
|
+
var CONTAINER_CLASS = JVM_PREFIX + "container";
|
|
1930
|
+
var MARKERS_GROUP_ID = JVM_PREFIX + "markers-group";
|
|
1931
|
+
var MARKERS_LABELS_GROUP_ID = JVM_PREFIX + "markers-labels-group";
|
|
1932
|
+
var LINES_GROUP_ID = JVM_PREFIX + "lines-group";
|
|
1933
|
+
var SERIES_CONTAINER_CLASS = JVM_PREFIX + "series-container";
|
|
1934
|
+
var SERIES_CONTAINER_H_CLASS = SERIES_CONTAINER_CLASS + " " + JVM_PREFIX + "series-h";
|
|
1935
|
+
var SERIES_CONTAINER_V_CLASS = SERIES_CONTAINER_CLASS + " " + JVM_PREFIX + "series-v";
|
|
1930
1936
|
var Map = /*#__PURE__*/function () {
|
|
1931
1937
|
function Map(options) {
|
|
1932
1938
|
var _this = this;
|
|
@@ -1970,7 +1976,7 @@ var Map = /*#__PURE__*/function () {
|
|
|
1970
1976
|
_proto._init = function _init() {
|
|
1971
1977
|
var options = this.params;
|
|
1972
1978
|
this.container = getElement(options.selector);
|
|
1973
|
-
this.container.classList.add(
|
|
1979
|
+
this.container.classList.add(CONTAINER_CLASS);
|
|
1974
1980
|
|
|
1975
1981
|
// The map canvas element
|
|
1976
1982
|
this.canvas = new SVGCanvasElement(this.container);
|
|
@@ -1984,12 +1990,22 @@ var Map = /*#__PURE__*/function () {
|
|
|
1984
1990
|
// Update size
|
|
1985
1991
|
this.updateSize();
|
|
1986
1992
|
|
|
1987
|
-
//
|
|
1988
|
-
|
|
1993
|
+
// Lines group must be created before markers
|
|
1994
|
+
// Otherwise the lines will be drawn on top of the markers.
|
|
1995
|
+
if (options.lines) {
|
|
1996
|
+
this._linesGroup = this.canvas.createGroup(LINES_GROUP_ID);
|
|
1997
|
+
}
|
|
1998
|
+
if (options.markers) {
|
|
1999
|
+
this._markersGroup = this.canvas.createGroup(MARKERS_GROUP_ID);
|
|
2000
|
+
this._markerLabelsGroup = this.canvas.createGroup(MARKERS_LABELS_GROUP_ID);
|
|
2001
|
+
}
|
|
1989
2002
|
|
|
1990
2003
|
// Create markers
|
|
1991
2004
|
this._createMarkers(options.markers);
|
|
1992
2005
|
|
|
2006
|
+
// Create lines
|
|
2007
|
+
this._createLines(options.lines || {});
|
|
2008
|
+
|
|
1993
2009
|
// Position labels
|
|
1994
2010
|
this._repositionLabels();
|
|
1995
2011
|
|
|
@@ -2038,8 +2054,8 @@ var Map = /*#__PURE__*/function () {
|
|
|
2038
2054
|
|
|
2039
2055
|
// Create series if any
|
|
2040
2056
|
if (options.series) {
|
|
2041
|
-
this.container.appendChild(this.legendHorizontal = createElement('div',
|
|
2042
|
-
this.container.appendChild(this.legendVertical = createElement('div',
|
|
2057
|
+
this.container.appendChild(this.legendHorizontal = createElement('div', SERIES_CONTAINER_H_CLASS));
|
|
2058
|
+
this.container.appendChild(this.legendVertical = createElement('div', SERIES_CONTAINER_V_CLASS));
|
|
2043
2059
|
this._createSeries();
|
|
2044
2060
|
}
|
|
2045
2061
|
|
|
@@ -2053,7 +2069,7 @@ var Map = /*#__PURE__*/function () {
|
|
|
2053
2069
|
this.container.style.backgroundColor = color;
|
|
2054
2070
|
}
|
|
2055
2071
|
|
|
2056
|
-
//
|
|
2072
|
+
// Regions
|
|
2057
2073
|
;
|
|
2058
2074
|
_proto.getSelectedRegions = function getSelectedRegions() {
|
|
2059
2075
|
return this._getSelected('regions');
|
|
@@ -2073,7 +2089,7 @@ var Map = /*#__PURE__*/function () {
|
|
|
2073
2089
|
this._setSelected('regions', this._normalizeRegions(regions));
|
|
2074
2090
|
}
|
|
2075
2091
|
|
|
2076
|
-
// Markers
|
|
2092
|
+
// Markers
|
|
2077
2093
|
;
|
|
2078
2094
|
_proto.getSelectedMarkers = function getSelectedMarkers() {
|
|
2079
2095
|
return this._getSelected('_markers');
|
|
@@ -2081,6 +2097,9 @@ var Map = /*#__PURE__*/function () {
|
|
|
2081
2097
|
_proto.clearSelectedMarkers = function clearSelectedMarkers() {
|
|
2082
2098
|
this._clearSelected('_markers');
|
|
2083
2099
|
};
|
|
2100
|
+
_proto.setSelectedMarkers = function setSelectedMarkers(markers) {
|
|
2101
|
+
this._setSelected('_markers', markers);
|
|
2102
|
+
};
|
|
2084
2103
|
_proto.addMarkers = function addMarkers(config) {
|
|
2085
2104
|
config = Array.isArray(config) ? config : [config];
|
|
2086
2105
|
this._createMarkers(config, true);
|
|
@@ -2096,7 +2115,10 @@ var Map = /*#__PURE__*/function () {
|
|
|
2096
2115
|
// Remove the element from markers object
|
|
2097
2116
|
delete _this3._markers[index];
|
|
2098
2117
|
});
|
|
2099
|
-
}
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
// Lines
|
|
2121
|
+
;
|
|
2100
2122
|
_proto.addLine = function addLine(from, to, style) {
|
|
2101
2123
|
if (style === void 0) {
|
|
2102
2124
|
style = {};
|
|
@@ -2115,7 +2137,7 @@ var Map = /*#__PURE__*/function () {
|
|
|
2115
2137
|
}
|
|
2116
2138
|
this._createLines(config.filter(function (line) {
|
|
2117
2139
|
return !(uids.indexOf(getLineUid(line.from, line.to)) > -1);
|
|
2118
|
-
}),
|
|
2140
|
+
}), true);
|
|
2119
2141
|
};
|
|
2120
2142
|
_proto.removeLines = function removeLines(lines) {
|
|
2121
2143
|
var _this4 = this;
|
|
@@ -2249,12 +2271,6 @@ Object.assign(Map.prototype, core);
|
|
|
2249
2271
|
* Copyrights (c) Mustafa Omar https://github.com/themustafaomar
|
|
2250
2272
|
* Released under the MIT License.
|
|
2251
2273
|
*/
|
|
2252
|
-
|
|
2253
|
-
/**
|
|
2254
|
-
* ------------------------------------------------------------------------
|
|
2255
|
-
* Class Definition
|
|
2256
|
-
* ------------------------------------------------------------------------
|
|
2257
|
-
*/
|
|
2258
2274
|
var jsVectorMap = /*#__PURE__*/function () {
|
|
2259
2275
|
function jsVectorMap(options) {
|
|
2260
2276
|
if (options === void 0) {
|