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