vis-util 5.0.2 → 5.0.4

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.
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * utilitie collection for visjs
6
6
  *
7
- * @version 5.0.2
8
- * @date 2021-02-06T21:33:57.447Z
7
+ * @version 5.0.4
8
+ * @date 2023-09-13T20:29:32.256Z
9
9
  *
10
10
  * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11
11
  * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
@@ -28,12 +28,7 @@
28
28
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('component-emitter'), require('@egjs/hammerjs')) :
29
29
  typeof define === 'function' && define.amd ? define(['exports', 'component-emitter', '@egjs/hammerjs'], factory) :
30
30
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vis = global.vis || {}, global.Emitter, global.Hammer));
31
- }(this, (function (exports, Emitter, RealHammer) {
32
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
33
-
34
- var Emitter__default = /*#__PURE__*/_interopDefaultLegacy(Emitter);
35
- var RealHammer__default = /*#__PURE__*/_interopDefaultLegacy(RealHammer);
36
-
31
+ })(this, (function (exports, Emitter, RealHammer) {
37
32
  /**
38
33
  * Use this symbol to delete properies in deepObjectAssign.
39
34
  */
@@ -43,7 +38,6 @@
43
38
  *
44
39
  * @param base - The base object that fullfils the whole interface T.
45
40
  * @param updates - Updates that may change or delete props.
46
- *
47
41
  * @returns A brand new instance with all the supplied objects deeply merged.
48
42
  */
49
43
  function pureDeepObjectAssign(base, ...updates) {
@@ -53,7 +47,6 @@
53
47
  * Deep version of object assign with additional deleting by the DELETE symbol.
54
48
  *
55
49
  * @param values - Objects to be deeply merged.
56
- *
57
50
  * @returns The first object from values.
58
51
  */
59
52
  function deepObjectAssign(...values) {
@@ -66,9 +59,7 @@
66
59
  *
67
60
  * @remarks
68
61
  * This doesn't strip the DELETE symbols so they may end up in the final object.
69
- *
70
62
  * @param values - Objects to be deeply merged.
71
- *
72
63
  * @returns The first object from values.
73
64
  */
74
65
  function deepObjectAssignNonentry(...values) {
@@ -103,7 +94,6 @@
103
94
  * Deep clone given object or array. In case of primitive simply return.
104
95
  *
105
96
  * @param a - Anything.
106
- *
107
97
  * @returns Deep cloned object/array or unchanged a.
108
98
  */
109
99
  function clone(a) {
@@ -146,7 +136,6 @@
146
136
  *
147
137
  * @param seed - All supplied arguments will be used as a seed. In case nothing
148
138
  * is supplied the current time will be used to seed the generator.
149
- *
150
139
  * @returns A ready to use seeded generator.
151
140
  */
152
141
  function Alea(...seed) {
@@ -156,7 +145,6 @@
156
145
  * An implementation of [[Alea]] without user input validation.
157
146
  *
158
147
  * @param seed - The data that will be used to seed the generator.
159
- *
160
148
  * @returns A ready to use seeded generator.
161
149
  */
162
150
  function AleaImplementation(seed) {
@@ -180,7 +168,6 @@
180
168
  * random numbers.
181
169
  *
182
170
  * @param seed - Arbitrary data that will be used as the seed.
183
- *
184
171
  * @returns Three numbers to use as initial values for [[AleaImplementation]].
185
172
  */
186
173
  function mashSeed(...seed) {
@@ -252,9 +239,9 @@
252
239
  };
253
240
  }
254
241
 
255
- const Hammer =
242
+ const Hammer$1 =
256
243
  typeof window !== "undefined"
257
- ? window.Hammer || RealHammer__default['default']
244
+ ? window.Hammer || RealHammer
258
245
  : function () {
259
246
  // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.
260
247
  return hammerMock();
@@ -271,7 +258,7 @@
271
258
  * @param {Element} container
272
259
  * @class Activator
273
260
  */
274
- function Activator(container) {
261
+ function Activator$1(container) {
275
262
  this._cleanupQueue = [];
276
263
 
277
264
  this.active = false;
@@ -288,7 +275,7 @@
288
275
  this._dom.overlay.parentNode.removeChild(this._dom.overlay);
289
276
  });
290
277
 
291
- const hammer = Hammer(this._dom.overlay);
278
+ const hammer = Hammer$1(this._dom.overlay);
292
279
  hammer.on("tap", this._onTapOverlay.bind(this));
293
280
  this._cleanupQueue.push(() => {
294
281
  hammer.destroy();
@@ -339,15 +326,15 @@
339
326
  }
340
327
 
341
328
  // turn into an event emitter
342
- Emitter__default['default'](Activator.prototype);
329
+ Emitter(Activator$1.prototype);
343
330
 
344
331
  // The currently active activator
345
- Activator.current = null;
332
+ Activator$1.current = null;
346
333
 
347
334
  /**
348
335
  * Destroy the activator. Cleans up all created DOM and event listeners
349
336
  */
350
- Activator.prototype.destroy = function () {
337
+ Activator$1.prototype.destroy = function () {
351
338
  this.deactivate();
352
339
 
353
340
  for (const callback of this._cleanupQueue.splice(0).reverse()) {
@@ -359,12 +346,12 @@
359
346
  * Activate the element
360
347
  * Overlay is hidden, element is decorated with a blue shadow border
361
348
  */
362
- Activator.prototype.activate = function () {
349
+ Activator$1.prototype.activate = function () {
363
350
  // we allow only one active activator at a time
364
- if (Activator.current) {
365
- Activator.current.deactivate();
351
+ if (Activator$1.current) {
352
+ Activator$1.current.deactivate();
366
353
  }
367
- Activator.current = this;
354
+ Activator$1.current = this;
368
355
 
369
356
  this.active = true;
370
357
  this._dom.overlay.style.display = "none";
@@ -382,7 +369,7 @@
382
369
  * Deactivate the element
383
370
  * Overlay is displayed on top of the element
384
371
  */
385
- Activator.prototype.deactivate = function () {
372
+ Activator$1.prototype.deactivate = function () {
386
373
  this.active = false;
387
374
  this._dom.overlay.style.display = "block";
388
375
  this._dom.container.classList.remove("vis-active");
@@ -398,7 +385,7 @@
398
385
  * @param {Event} event The event
399
386
  * @private
400
387
  */
401
- Activator.prototype._onTapOverlay = function (event) {
388
+ Activator$1.prototype._onTapOverlay = function (event) {
402
389
  // activate the container
403
390
  this.activate();
404
391
  event.srcEvent.stopPropagation();
@@ -438,7 +425,6 @@
438
425
  * Test whether given object is a number.
439
426
  *
440
427
  * @param value - Input value of unknown type.
441
- *
442
428
  * @returns True if number, false otherwise.
443
429
  */
444
430
  function isNumber(value) {
@@ -464,7 +450,6 @@
464
450
  * Test whether given object is a string.
465
451
  *
466
452
  * @param value - Input value of unknown type.
467
- *
468
453
  * @returns True if string, false otherwise.
469
454
  */
470
455
  function isString(value) {
@@ -474,7 +459,6 @@
474
459
  * Test whether given object is a object (not primitive or null).
475
460
  *
476
461
  * @param value - Input value of unknown type.
477
- *
478
462
  * @returns True if not null object, false otherwise.
479
463
  */
480
464
  function isObject(value) {
@@ -484,7 +468,6 @@
484
468
  * Test whether given object is a Date, or a String containing a Date.
485
469
  *
486
470
  * @param value - Input value of unknown type.
487
- *
488
471
  * @returns True if Date instance or string date representation, false otherwise.
489
472
  */
490
473
  function isDate(value) {
@@ -561,7 +544,6 @@
561
544
  *
562
545
  * @param target - The target object to copy to.
563
546
  * @param source - The source object from which to copy properties.
564
- *
565
547
  * @returns The target object.
566
548
  */
567
549
  const extend = Object.assign;
@@ -570,11 +552,9 @@
570
552
  *
571
553
  * @remarks
572
554
  * Only properties with defined values are copied.
573
- *
574
555
  * @param props - Properties to be copied to a.
575
556
  * @param a - The target.
576
557
  * @param others - The sources.
577
- *
578
558
  * @returns Argument a.
579
559
  */
580
560
  function selectiveExtend(props, a, ...others) {
@@ -599,12 +579,10 @@
599
579
  * Previous version of this routine implied that multiple source objects could
600
580
  * be used; however, the implementation was **wrong**. Since multiple (\>1)
601
581
  * sources weren't used anywhere in the `vis.js` code, this has been removed
602
- *
603
582
  * @param props - Names of first-level properties to copy over.
604
583
  * @param a - Target object.
605
584
  * @param b - Source object.
606
585
  * @param allowDeletion - If true, delete property in a if explicitly set to null in b.
607
- *
608
586
  * @returns Argument a.
609
587
  */
610
588
  function selectiveDeepExtend(props, a, b, allowDeletion = false) {
@@ -644,13 +622,11 @@
644
622
  * The properties of `b` are considered for copying. Properties which are
645
623
  * themselves objects are are also extended. Only properties with defined
646
624
  * values are copied.
647
- *
648
625
  * @param propsToExclude - Names of properties which should *not* be copied.
649
626
  * @param a - Object to extend.
650
627
  * @param b - Object to take properties from for extension.
651
628
  * @param allowDeletion - If true, delete properties in a that are explicitly
652
629
  * set to null in b.
653
- *
654
630
  * @returns Argument a.
655
631
  */
656
632
  function selectiveNotDeepExtend(propsToExclude, a, b, allowDeletion = false) {
@@ -698,7 +674,6 @@
698
674
  * (That is the options objects that inherit from others will also get the
699
675
  * inherited options).
700
676
  * @param allowDeletion - If true, the values of fields that are null will be deleted.
701
- *
702
677
  * @returns Argument a.
703
678
  */
704
679
  function deepExtend(a, b, protoExtend = false, allowDeletion = false) {
@@ -734,7 +709,6 @@
734
709
  *
735
710
  * @param a - First array.
736
711
  * @param b - Second array.
737
- *
738
712
  * @returns True if both arrays have the same length and same elements (1 = '1').
739
713
  */
740
714
  function equalArray(a, b) {
@@ -752,7 +726,6 @@
752
726
  * Get the type of an object, for example exports.getType([]) returns 'Array'.
753
727
  *
754
728
  * @param object - Input value of unknown type.
755
- *
756
729
  * @returns Detected type.
757
730
  */
758
731
  function getType(object) {
@@ -797,7 +770,6 @@
797
770
  *
798
771
  * @param arr - First part.
799
772
  * @param newValue - The value to be aadded into the array.
800
- *
801
773
  * @returns A new array with all items from arr and newValue (which is last).
802
774
  */
803
775
  function copyAndExtendArray(arr, newValue) {
@@ -807,7 +779,6 @@
807
779
  * Used to extend an array and copy it. This is used to propagate paths recursively.
808
780
  *
809
781
  * @param arr - The array to be copied.
810
- *
811
782
  * @returns Shallow copy of arr.
812
783
  */
813
784
  function copyArray(arr) {
@@ -817,7 +788,6 @@
817
788
  * Retrieve the absolute left value of a DOM element.
818
789
  *
819
790
  * @param elem - A dom element, for example a div.
820
- *
821
791
  * @returns The absolute left position of this element in the browser page.
822
792
  */
823
793
  function getAbsoluteLeft(elem) {
@@ -827,7 +797,6 @@
827
797
  * Retrieve the absolute right value of a DOM element.
828
798
  *
829
799
  * @param elem - A dom element, for example a div.
830
- *
831
800
  * @returns The absolute right position of this element in the browser page.
832
801
  */
833
802
  function getAbsoluteRight(elem) {
@@ -837,7 +806,6 @@
837
806
  * Retrieve the absolute top value of a DOM element.
838
807
  *
839
808
  * @param elem - A dom element, for example a div.
840
- *
841
809
  * @returns The absolute top position of this element in the browser page.
842
810
  */
843
811
  function getAbsoluteTop(elem) {
@@ -900,7 +868,6 @@
900
868
  * Convert an object into an array: all objects properties are put into the array. The resulting array is unordered.
901
869
  *
902
870
  * @param o - Object that contains the properties and methods.
903
- *
904
871
  * @returns An array of unordered values.
905
872
  */
906
873
  const toArray = Object.values;
@@ -910,7 +877,6 @@
910
877
  * @param object - The object whose property will be updated.
911
878
  * @param key - Name of the property to be updated.
912
879
  * @param value - The new value to be assigned.
913
- *
914
880
  * @returns Whether the value was updated (true) or already strictly the same in the original object (false).
915
881
  */
916
882
  function updateProperty(object, key, value) {
@@ -926,7 +892,6 @@
926
892
  * Throttle the given function to be only executed once per animation frame.
927
893
  *
928
894
  * @param fn - The original function.
929
- *
930
895
  * @returns The throttled function.
931
896
  */
932
897
  function throttle(fn) {
@@ -1010,7 +975,6 @@
1010
975
  * Get HTML element which is the target of the event.
1011
976
  *
1012
977
  * @param event - The event.
1013
- *
1014
978
  * @returns The element or null if not obtainable.
1015
979
  */
1016
980
  function getTarget(event = window.event) {
@@ -1041,7 +1005,6 @@
1041
1005
  *
1042
1006
  * @param element - The element to be tested.
1043
1007
  * @param parent - The ancestor (not necessarily parent) of the element.
1044
- *
1045
1008
  * @returns True if parent is an ancestor of the element, false otherwise.
1046
1009
  */
1047
1010
  function hasParent(element, parent) {
@@ -1065,7 +1028,6 @@
1065
1028
  *
1066
1029
  * @param value - Value to be converted intoboolean, a function will be executed as `(() => unknown)`.
1067
1030
  * @param defaultValue - If the value or the return value of the function == null then this will be returned.
1068
- *
1069
1031
  * @returns Corresponding boolean value, if none then the default value, if none then null.
1070
1032
  */
1071
1033
  asBoolean(value, defaultValue) {
@@ -1082,7 +1044,6 @@
1082
1044
  *
1083
1045
  * @param value - Value to be converted intonumber, a function will be executed as `(() => unknown)`.
1084
1046
  * @param defaultValue - If the value or the return value of the function == null then this will be returned.
1085
- *
1086
1047
  * @returns Corresponding **boxed** number value, if none then the default value, if none then null.
1087
1048
  */
1088
1049
  asNumber(value, defaultValue) {
@@ -1099,7 +1060,6 @@
1099
1060
  *
1100
1061
  * @param value - Value to be converted intostring, a function will be executed as `(() => unknown)`.
1101
1062
  * @param defaultValue - If the value or the return value of the function == null then this will be returned.
1102
- *
1103
1063
  * @returns Corresponding **boxed** string value, if none then the default value, if none then null.
1104
1064
  */
1105
1065
  asString(value, defaultValue) {
@@ -1116,7 +1076,6 @@
1116
1076
  *
1117
1077
  * @param value - Value to be converted intosize, a function will be executed as `(() => unknown)`.
1118
1078
  * @param defaultValue - If the value or the return value of the function == null then this will be returned.
1119
- *
1120
1079
  * @returns Corresponding string value (number + 'px'), if none then the default value, if none then null.
1121
1080
  */
1122
1081
  asSize(value, defaultValue) {
@@ -1138,7 +1097,6 @@
1138
1097
  *
1139
1098
  * @param value - Value to be converted into DOM Element, a function will be executed as `(() => unknown)`.
1140
1099
  * @param defaultValue - If the value or the return value of the function == null then this will be returned.
1141
- *
1142
1100
  * @returns The DOM Element, if none then the default value, if none then null.
1143
1101
  */
1144
1102
  asElement(value, defaultValue) {
@@ -1153,9 +1111,7 @@
1153
1111
  *
1154
1112
  * @remarks
1155
1113
  * {@link http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb}
1156
- *
1157
1114
  * @param hex - Hex color string (3 or 6 digits, with or without #).
1158
- *
1159
1115
  * @returns RGB color object.
1160
1116
  */
1161
1117
  function hexToRGB(hex) {
@@ -1190,7 +1146,6 @@
1190
1146
  *
1191
1147
  * @param color - The color string (hex, RGB, RGBA).
1192
1148
  * @param opacity - The new opacity.
1193
- *
1194
1149
  * @returns RGBA string, for example 'rgba(255, 0, 127, 0.3)'.
1195
1150
  */
1196
1151
  function overrideOpacity(color, opacity) {
@@ -1220,7 +1175,6 @@
1220
1175
  * @param red - Red channel.
1221
1176
  * @param green - Green channel.
1222
1177
  * @param blue - Blue channel.
1223
- *
1224
1178
  * @returns Hex color string (for example: '#0acdc0').
1225
1179
  */
1226
1180
  function RGBToHex(red, green, blue) {
@@ -1231,7 +1185,6 @@
1231
1185
  *
1232
1186
  * @param inputColor - Shorthand color string or input color object.
1233
1187
  * @param defaultColor - Full color object to fill in missing values in inputColor.
1234
- *
1235
1188
  * @returns Color object.
1236
1189
  */
1237
1190
  function parseColor(inputColor, defaultColor) {
@@ -1353,11 +1306,9 @@
1353
1306
  *
1354
1307
  * @remarks
1355
1308
  * {@link http://www.javascripter.net/faq/rgb2hsv.htm}
1356
- *
1357
1309
  * @param red - Red channel.
1358
1310
  * @param green - Green channel.
1359
1311
  * @param blue - Blue channel.
1360
- *
1361
1312
  * @returns HSV color object.
1362
1313
  */
1363
1314
  function RGBToHSV(red, green, blue) {
@@ -1378,29 +1329,21 @@
1378
1329
  const value = maxRGB;
1379
1330
  return { h: hue, s: saturation, v: value };
1380
1331
  }
1381
- const cssUtil = {
1382
- // split a string with css styles into an object with key/values
1383
- split(cssText) {
1384
- const styles = {};
1385
- cssText.split(";").forEach((style) => {
1386
- if (style.trim() != "") {
1387
- const parts = style.split(":");
1388
- const key = parts[0].trim();
1389
- const value = parts[1].trim();
1390
- styles[key] = value;
1391
- }
1392
- });
1393
- return styles;
1394
- },
1395
- // build a css text string from an object with key/values
1396
- join(styles) {
1397
- return Object.keys(styles)
1398
- .map(function (key) {
1399
- return key + ": " + styles[key];
1400
- })
1401
- .join("; ");
1402
- },
1403
- };
1332
+ /**
1333
+ * Split a string with css styles into an object with key/values.
1334
+ *
1335
+ * @param cssText - CSS source code to split into key/value object.
1336
+ * @returns Key/value object corresponding to {@link cssText}.
1337
+ */
1338
+ function splitCSSText(cssText) {
1339
+ const tmpEllement = document.createElement("div");
1340
+ const styles = {};
1341
+ tmpEllement.style.cssText = cssText;
1342
+ for (let i = 0; i < tmpEllement.style.length; ++i) {
1343
+ styles[tmpEllement.style[i]] = tmpEllement.style.getPropertyValue(tmpEllement.style[i]);
1344
+ }
1345
+ return styles;
1346
+ }
1404
1347
  /**
1405
1348
  * Append a string with css styles to an element.
1406
1349
  *
@@ -1408,13 +1351,10 @@
1408
1351
  * @param cssText - The styles to be appended.
1409
1352
  */
1410
1353
  function addCssText(element, cssText) {
1411
- const currentStyles = cssUtil.split(element.style.cssText);
1412
- const newStyles = cssUtil.split(cssText);
1413
- const styles = {
1414
- ...currentStyles,
1415
- ...newStyles,
1416
- };
1417
- element.style.cssText = cssUtil.join(styles);
1354
+ const cssStyle = splitCSSText(cssText);
1355
+ for (const [key, value] of Object.entries(cssStyle)) {
1356
+ element.style.setProperty(key, value);
1357
+ }
1418
1358
  }
1419
1359
  /**
1420
1360
  * Remove a string with css styles from an element.
@@ -1423,25 +1363,19 @@
1423
1363
  * @param cssText - The styles to be removed.
1424
1364
  */
1425
1365
  function removeCssText(element, cssText) {
1426
- const styles = cssUtil.split(element.style.cssText);
1427
- const removeStyles = cssUtil.split(cssText);
1428
- for (const key in removeStyles) {
1429
- if (Object.prototype.hasOwnProperty.call(removeStyles, key)) {
1430
- delete styles[key];
1431
- }
1366
+ const cssStyle = splitCSSText(cssText);
1367
+ for (const key of Object.keys(cssStyle)) {
1368
+ element.style.removeProperty(key);
1432
1369
  }
1433
- element.style.cssText = cssUtil.join(styles);
1434
1370
  }
1435
1371
  /**
1436
1372
  * Convert HSV \<0, 1\> into RGB color object.
1437
1373
  *
1438
1374
  * @remarks
1439
1375
  * {@link https://gist.github.com/mjijackson/5311256}
1440
- *
1441
1376
  * @param h - Hue.
1442
1377
  * @param s - Saturation.
1443
1378
  * @param v - Value.
1444
- *
1445
1379
  * @returns RGB color object.
1446
1380
  */
1447
1381
  function HSVToRGB(h, s, v) {
@@ -1485,7 +1419,6 @@
1485
1419
  * @param h - Hue.
1486
1420
  * @param s - Saturation.
1487
1421
  * @param v - Value.
1488
- *
1489
1422
  * @returns Hex color string.
1490
1423
  */
1491
1424
  function HSVToHex(h, s, v) {
@@ -1496,7 +1429,6 @@
1496
1429
  * Convert hex color string into HSV \<0, 1\>.
1497
1430
  *
1498
1431
  * @param hex - Hex color string.
1499
- *
1500
1432
  * @returns HSV color object.
1501
1433
  */
1502
1434
  function hexToHSV(hex) {
@@ -1510,7 +1442,6 @@
1510
1442
  * Validate hex color string.
1511
1443
  *
1512
1444
  * @param hex - Unknown string that may contain a color.
1513
- *
1514
1445
  * @returns True if the string is valid, false otherwise.
1515
1446
  */
1516
1447
  function isValidHex(hex) {
@@ -1521,7 +1452,6 @@
1521
1452
  * Validate RGB color string.
1522
1453
  *
1523
1454
  * @param rgb - Unknown string that may contain a color.
1524
- *
1525
1455
  * @returns True if the string is valid, false otherwise.
1526
1456
  */
1527
1457
  function isValidRGB(rgb) {
@@ -1531,7 +1461,6 @@
1531
1461
  * Validate RGBA color string.
1532
1462
  *
1533
1463
  * @param rgba - Unknown string that may contain a color.
1534
- *
1535
1464
  * @returns True if the string is valid, false otherwise.
1536
1465
  */
1537
1466
  function isValidRGBA(rgba) {
@@ -1543,7 +1472,6 @@
1543
1472
  *
1544
1473
  * @param fields - Names of properties to be bridged.
1545
1474
  * @param referenceObject - The original object.
1546
- *
1547
1475
  * @returns A new object inheriting from the referenceObject.
1548
1476
  */
1549
1477
  function selectiveBridgeObject(fields, referenceObject) {
@@ -1568,7 +1496,6 @@
1568
1496
  * This is used for default options.
1569
1497
  *
1570
1498
  * @param referenceObject - The original object.
1571
- *
1572
1499
  * @returns The Element if the referenceObject is an Element, or a new object inheriting from the referenceObject.
1573
1500
  */
1574
1501
  function bridgeObject(referenceObject) {
@@ -1594,7 +1521,6 @@
1594
1521
  *
1595
1522
  * @param a - The array to be sorted (in-place).
1596
1523
  * @param compare - An order comparator.
1597
- *
1598
1524
  * @returns The argument a.
1599
1525
  */
1600
1526
  function insertSort(a, compare) {
@@ -1722,7 +1648,6 @@
1722
1648
  * @param comparator - -1 is lower, 0 is equal, 1 is higher.
1723
1649
  * @param field - Property name on an item (That is item[field]).
1724
1650
  * @param field2 - Second property name on an item (That is item[field][field2]).
1725
- *
1726
1651
  * @returns Index of the found item or -1 if nothing was found.
1727
1652
  */
1728
1653
  function binarySearchCustom(orderedItems, comparator, field, field2) {
@@ -1762,7 +1687,6 @@
1762
1687
  * @param field - Name of the property in items to be searched.
1763
1688
  * @param sidePreference - If the target is between two values, should the index of the before or the after be returned?
1764
1689
  * @param comparator - An optional comparator, returning -1, 0, 1 for \<, ===, \>.
1765
- *
1766
1690
  * @returns The index of found value or -1 if nothing was found.
1767
1691
  */
1768
1692
  function binarySearchValue(orderedItems, target, field, sidePreference, comparator) {
@@ -1831,7 +1755,6 @@
1831
1755
  * Provides no easing and no acceleration.
1832
1756
  *
1833
1757
  * @param t - Time.
1834
- *
1835
1758
  * @returns Value at time t.
1836
1759
  */
1837
1760
  linear(t) {
@@ -1841,7 +1764,6 @@
1841
1764
  * Accelerate from zero velocity.
1842
1765
  *
1843
1766
  * @param t - Time.
1844
- *
1845
1767
  * @returns Value at time t.
1846
1768
  */
1847
1769
  easeInQuad(t) {
@@ -1851,7 +1773,6 @@
1851
1773
  * Decelerate to zero velocity.
1852
1774
  *
1853
1775
  * @param t - Time.
1854
- *
1855
1776
  * @returns Value at time t.
1856
1777
  */
1857
1778
  easeOutQuad(t) {
@@ -1861,7 +1782,6 @@
1861
1782
  * Accelerate until halfway, then decelerate.
1862
1783
  *
1863
1784
  * @param t - Time.
1864
- *
1865
1785
  * @returns Value at time t.
1866
1786
  */
1867
1787
  easeInOutQuad(t) {
@@ -1871,7 +1791,6 @@
1871
1791
  * Accelerate from zero velocity.
1872
1792
  *
1873
1793
  * @param t - Time.
1874
- *
1875
1794
  * @returns Value at time t.
1876
1795
  */
1877
1796
  easeInCubic(t) {
@@ -1881,7 +1800,6 @@
1881
1800
  * Decelerate to zero velocity.
1882
1801
  *
1883
1802
  * @param t - Time.
1884
- *
1885
1803
  * @returns Value at time t.
1886
1804
  */
1887
1805
  easeOutCubic(t) {
@@ -1891,7 +1809,6 @@
1891
1809
  * Accelerate until halfway, then decelerate.
1892
1810
  *
1893
1811
  * @param t - Time.
1894
- *
1895
1812
  * @returns Value at time t.
1896
1813
  */
1897
1814
  easeInOutCubic(t) {
@@ -1901,7 +1818,6 @@
1901
1818
  * Accelerate from zero velocity.
1902
1819
  *
1903
1820
  * @param t - Time.
1904
- *
1905
1821
  * @returns Value at time t.
1906
1822
  */
1907
1823
  easeInQuart(t) {
@@ -1911,7 +1827,6 @@
1911
1827
  * Decelerate to zero velocity.
1912
1828
  *
1913
1829
  * @param t - Time.
1914
- *
1915
1830
  * @returns Value at time t.
1916
1831
  */
1917
1832
  easeOutQuart(t) {
@@ -1921,7 +1836,6 @@
1921
1836
  * Accelerate until halfway, then decelerate.
1922
1837
  *
1923
1838
  * @param t - Time.
1924
- *
1925
1839
  * @returns Value at time t.
1926
1840
  */
1927
1841
  easeInOutQuart(t) {
@@ -1931,7 +1845,6 @@
1931
1845
  * Accelerate from zero velocity.
1932
1846
  *
1933
1847
  * @param t - Time.
1934
- *
1935
1848
  * @returns Value at time t.
1936
1849
  */
1937
1850
  easeInQuint(t) {
@@ -1941,7 +1854,6 @@
1941
1854
  * Decelerate to zero velocity.
1942
1855
  *
1943
1856
  * @param t - Time.
1944
- *
1945
1857
  * @returns Value at time t.
1946
1858
  */
1947
1859
  easeOutQuint(t) {
@@ -1951,7 +1863,6 @@
1951
1863
  * Accelerate until halfway, then decelerate.
1952
1864
  *
1953
1865
  * @param t - Time.
1954
- *
1955
1866
  * @returns Value at time t.
1956
1867
  */
1957
1868
  easeInOutQuint(t) {
@@ -2007,7 +1918,6 @@
2007
1918
  * @param pile - Array of objects, no required format.
2008
1919
  * @param accessors - Array of property names.
2009
1920
  * For example `object['foo']['bar']` → `['foo', 'bar']`.
2010
- *
2011
1921
  * @returns Value of the property with given accessors path from the first pile item where it's not undefined.
2012
1922
  */
2013
1923
  function topMost(pile, accessors) {
@@ -2177,7 +2087,7 @@
2177
2087
  /**
2178
2088
  * @param {number} [pixelRatio=1]
2179
2089
  */
2180
- class ColorPicker {
2090
+ let ColorPicker$1 = class ColorPicker {
2181
2091
  /**
2182
2092
  * @param {number} [pixelRatio=1]
2183
2093
  */
@@ -2688,7 +2598,7 @@
2688
2598
  _bindHammer() {
2689
2599
  this.drag = {};
2690
2600
  this.pinch = {};
2691
- this.hammer = new Hammer(this.colorPickerCanvas);
2601
+ this.hammer = new Hammer$1(this.colorPickerCanvas);
2692
2602
  this.hammer.get("pinch").set({ enable: true });
2693
2603
 
2694
2604
  this.hammer.on("hammer.input", (event) => {
@@ -2822,13 +2732,12 @@
2822
2732
  this.color.a +
2823
2733
  ")";
2824
2734
  }
2825
- }
2735
+ };
2826
2736
 
2827
2737
  /**
2828
2738
  * Wrap given text (last argument) in HTML elements (all preceding arguments).
2829
2739
  *
2830
2740
  * @param {...any} rest - List of tag names followed by inner text.
2831
- *
2832
2741
  * @returns An element or a text node.
2833
2742
  */
2834
2743
  function wrapInTag(...rest) {
@@ -2852,7 +2761,7 @@
2852
2761
  *
2853
2762
  * The options are matched with their counterparts in each of the modules and the values used in the configuration are
2854
2763
  */
2855
- class Configurator {
2764
+ let Configurator$1 = class Configurator {
2856
2765
  /**
2857
2766
  * @param {object} parentModule | the location where parentModule.setOptions() can be called
2858
2767
  * @param {object} defaultContainer | the default container of the module
@@ -2890,7 +2799,7 @@
2890
2799
  this.popupDiv = {};
2891
2800
  this.popupLimit = 5;
2892
2801
  this.popupHistory = {};
2893
- this.colorPicker = new ColorPicker(pixelRatio);
2802
+ this.colorPicker = new ColorPicker$1(pixelRatio);
2894
2803
  this.wrapper = undefined;
2895
2804
  }
2896
2805
 
@@ -3621,12 +3530,12 @@
3621
3530
  }
3622
3531
  return options;
3623
3532
  }
3624
- }
3533
+ };
3625
3534
 
3626
3535
  /**
3627
3536
  * Popup is a class to create a popup window with some text
3628
3537
  */
3629
- class Popup {
3538
+ let Popup$1 = class Popup {
3630
3539
  /**
3631
3540
  * @param {Element} container The container object.
3632
3541
  * @param {string} overflowMethod How the popup should act to overflowing ('flip' or 'cap')
@@ -3758,17 +3667,17 @@
3758
3667
  destroy() {
3759
3668
  this.frame.parentNode.removeChild(this.frame); // Remove element from DOM
3760
3669
  }
3761
- }
3670
+ };
3762
3671
 
3763
3672
  let errorFound = false;
3764
3673
  let allOptions;
3765
3674
 
3766
- const VALIDATOR_PRINT_STYLE = "background: #FFeeee; color: #dd0000";
3675
+ const VALIDATOR_PRINT_STYLE$1 = "background: #FFeeee; color: #dd0000";
3767
3676
 
3768
3677
  /**
3769
3678
  * Used to validate options.
3770
3679
  */
3771
- class Validator {
3680
+ let Validator$1 = class Validator {
3772
3681
  /**
3773
3682
  * Main function to be called
3774
3683
  *
@@ -3878,7 +3787,7 @@
3878
3787
  const log = function (message) {
3879
3788
  console.error(
3880
3789
  "%c" + message + Validator.printLocation(path, option),
3881
- VALIDATOR_PRINT_STYLE
3790
+ VALIDATOR_PRINT_STYLE$1
3882
3791
  );
3883
3792
  };
3884
3793
 
@@ -4023,7 +3932,7 @@
4023
3932
 
4024
3933
  console.error(
4025
3934
  '%cUnknown option detected: "' + option + '"' + msg,
4026
- VALIDATOR_PRINT_STYLE
3935
+ VALIDATOR_PRINT_STYLE$1
4027
3936
  );
4028
3937
  errorFound = true;
4029
3938
  }
@@ -4171,29 +4080,29 @@
4171
4080
 
4172
4081
  return matrix[b.length][a.length];
4173
4082
  }
4174
- }
4083
+ };
4175
4084
 
4176
- const Activator$1 = Activator;
4177
- const ColorPicker$1 = ColorPicker;
4178
- const Configurator$1 = Configurator;
4179
- const Hammer$1 = Hammer;
4180
- const Popup$1 = Popup;
4181
- const VALIDATOR_PRINT_STYLE$1 = VALIDATOR_PRINT_STYLE;
4182
- const Validator$1 = Validator;
4085
+ const Activator = Activator$1;
4086
+ const ColorPicker = ColorPicker$1;
4087
+ const Configurator = Configurator$1;
4088
+ const Hammer = Hammer$1;
4089
+ const Popup = Popup$1;
4090
+ const VALIDATOR_PRINT_STYLE = VALIDATOR_PRINT_STYLE$1;
4091
+ const Validator = Validator$1;
4183
4092
 
4184
- exports.Activator = Activator$1;
4093
+ exports.Activator = Activator;
4185
4094
  exports.Alea = Alea;
4186
- exports.ColorPicker = ColorPicker$1;
4187
- exports.Configurator = Configurator$1;
4095
+ exports.ColorPicker = ColorPicker;
4096
+ exports.Configurator = Configurator;
4188
4097
  exports.DELETE = DELETE;
4189
4098
  exports.HSVToHex = HSVToHex;
4190
4099
  exports.HSVToRGB = HSVToRGB;
4191
- exports.Hammer = Hammer$1;
4192
- exports.Popup = Popup$1;
4100
+ exports.Hammer = Hammer;
4101
+ exports.Popup = Popup;
4193
4102
  exports.RGBToHSV = RGBToHSV;
4194
4103
  exports.RGBToHex = RGBToHex;
4195
- exports.VALIDATOR_PRINT_STYLE = VALIDATOR_PRINT_STYLE$1;
4196
- exports.Validator = Validator$1;
4104
+ exports.VALIDATOR_PRINT_STYLE = VALIDATOR_PRINT_STYLE;
4105
+ exports.Validator = Validator;
4197
4106
  exports.addClassName = addClassName;
4198
4107
  exports.addCssText = addCssText;
4199
4108
  exports.addEventListener = addEventListener;
@@ -4245,7 +4154,5 @@
4245
4154
  exports.topMost = topMost;
4246
4155
  exports.updateProperty = updateProperty;
4247
4156
 
4248
- Object.defineProperty(exports, '__esModule', { value: true });
4249
-
4250
- })));
4157
+ }));
4251
4158
  //# sourceMappingURL=vis-util.js.map