@tabler/core 1.3.2 → 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/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
|
@@ -165,12 +165,6 @@
|
|
|
165
165
|
|
|
166
166
|
var eventRegistry = {};
|
|
167
167
|
var eventUid = 1;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* ------------------------------------------------------------------------
|
|
171
|
-
* Event Handler
|
|
172
|
-
* ------------------------------------------------------------------------
|
|
173
|
-
*/
|
|
174
168
|
var EventHandler = {
|
|
175
169
|
on: function on(element, event, handler, options) {
|
|
176
170
|
if (options === void 0) {
|
|
@@ -241,8 +235,8 @@
|
|
|
241
235
|
EventHandler.on(this.container, 'wheel', function (event) {
|
|
242
236
|
var deltaY = ((event.deltaY || -event.wheelDelta || event.detail) >> 10 || 1) * 75;
|
|
243
237
|
var rect = _this.container.getBoundingClientRect();
|
|
244
|
-
var offsetX = event.pageX - rect.left - window.
|
|
245
|
-
var offsetY = event.pageY - rect.top - window.
|
|
238
|
+
var offsetX = event.pageX - rect.left - window.scrollX;
|
|
239
|
+
var offsetY = event.pageY - rect.top - window.scrollY;
|
|
246
240
|
var zoomStep = Math.pow(1 + map.params.zoomOnScrollSpeed / 1000, -1.5 * deltaY);
|
|
247
241
|
if (map.tooltip) {
|
|
248
242
|
map._tooltip.hide();
|
|
@@ -309,8 +303,10 @@
|
|
|
309
303
|
data.element.hover(true);
|
|
310
304
|
if (showTooltip) {
|
|
311
305
|
map._tooltip.text(data.tooltipText);
|
|
312
|
-
map._tooltip.show();
|
|
313
306
|
map._emit(data.event, [event, map._tooltip, data.code]);
|
|
307
|
+
if (!event.defaultPrevented) {
|
|
308
|
+
map._tooltip.show();
|
|
309
|
+
}
|
|
314
310
|
}
|
|
315
311
|
} else {
|
|
316
312
|
data.element.hover(false);
|
|
@@ -331,14 +327,14 @@
|
|
|
331
327
|
|
|
332
328
|
// We're checking if regions/markers|SelectableOne option is presented
|
|
333
329
|
if (map.params[data.type + "sSelectableOne"]) {
|
|
334
|
-
|
|
330
|
+
data.type === 'region' ? map.clearSelectedRegions() : map.clearSelectedMarkers();
|
|
335
331
|
}
|
|
336
332
|
if (data.element.isSelected) {
|
|
337
333
|
element.select(false);
|
|
338
334
|
} else {
|
|
339
335
|
element.select(true);
|
|
340
336
|
}
|
|
341
|
-
map._emit(data.event, [data.code, element.isSelected,
|
|
337
|
+
map._emit(data.event, [data.code, element.isSelected, data.type === 'region' ? map.getSelectedRegions() : map.getSelectedMarkers()]);
|
|
342
338
|
}
|
|
343
339
|
});
|
|
344
340
|
|
|
@@ -353,10 +349,19 @@
|
|
|
353
349
|
|
|
354
350
|
function setupZoomButtons() {
|
|
355
351
|
var _this = this;
|
|
356
|
-
var
|
|
357
|
-
var
|
|
358
|
-
|
|
359
|
-
|
|
352
|
+
var zoomInOption = this.params.zoomInButton;
|
|
353
|
+
var zoomOutOption = this.params.zoomOutButton;
|
|
354
|
+
var getZoomButton = function getZoomButton(zoomOption) {
|
|
355
|
+
return typeof zoomOption === 'string' ? document.querySelector(zoomOption) : zoomOption;
|
|
356
|
+
};
|
|
357
|
+
var zoomIn = zoomInOption ? getZoomButton(zoomInOption) : createElement('div', 'jvm-zoom-btn jvm-zoomin', '+', true);
|
|
358
|
+
var zoomOut = zoomOutOption ? getZoomButton(zoomOutOption) : createElement('div', 'jvm-zoom-btn jvm-zoomout', '−', true);
|
|
359
|
+
if (!zoomInOption) {
|
|
360
|
+
this.container.appendChild(zoomIn);
|
|
361
|
+
}
|
|
362
|
+
if (!zoomOutOption) {
|
|
363
|
+
this.container.appendChild(zoomOut);
|
|
364
|
+
}
|
|
360
365
|
var handler = function handler(zoomin) {
|
|
361
366
|
if (zoomin === void 0) {
|
|
362
367
|
zoomin = true;
|
|
@@ -365,8 +370,8 @@
|
|
|
365
370
|
return _this._setScale(zoomin ? _this.scale * _this.params.zoomStep : _this.scale / _this.params.zoomStep, _this._width / 2, _this._height / 2, false, _this.params.zoomAnimate);
|
|
366
371
|
};
|
|
367
372
|
};
|
|
368
|
-
EventHandler.on(
|
|
369
|
-
EventHandler.on(
|
|
373
|
+
EventHandler.on(zoomIn, 'click', handler());
|
|
374
|
+
EventHandler.on(zoomOut, 'click', handler(false));
|
|
370
375
|
}
|
|
371
376
|
|
|
372
377
|
function setupContainerTouchEvents() {
|
|
@@ -386,11 +391,12 @@
|
|
|
386
391
|
}
|
|
387
392
|
if (touches.length == 1) {
|
|
388
393
|
if (lastTouchesLength == 1) {
|
|
394
|
+
var _map$_tooltip;
|
|
389
395
|
transXOld = map.transX;
|
|
390
396
|
transYOld = map.transY;
|
|
391
397
|
map.transX -= (touchX - touches[0].pageX) / map.scale;
|
|
392
398
|
map.transY -= (touchY - touches[0].pageY) / map.scale;
|
|
393
|
-
map._tooltip.hide();
|
|
399
|
+
(_map$_tooltip = map._tooltip) == null || _map$_tooltip.hide();
|
|
394
400
|
map._applyTransform();
|
|
395
401
|
if (transXOld != map.transX || transYOld != map.transY) {
|
|
396
402
|
e.preventDefault();
|
|
@@ -400,9 +406,10 @@
|
|
|
400
406
|
touchY = touches[0].pageY;
|
|
401
407
|
} else if (touches.length == 2) {
|
|
402
408
|
if (lastTouchesLength == 2) {
|
|
409
|
+
var _map$_tooltip2;
|
|
403
410
|
scale = Math.sqrt(Math.pow(touches[0].pageX - touches[1].pageX, 2) + Math.pow(touches[0].pageY - touches[1].pageY, 2)) / touchStartDistance;
|
|
404
411
|
map._setScale(touchStartScale * scale, centerTouchX, centerTouchY);
|
|
405
|
-
map._tooltip.hide();
|
|
412
|
+
(_map$_tooltip2 = map._tooltip) == null || _map$_tooltip2.hide();
|
|
406
413
|
e.preventDefault();
|
|
407
414
|
} else {
|
|
408
415
|
var rect = map.container.getBoundingClientRect();
|
|
@@ -441,6 +448,17 @@
|
|
|
441
448
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
442
449
|
return e;
|
|
443
450
|
}
|
|
451
|
+
function _defineProperties(e, r) {
|
|
452
|
+
for (var t = 0; t < r.length; t++) {
|
|
453
|
+
var o = r[t];
|
|
454
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function _createClass(e, r, t) {
|
|
458
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
459
|
+
writable: !1
|
|
460
|
+
}), e;
|
|
461
|
+
}
|
|
444
462
|
function _createForOfIteratorHelperLoose(r, e) {
|
|
445
463
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
446
464
|
if (t) return (t = t.call(r)).next.bind(t);
|
|
@@ -470,11 +488,34 @@
|
|
|
470
488
|
function _inheritsLoose(t, o) {
|
|
471
489
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
472
490
|
}
|
|
491
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
492
|
+
if (null == r) return {};
|
|
493
|
+
var t = {};
|
|
494
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
495
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
496
|
+
t[n] = r[n];
|
|
497
|
+
}
|
|
498
|
+
return t;
|
|
499
|
+
}
|
|
473
500
|
function _setPrototypeOf(t, e) {
|
|
474
501
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
475
502
|
return t.__proto__ = e, t;
|
|
476
503
|
}, _setPrototypeOf(t, e);
|
|
477
504
|
}
|
|
505
|
+
function _toPrimitive(t, r) {
|
|
506
|
+
if ("object" != typeof t || !t) return t;
|
|
507
|
+
var e = t[Symbol.toPrimitive];
|
|
508
|
+
if (void 0 !== e) {
|
|
509
|
+
var i = e.call(t, r || "default");
|
|
510
|
+
if ("object" != typeof i) return i;
|
|
511
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
512
|
+
}
|
|
513
|
+
return ("string" === r ? String : Number)(t);
|
|
514
|
+
}
|
|
515
|
+
function _toPropertyKey(t) {
|
|
516
|
+
var i = _toPrimitive(t, "string");
|
|
517
|
+
return "symbol" == typeof i ? i : i + "";
|
|
518
|
+
}
|
|
478
519
|
function _unsupportedIterableToArray(r, a) {
|
|
479
520
|
if (r) {
|
|
480
521
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
@@ -483,11 +524,6 @@
|
|
|
483
524
|
}
|
|
484
525
|
}
|
|
485
526
|
|
|
486
|
-
/**
|
|
487
|
-
* ------------------------------------------------------------------------
|
|
488
|
-
* Class Definition
|
|
489
|
-
* ------------------------------------------------------------------------
|
|
490
|
-
*/
|
|
491
527
|
var BaseComponent = /*#__PURE__*/function () {
|
|
492
528
|
function BaseComponent() {}
|
|
493
529
|
var _proto = BaseComponent.prototype;
|
|
@@ -506,11 +542,6 @@
|
|
|
506
542
|
return BaseComponent;
|
|
507
543
|
}();
|
|
508
544
|
|
|
509
|
-
/**
|
|
510
|
-
* ------------------------------------------------------------------------
|
|
511
|
-
* Interactable
|
|
512
|
-
* ------------------------------------------------------------------------
|
|
513
|
-
*/
|
|
514
545
|
var Interactable = {
|
|
515
546
|
getLabelText: function getLabelText(key, label) {
|
|
516
547
|
if (!label) {
|
|
@@ -520,8 +551,8 @@
|
|
|
520
551
|
var params = [];
|
|
521
552
|
|
|
522
553
|
// Pass additional paramater (Marker config object) in case it's a Marker.
|
|
523
|
-
if (this.
|
|
524
|
-
params.push(this.
|
|
554
|
+
if (this.constructor.Name === 'marker') {
|
|
555
|
+
params.push(this.getConfig());
|
|
525
556
|
}
|
|
526
557
|
|
|
527
558
|
// Becuase we need to add the key always at the end
|
|
@@ -566,11 +597,6 @@
|
|
|
566
597
|
}
|
|
567
598
|
};
|
|
568
599
|
|
|
569
|
-
/**
|
|
570
|
-
* ------------------------------------------------------------------------
|
|
571
|
-
* Class Definition
|
|
572
|
-
* ------------------------------------------------------------------------
|
|
573
|
-
*/
|
|
574
600
|
var Region = /*#__PURE__*/function (_BaseComponent) {
|
|
575
601
|
function Region(_ref) {
|
|
576
602
|
var _this;
|
|
@@ -645,33 +671,16 @@
|
|
|
645
671
|
}
|
|
646
672
|
}
|
|
647
673
|
|
|
648
|
-
|
|
649
|
-
* ------------------------------------------------------------------------
|
|
650
|
-
* Class Definition
|
|
651
|
-
* ------------------------------------------------------------------------
|
|
652
|
-
*/
|
|
674
|
+
var LINE_CLASS = 'jvm-line';
|
|
653
675
|
var Line = /*#__PURE__*/function (_BaseComponent) {
|
|
654
|
-
function Line(
|
|
676
|
+
function Line(options, style) {
|
|
655
677
|
var _this;
|
|
656
|
-
var index = _ref.index,
|
|
657
|
-
map = _ref.map,
|
|
658
|
-
style = _ref.style,
|
|
659
|
-
x1 = _ref.x1,
|
|
660
|
-
y1 = _ref.y1,
|
|
661
|
-
x2 = _ref.x2,
|
|
662
|
-
y2 = _ref.y2,
|
|
663
|
-
group = _ref.group,
|
|
664
|
-
config = _ref.config;
|
|
665
678
|
_this = _BaseComponent.call(this) || this;
|
|
666
|
-
_this.
|
|
667
|
-
_this.
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
y2: y2,
|
|
672
|
-
dataIndex: index
|
|
673
|
-
}, style, group);
|
|
674
|
-
_this.shape.addClass('jvm-line');
|
|
679
|
+
_this._options = options;
|
|
680
|
+
_this._style = {
|
|
681
|
+
initial: style
|
|
682
|
+
};
|
|
683
|
+
_this._draw();
|
|
675
684
|
return _this;
|
|
676
685
|
}
|
|
677
686
|
_inheritsLoose(Line, _BaseComponent);
|
|
@@ -679,113 +688,148 @@
|
|
|
679
688
|
_proto.setStyle = function setStyle(property, value) {
|
|
680
689
|
this.shape.setStyle(property, value);
|
|
681
690
|
};
|
|
691
|
+
_proto.getConfig = function getConfig() {
|
|
692
|
+
return this._options.config;
|
|
693
|
+
};
|
|
694
|
+
_proto._draw = function _draw() {
|
|
695
|
+
var _this$_options = this._options,
|
|
696
|
+
index = _this$_options.index,
|
|
697
|
+
group = _this$_options.group,
|
|
698
|
+
map = _this$_options.map;
|
|
699
|
+
var config = {
|
|
700
|
+
d: this._getDAttribute(),
|
|
701
|
+
fill: 'none',
|
|
702
|
+
dataIndex: index
|
|
703
|
+
};
|
|
704
|
+
this.shape = map.canvas.createPath(config, this._style, group);
|
|
705
|
+
this.shape.addClass(LINE_CLASS);
|
|
706
|
+
};
|
|
707
|
+
_proto._getDAttribute = function _getDAttribute() {
|
|
708
|
+
var _this$_options2 = this._options,
|
|
709
|
+
x1 = _this$_options2.x1,
|
|
710
|
+
y1 = _this$_options2.y1,
|
|
711
|
+
x2 = _this$_options2.x2,
|
|
712
|
+
y2 = _this$_options2.y2,
|
|
713
|
+
curvature = _this$_options2.curvature;
|
|
714
|
+
return "M" + x1 + "," + y1 + this._getQCommand(x1, y1, x2, y2, curvature) + x2 + "," + y2;
|
|
715
|
+
};
|
|
716
|
+
_proto._getQCommand = function _getQCommand(x1, y1, x2, y2, curvature) {
|
|
717
|
+
if (!curvature) {
|
|
718
|
+
return ' ';
|
|
719
|
+
}
|
|
720
|
+
var curveX = (x1 + x2) / 2 + curvature * (y2 - y1);
|
|
721
|
+
var curveY = (y1 + y2) / 2 - curvature * (x2 - x1);
|
|
722
|
+
return " Q" + curveX + "," + curveY + " ";
|
|
723
|
+
};
|
|
682
724
|
return Line;
|
|
683
725
|
}(BaseComponent);
|
|
684
726
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
727
|
+
var _excluded = ["curvature"],
|
|
728
|
+
_excluded2 = ["curvature"];
|
|
729
|
+
function createLines(lines) {
|
|
689
730
|
var point1 = false,
|
|
690
731
|
point2 = false;
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
// after the map has loaded so we will append the futured lines to this group as well.
|
|
695
|
-
this.linesGroup = this.linesGroup || this.canvas.createGroup('jvm-lines-group');
|
|
732
|
+
var _this$params$lineStyl = this.params.lineStyle,
|
|
733
|
+
curvature = _this$params$lineStyl.curvature,
|
|
734
|
+
lineStyle = _objectWithoutPropertiesLoose(_this$params$lineStyl, _excluded);
|
|
696
735
|
for (var index in lines) {
|
|
697
|
-
var
|
|
698
|
-
for (var
|
|
699
|
-
var markerConfig =
|
|
700
|
-
if (markerConfig.name ===
|
|
736
|
+
var lineConfig = lines[index];
|
|
737
|
+
for (var _i = 0, _Object$values = Object.values(this._markers); _i < _Object$values.length; _i++) {
|
|
738
|
+
var markerConfig = _Object$values[_i].config;
|
|
739
|
+
if (markerConfig.name === lineConfig.from) {
|
|
701
740
|
point1 = this.getMarkerPosition(markerConfig);
|
|
702
741
|
}
|
|
703
|
-
if (markerConfig.name ===
|
|
742
|
+
if (markerConfig.name === lineConfig.to) {
|
|
704
743
|
point2 = this.getMarkerPosition(markerConfig);
|
|
705
744
|
}
|
|
706
745
|
}
|
|
707
746
|
if (point1 !== false && point2 !== false) {
|
|
747
|
+
var _ref = lineConfig.style || {},
|
|
748
|
+
curvatureOption = _ref.curvature,
|
|
749
|
+
style = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
750
|
+
|
|
708
751
|
// Register lines with unique keys
|
|
709
|
-
this._lines[getLineUid(
|
|
752
|
+
this._lines[getLineUid(lineConfig.from, lineConfig.to)] = new Line({
|
|
710
753
|
index: index,
|
|
711
754
|
map: this,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
initial: this.params.lineStyle
|
|
715
|
-
}, {
|
|
716
|
-
initial: config.style || {}
|
|
717
|
-
}, true),
|
|
755
|
+
group: this._linesGroup,
|
|
756
|
+
config: lineConfig,
|
|
718
757
|
x1: point1.x,
|
|
719
758
|
y1: point1.y,
|
|
720
759
|
x2: point2.x,
|
|
721
760
|
y2: point2.y,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
});
|
|
761
|
+
curvature: curvatureOption == 0 ? 0 : curvatureOption || curvature
|
|
762
|
+
}, merge(lineStyle, style, true));
|
|
725
763
|
}
|
|
726
764
|
}
|
|
727
765
|
}
|
|
728
766
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
*/
|
|
767
|
+
var NAME = 'marker';
|
|
768
|
+
var JVM_PREFIX$1 = 'jvm-';
|
|
769
|
+
var MARKER_CLASS = JVM_PREFIX$1 + "element " + JVM_PREFIX$1 + "marker";
|
|
770
|
+
var MARKER_LABEL_CLASS = JVM_PREFIX$1 + "element " + JVM_PREFIX$1 + "label";
|
|
734
771
|
var Marker = /*#__PURE__*/function (_BaseComponent) {
|
|
735
|
-
function Marker(
|
|
772
|
+
function Marker(options, style) {
|
|
736
773
|
var _this;
|
|
737
|
-
var index = _ref.index,
|
|
738
|
-
style = _ref.style,
|
|
739
|
-
label = _ref.label,
|
|
740
|
-
cx = _ref.cx,
|
|
741
|
-
cy = _ref.cy,
|
|
742
|
-
map = _ref.map,
|
|
743
|
-
group = _ref.group;
|
|
744
774
|
_this = _BaseComponent.call(this) || this;
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
_this.
|
|
775
|
+
_this._options = options;
|
|
776
|
+
_this._style = style;
|
|
777
|
+
_this._labelX = null;
|
|
778
|
+
_this._labelY = null;
|
|
779
|
+
_this._offsets = null;
|
|
748
780
|
_this._isImage = !!style.initial.image;
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
dataIndex: index,
|
|
754
|
-
cx: cx,
|
|
755
|
-
cy: cy
|
|
756
|
-
}, style, group);
|
|
757
|
-
_this.shape.addClass('jvm-marker jvm-element');
|
|
781
|
+
_this._draw();
|
|
782
|
+
if (_this._options.label) {
|
|
783
|
+
_this._drawLabel();
|
|
784
|
+
}
|
|
758
785
|
if (_this._isImage) {
|
|
759
786
|
_this.updateLabelPosition();
|
|
760
787
|
}
|
|
761
|
-
if (label) {
|
|
762
|
-
_this._createLabel(_this.config);
|
|
763
|
-
}
|
|
764
788
|
return _this;
|
|
765
789
|
}
|
|
766
790
|
_inheritsLoose(Marker, _BaseComponent);
|
|
767
791
|
var _proto = Marker.prototype;
|
|
792
|
+
_proto.getConfig = function getConfig() {
|
|
793
|
+
return this._options.config;
|
|
794
|
+
};
|
|
768
795
|
_proto.updateLabelPosition = function updateLabelPosition() {
|
|
796
|
+
var map = this._options.map;
|
|
769
797
|
if (this.label) {
|
|
770
798
|
this.label.set({
|
|
771
|
-
x: this._labelX *
|
|
772
|
-
y: this._labelY *
|
|
799
|
+
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),
|
|
800
|
+
y: this._labelY * map.scale + map.transY * this._options.map.scale + this._offsets[1]
|
|
773
801
|
});
|
|
774
802
|
}
|
|
775
803
|
};
|
|
776
|
-
_proto.
|
|
777
|
-
var
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
cx =
|
|
782
|
-
cy =
|
|
783
|
-
|
|
784
|
-
|
|
804
|
+
_proto._draw = function _draw() {
|
|
805
|
+
var _this$_options = this._options,
|
|
806
|
+
index = _this$_options.index,
|
|
807
|
+
map = _this$_options.map,
|
|
808
|
+
group = _this$_options.group,
|
|
809
|
+
cx = _this$_options.cx,
|
|
810
|
+
cy = _this$_options.cy;
|
|
811
|
+
var shapeType = this._isImage ? 'createImage' : 'createCircle';
|
|
812
|
+
this.shape = map.canvas[shapeType]({
|
|
813
|
+
dataIndex: index,
|
|
814
|
+
cx: cx,
|
|
815
|
+
cy: cy
|
|
816
|
+
}, this._style, group);
|
|
817
|
+
this.shape.addClass(MARKER_CLASS);
|
|
818
|
+
};
|
|
819
|
+
_proto._drawLabel = function _drawLabel() {
|
|
820
|
+
var _this$_options2 = this._options,
|
|
821
|
+
index = _this$_options2.index,
|
|
822
|
+
map = _this$_options2.map,
|
|
823
|
+
label = _this$_options2.label,
|
|
824
|
+
labelsGroup = _this$_options2.labelsGroup,
|
|
825
|
+
cx = _this$_options2.cx,
|
|
826
|
+
cy = _this$_options2.cy,
|
|
827
|
+
config = _this$_options2.config,
|
|
828
|
+
isRecentlyCreated = _this$_options2.isRecentlyCreated;
|
|
785
829
|
var labelText = this.getLabelText(index, label);
|
|
786
830
|
this._labelX = cx / map.scale - map.transX;
|
|
787
831
|
this._labelY = cy / map.scale - map.transY;
|
|
788
|
-
this._offsets = isRecentlyCreated &&
|
|
832
|
+
this._offsets = isRecentlyCreated && config.offsets ? config.offsets : this.getLabelOffsets(index, label);
|
|
789
833
|
this.label = map.canvas.createText({
|
|
790
834
|
text: labelText,
|
|
791
835
|
dataIndex: index,
|
|
@@ -793,12 +837,17 @@
|
|
|
793
837
|
y: this._labelY,
|
|
794
838
|
dy: '0.6ex'
|
|
795
839
|
}, map.params.markerLabelStyle, labelsGroup);
|
|
796
|
-
this.label.addClass(
|
|
840
|
+
this.label.addClass(MARKER_LABEL_CLASS);
|
|
797
841
|
if (isRecentlyCreated) {
|
|
798
842
|
this.updateLabelPosition();
|
|
799
843
|
}
|
|
800
844
|
};
|
|
801
|
-
return Marker
|
|
845
|
+
return _createClass(Marker, null, [{
|
|
846
|
+
key: "Name",
|
|
847
|
+
get: function get() {
|
|
848
|
+
return NAME;
|
|
849
|
+
}
|
|
850
|
+
}]);
|
|
802
851
|
}(BaseComponent);
|
|
803
852
|
inherit(Marker, Interactable);
|
|
804
853
|
|
|
@@ -810,11 +859,6 @@
|
|
|
810
859
|
if (isRecentlyCreated === void 0) {
|
|
811
860
|
isRecentlyCreated = false;
|
|
812
861
|
}
|
|
813
|
-
// Create groups for holding markers and markers labels
|
|
814
|
-
// We're checking if `markersGroup` exists or not becuase we may add markers after the map has loaded
|
|
815
|
-
// So we will append the futured markers to this group as well.
|
|
816
|
-
this._markersGroup = this._markersGroup || this.canvas.createGroup('jvm-markers-group');
|
|
817
|
-
this._markerLabelsGroup = this._markerLabelsGroup || this.canvas.createGroup('jvm-markers-labels-group');
|
|
818
862
|
var _loop = function _loop() {
|
|
819
863
|
var config = markers[index];
|
|
820
864
|
var point = _this.getMarkerPosition(config);
|
|
@@ -837,16 +881,14 @@
|
|
|
837
881
|
var marker = new Marker({
|
|
838
882
|
index: index,
|
|
839
883
|
map: _this,
|
|
840
|
-
// Merge the `markerStyle` object with the marker config `style` if presented.
|
|
841
|
-
style: merge(_this.params.markerStyle, _extends({}, config.style || {}), true),
|
|
842
884
|
label: _this.params.labels && _this.params.labels.markers,
|
|
843
885
|
labelsGroup: _this._markerLabelsGroup,
|
|
844
886
|
cx: point.x,
|
|
845
887
|
cy: point.y,
|
|
846
888
|
group: _this._markersGroup,
|
|
847
|
-
|
|
889
|
+
config: config,
|
|
848
890
|
isRecentlyCreated: isRecentlyCreated
|
|
849
|
-
});
|
|
891
|
+
}, merge(_this.params.markerStyle, _extends({}, config.style || {}), true));
|
|
850
892
|
|
|
851
893
|
// Check for marker duplication
|
|
852
894
|
// this is useful when for example: a user clicks a button for creating marker two times
|
|
@@ -867,11 +909,6 @@
|
|
|
867
909
|
}
|
|
868
910
|
}
|
|
869
911
|
|
|
870
|
-
/**
|
|
871
|
-
* ------------------------------------------------------------------------
|
|
872
|
-
* Class Definition
|
|
873
|
-
* ------------------------------------------------------------------------
|
|
874
|
-
*/
|
|
875
912
|
var Legend = /*#__PURE__*/function () {
|
|
876
913
|
function Legend(options) {
|
|
877
914
|
if (options === void 0) {
|
|
@@ -894,13 +931,11 @@
|
|
|
894
931
|
var _proto = Legend.prototype;
|
|
895
932
|
_proto.render = function render() {
|
|
896
933
|
var ticks = this._series.scale.getTicks();
|
|
897
|
-
var inner = createElement('div', 'jvm-legend-inner');
|
|
898
934
|
this._body.innderHTML = '';
|
|
899
935
|
if (this._options.title) {
|
|
900
936
|
var legendTitle = createElement('div', 'jvm-legend-title', this._options.title);
|
|
901
937
|
this._body.appendChild(legendTitle);
|
|
902
938
|
}
|
|
903
|
-
this._body.appendChild(inner);
|
|
904
939
|
for (var i = 0; i < ticks.length; i++) {
|
|
905
940
|
var tick = createElement('div', 'jvm-legend-tick');
|
|
906
941
|
var sample = createElement('div', 'jvm-legend-tick-sample');
|
|
@@ -927,17 +962,12 @@
|
|
|
927
962
|
}
|
|
928
963
|
var tickText = createElement('div', 'jvm-legend-tick-text', label);
|
|
929
964
|
tick.appendChild(tickText);
|
|
930
|
-
|
|
965
|
+
this._body.appendChild(tick);
|
|
931
966
|
}
|
|
932
967
|
};
|
|
933
968
|
return Legend;
|
|
934
969
|
}();
|
|
935
970
|
|
|
936
|
-
/**
|
|
937
|
-
* ------------------------------------------------------------------------
|
|
938
|
-
* Class Definition
|
|
939
|
-
* ------------------------------------------------------------------------
|
|
940
|
-
*/
|
|
941
971
|
var OrdinalScale = /*#__PURE__*/function () {
|
|
942
972
|
function OrdinalScale(scale) {
|
|
943
973
|
this._scale = scale;
|
|
@@ -959,11 +989,6 @@
|
|
|
959
989
|
return OrdinalScale;
|
|
960
990
|
}();
|
|
961
991
|
|
|
962
|
-
/**
|
|
963
|
-
* ------------------------------------------------------------------------
|
|
964
|
-
* Class Definition
|
|
965
|
-
* ------------------------------------------------------------------------
|
|
966
|
-
*/
|
|
967
992
|
var Series = /*#__PURE__*/function () {
|
|
968
993
|
function Series(config, elements, map) {
|
|
969
994
|
if (config === void 0) {
|
|
@@ -1345,27 +1370,34 @@
|
|
|
1345
1370
|
}
|
|
1346
1371
|
|
|
1347
1372
|
function repositionLines() {
|
|
1348
|
-
var
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
var
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
x2
|
|
1365
|
-
y2
|
|
1373
|
+
var _this = this;
|
|
1374
|
+
var curvature = this.params.lineStyle.curvature;
|
|
1375
|
+
Object.values(this._lines).forEach(function (line) {
|
|
1376
|
+
var startMarker = Object.values(_this._markers).find(function (_ref) {
|
|
1377
|
+
var config = _ref.config;
|
|
1378
|
+
return config.name === line.getConfig().from;
|
|
1379
|
+
});
|
|
1380
|
+
var endMarker = Object.values(_this._markers).find(function (_ref2) {
|
|
1381
|
+
var config = _ref2.config;
|
|
1382
|
+
return config.name === line.getConfig().to;
|
|
1383
|
+
});
|
|
1384
|
+
if (startMarker && endMarker) {
|
|
1385
|
+
var _this$getMarkerPositi = _this.getMarkerPosition(startMarker.config),
|
|
1386
|
+
x1 = _this$getMarkerPositi.x,
|
|
1387
|
+
y1 = _this$getMarkerPositi.y;
|
|
1388
|
+
var _this$getMarkerPositi2 = _this.getMarkerPosition(endMarker.config),
|
|
1389
|
+
x2 = _this$getMarkerPositi2.x,
|
|
1390
|
+
y2 = _this$getMarkerPositi2.y;
|
|
1391
|
+
var curvatureOption = line._options.curvature == 0 ? 0 : line._options.curvature || curvature;
|
|
1392
|
+
var midX = (x1 + x2) / 2;
|
|
1393
|
+
var midY = (y1 + y2) / 2;
|
|
1394
|
+
var curveX = midX + curvatureOption * (y2 - y1);
|
|
1395
|
+
var curveY = midY - curvatureOption * (x2 - x1);
|
|
1396
|
+
line.setStyle({
|
|
1397
|
+
d: "M" + x1 + "," + y1 + " Q" + curveX + "," + curveY + " " + x2 + "," + y2
|
|
1366
1398
|
});
|
|
1367
1399
|
}
|
|
1368
|
-
}
|
|
1400
|
+
});
|
|
1369
1401
|
}
|
|
1370
1402
|
|
|
1371
1403
|
function repositionMarkers() {
|
|
@@ -1438,6 +1470,7 @@
|
|
|
1438
1470
|
bindTouchEvents: true,
|
|
1439
1471
|
// Line options
|
|
1440
1472
|
lineStyle: {
|
|
1473
|
+
curvature: 0,
|
|
1441
1474
|
stroke: '#808080',
|
|
1442
1475
|
strokeWidth: 1,
|
|
1443
1476
|
strokeLinecap: 'round'
|
|
@@ -1510,11 +1543,6 @@
|
|
|
1510
1543
|
}
|
|
1511
1544
|
};
|
|
1512
1545
|
|
|
1513
|
-
/**
|
|
1514
|
-
* ------------------------------------------------------------------------
|
|
1515
|
-
* Class Definition
|
|
1516
|
-
* ------------------------------------------------------------------------
|
|
1517
|
-
*/
|
|
1518
1546
|
var SVGElement = /*#__PURE__*/function () {
|
|
1519
1547
|
function SVGElement(name, config) {
|
|
1520
1548
|
this.node = this._createElement(name);
|
|
@@ -1559,11 +1587,6 @@
|
|
|
1559
1587
|
return SVGElement;
|
|
1560
1588
|
}();
|
|
1561
1589
|
|
|
1562
|
-
/**
|
|
1563
|
-
* ------------------------------------------------------------------------
|
|
1564
|
-
* Class Definition
|
|
1565
|
-
* ------------------------------------------------------------------------
|
|
1566
|
-
*/
|
|
1567
1590
|
var SVGShapeElement = /*#__PURE__*/function (_SVGElement) {
|
|
1568
1591
|
function SVGShapeElement(name, config, style) {
|
|
1569
1592
|
var _this;
|
|
@@ -1607,11 +1630,6 @@
|
|
|
1607
1630
|
return SVGShapeElement;
|
|
1608
1631
|
}(SVGElement);
|
|
1609
1632
|
|
|
1610
|
-
/**
|
|
1611
|
-
* ------------------------------------------------------------------------
|
|
1612
|
-
* Class Definition
|
|
1613
|
-
* ------------------------------------------------------------------------
|
|
1614
|
-
*/
|
|
1615
1633
|
var SVGTextElement = /*#__PURE__*/function (_SVGShapeElement) {
|
|
1616
1634
|
function SVGTextElement(config, style) {
|
|
1617
1635
|
return _SVGShapeElement.call(this, 'text', config, style) || this;
|
|
@@ -1624,11 +1642,6 @@
|
|
|
1624
1642
|
return SVGTextElement;
|
|
1625
1643
|
}(SVGShapeElement);
|
|
1626
1644
|
|
|
1627
|
-
/**
|
|
1628
|
-
* ------------------------------------------------------------------------
|
|
1629
|
-
* Class Definition
|
|
1630
|
-
* ------------------------------------------------------------------------
|
|
1631
|
-
*/
|
|
1632
1645
|
var SVGImageElement = /*#__PURE__*/function (_SVGShapeElement) {
|
|
1633
1646
|
function SVGImageElement(config, style) {
|
|
1634
1647
|
return _SVGShapeElement.call(this, 'image', config, style) || this;
|
|
@@ -1673,11 +1686,6 @@
|
|
|
1673
1686
|
return SVGImageElement;
|
|
1674
1687
|
}(SVGShapeElement);
|
|
1675
1688
|
|
|
1676
|
-
/**
|
|
1677
|
-
* ------------------------------------------------------------------------
|
|
1678
|
-
* Class Definition
|
|
1679
|
-
* ------------------------------------------------------------------------
|
|
1680
|
-
*/
|
|
1681
1689
|
var SVGCanvasElement = /*#__PURE__*/function (_SVGElement) {
|
|
1682
1690
|
function SVGCanvasElement(container) {
|
|
1683
1691
|
var _this;
|
|
@@ -1715,10 +1723,10 @@
|
|
|
1715
1723
|
|
|
1716
1724
|
// Create `path` element
|
|
1717
1725
|
;
|
|
1718
|
-
_proto.createPath = function createPath(config, style) {
|
|
1726
|
+
_proto.createPath = function createPath(config, style, group) {
|
|
1719
1727
|
var path = new SVGShapeElement('path', config, style);
|
|
1720
1728
|
path.node.setAttribute('fill-rule', 'evenodd');
|
|
1721
|
-
return this._add(path);
|
|
1729
|
+
return this._add(path, group);
|
|
1722
1730
|
}
|
|
1723
1731
|
|
|
1724
1732
|
// Create `circle` element
|
|
@@ -1771,11 +1779,6 @@
|
|
|
1771
1779
|
return SVGCanvasElement;
|
|
1772
1780
|
}(SVGElement);
|
|
1773
1781
|
|
|
1774
|
-
/**
|
|
1775
|
-
* ------------------------------------------------------------------------
|
|
1776
|
-
* Class Definition
|
|
1777
|
-
* ------------------------------------------------------------------------
|
|
1778
|
-
*/
|
|
1779
1782
|
var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
|
1780
1783
|
function Tooltip(map) {
|
|
1781
1784
|
var _this;
|
|
@@ -1928,11 +1931,14 @@
|
|
|
1928
1931
|
return DataVisualization;
|
|
1929
1932
|
}();
|
|
1930
1933
|
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1934
|
+
var JVM_PREFIX = 'jvm-';
|
|
1935
|
+
var CONTAINER_CLASS = JVM_PREFIX + "container";
|
|
1936
|
+
var MARKERS_GROUP_ID = JVM_PREFIX + "markers-group";
|
|
1937
|
+
var MARKERS_LABELS_GROUP_ID = JVM_PREFIX + "markers-labels-group";
|
|
1938
|
+
var LINES_GROUP_ID = JVM_PREFIX + "lines-group";
|
|
1939
|
+
var SERIES_CONTAINER_CLASS = JVM_PREFIX + "series-container";
|
|
1940
|
+
var SERIES_CONTAINER_H_CLASS = SERIES_CONTAINER_CLASS + " " + JVM_PREFIX + "series-h";
|
|
1941
|
+
var SERIES_CONTAINER_V_CLASS = SERIES_CONTAINER_CLASS + " " + JVM_PREFIX + "series-v";
|
|
1936
1942
|
var Map = /*#__PURE__*/function () {
|
|
1937
1943
|
function Map(options) {
|
|
1938
1944
|
var _this = this;
|
|
@@ -1976,7 +1982,7 @@
|
|
|
1976
1982
|
_proto._init = function _init() {
|
|
1977
1983
|
var options = this.params;
|
|
1978
1984
|
this.container = getElement(options.selector);
|
|
1979
|
-
this.container.classList.add(
|
|
1985
|
+
this.container.classList.add(CONTAINER_CLASS);
|
|
1980
1986
|
|
|
1981
1987
|
// The map canvas element
|
|
1982
1988
|
this.canvas = new SVGCanvasElement(this.container);
|
|
@@ -1990,12 +1996,22 @@
|
|
|
1990
1996
|
// Update size
|
|
1991
1997
|
this.updateSize();
|
|
1992
1998
|
|
|
1993
|
-
//
|
|
1994
|
-
|
|
1999
|
+
// Lines group must be created before markers
|
|
2000
|
+
// Otherwise the lines will be drawn on top of the markers.
|
|
2001
|
+
if (options.lines) {
|
|
2002
|
+
this._linesGroup = this.canvas.createGroup(LINES_GROUP_ID);
|
|
2003
|
+
}
|
|
2004
|
+
if (options.markers) {
|
|
2005
|
+
this._markersGroup = this.canvas.createGroup(MARKERS_GROUP_ID);
|
|
2006
|
+
this._markerLabelsGroup = this.canvas.createGroup(MARKERS_LABELS_GROUP_ID);
|
|
2007
|
+
}
|
|
1995
2008
|
|
|
1996
2009
|
// Create markers
|
|
1997
2010
|
this._createMarkers(options.markers);
|
|
1998
2011
|
|
|
2012
|
+
// Create lines
|
|
2013
|
+
this._createLines(options.lines || {});
|
|
2014
|
+
|
|
1999
2015
|
// Position labels
|
|
2000
2016
|
this._repositionLabels();
|
|
2001
2017
|
|
|
@@ -2044,8 +2060,8 @@
|
|
|
2044
2060
|
|
|
2045
2061
|
// Create series if any
|
|
2046
2062
|
if (options.series) {
|
|
2047
|
-
this.container.appendChild(this.legendHorizontal = createElement('div',
|
|
2048
|
-
this.container.appendChild(this.legendVertical = createElement('div',
|
|
2063
|
+
this.container.appendChild(this.legendHorizontal = createElement('div', SERIES_CONTAINER_H_CLASS));
|
|
2064
|
+
this.container.appendChild(this.legendVertical = createElement('div', SERIES_CONTAINER_V_CLASS));
|
|
2049
2065
|
this._createSeries();
|
|
2050
2066
|
}
|
|
2051
2067
|
|
|
@@ -2059,7 +2075,7 @@
|
|
|
2059
2075
|
this.container.style.backgroundColor = color;
|
|
2060
2076
|
}
|
|
2061
2077
|
|
|
2062
|
-
//
|
|
2078
|
+
// Regions
|
|
2063
2079
|
;
|
|
2064
2080
|
_proto.getSelectedRegions = function getSelectedRegions() {
|
|
2065
2081
|
return this._getSelected('regions');
|
|
@@ -2079,7 +2095,7 @@
|
|
|
2079
2095
|
this._setSelected('regions', this._normalizeRegions(regions));
|
|
2080
2096
|
}
|
|
2081
2097
|
|
|
2082
|
-
// Markers
|
|
2098
|
+
// Markers
|
|
2083
2099
|
;
|
|
2084
2100
|
_proto.getSelectedMarkers = function getSelectedMarkers() {
|
|
2085
2101
|
return this._getSelected('_markers');
|
|
@@ -2087,6 +2103,9 @@
|
|
|
2087
2103
|
_proto.clearSelectedMarkers = function clearSelectedMarkers() {
|
|
2088
2104
|
this._clearSelected('_markers');
|
|
2089
2105
|
};
|
|
2106
|
+
_proto.setSelectedMarkers = function setSelectedMarkers(markers) {
|
|
2107
|
+
this._setSelected('_markers', markers);
|
|
2108
|
+
};
|
|
2090
2109
|
_proto.addMarkers = function addMarkers(config) {
|
|
2091
2110
|
config = Array.isArray(config) ? config : [config];
|
|
2092
2111
|
this._createMarkers(config, true);
|
|
@@ -2102,7 +2121,10 @@
|
|
|
2102
2121
|
// Remove the element from markers object
|
|
2103
2122
|
delete _this3._markers[index];
|
|
2104
2123
|
});
|
|
2105
|
-
}
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
// Lines
|
|
2127
|
+
;
|
|
2106
2128
|
_proto.addLine = function addLine(from, to, style) {
|
|
2107
2129
|
if (style === void 0) {
|
|
2108
2130
|
style = {};
|
|
@@ -2121,7 +2143,7 @@
|
|
|
2121
2143
|
}
|
|
2122
2144
|
this._createLines(config.filter(function (line) {
|
|
2123
2145
|
return !(uids.indexOf(getLineUid(line.from, line.to)) > -1);
|
|
2124
|
-
}),
|
|
2146
|
+
}), true);
|
|
2125
2147
|
};
|
|
2126
2148
|
_proto.removeLines = function removeLines(lines) {
|
|
2127
2149
|
var _this4 = this;
|
|
@@ -2255,12 +2277,6 @@
|
|
|
2255
2277
|
* Copyrights (c) Mustafa Omar https://github.com/themustafaomar
|
|
2256
2278
|
* Released under the MIT License.
|
|
2257
2279
|
*/
|
|
2258
|
-
|
|
2259
|
-
/**
|
|
2260
|
-
* ------------------------------------------------------------------------
|
|
2261
|
-
* Class Definition
|
|
2262
|
-
* ------------------------------------------------------------------------
|
|
2263
|
-
*/
|
|
2264
2280
|
var jsVectorMap = /*#__PURE__*/function () {
|
|
2265
2281
|
function jsVectorMap(options) {
|
|
2266
2282
|
if (options === void 0) {
|