vis-data 7.1.8 → 7.1.10

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.
Files changed (47) hide show
  1. package/declarations/data-interface.d.ts +0 -46
  2. package/declarations/data-interface.d.ts.map +1 -1
  3. package/declarations/data-pipe.d.ts +0 -8
  4. package/declarations/data-pipe.d.ts.map +1 -1
  5. package/declarations/data-set-check.d.ts +0 -1
  6. package/declarations/data-set-check.d.ts.map +1 -1
  7. package/declarations/data-set-part.d.ts +0 -1
  8. package/declarations/data-set-part.d.ts.map +1 -1
  9. package/declarations/data-set.d.ts +14 -28
  10. package/declarations/data-set.d.ts.map +1 -1
  11. package/declarations/data-stream.d.ts +0 -18
  12. package/declarations/data-stream.d.ts.map +1 -1
  13. package/declarations/data-view-check.d.ts +0 -1
  14. package/declarations/data-view-check.d.ts.map +1 -1
  15. package/declarations/data-view.d.ts +9 -15
  16. package/declarations/data-view.d.ts.map +1 -1
  17. package/declarations/queue.d.ts +0 -7
  18. package/declarations/queue.d.ts.map +1 -1
  19. package/dist/esm.js +133 -266
  20. package/dist/esm.js.map +1 -1
  21. package/dist/umd.js +133 -266
  22. package/dist/umd.js.map +1 -1
  23. package/esnext/esm/vis-data.js +25 -91
  24. package/esnext/esm/vis-data.js.map +1 -1
  25. package/esnext/esm/vis-data.min.js +2 -2
  26. package/esnext/esm/vis-data.min.js.map +1 -1
  27. package/esnext/umd/vis-data.js +25 -91
  28. package/esnext/umd/vis-data.js.map +1 -1
  29. package/esnext/umd/vis-data.min.js +2 -2
  30. package/esnext/umd/vis-data.min.js.map +1 -1
  31. package/package.json +19 -14
  32. package/peer/esm/vis-data.js +131 -264
  33. package/peer/esm/vis-data.js.map +1 -1
  34. package/peer/esm/vis-data.min.js +4 -4
  35. package/peer/esm/vis-data.min.js.map +1 -1
  36. package/peer/umd/vis-data.js +131 -264
  37. package/peer/umd/vis-data.js.map +1 -1
  38. package/peer/umd/vis-data.min.js +4 -4
  39. package/peer/umd/vis-data.min.js.map +1 -1
  40. package/standalone/esm/vis-data.js +131 -264
  41. package/standalone/esm/vis-data.js.map +1 -1
  42. package/standalone/esm/vis-data.min.js +4 -4
  43. package/standalone/esm/vis-data.min.js.map +1 -1
  44. package/standalone/umd/vis-data.js +131 -264
  45. package/standalone/umd/vis-data.js.map +1 -1
  46. package/standalone/umd/vis-data.min.js +4 -4
  47. package/standalone/umd/vis-data.min.js.map +1 -1
package/dist/umd.js CHANGED
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
6
6
  *
7
- * @version 7.1.8
8
- * @date 2023-11-08T02:10:33.510Z
7
+ * @version 7.1.10
8
+ * @date 2025-07-06T08:43:01.753Z
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
@@ -3180,7 +3180,6 @@
3180
3180
 
3181
3181
  /**
3182
3182
  * Create new data pipe.
3183
- *
3184
3183
  * @param from - The source data set or data view.
3185
3184
  * @remarks
3186
3185
  * Example usage:
@@ -3216,7 +3215,6 @@
3216
3215
  /**
3217
3216
  * Internal implementation of the pipe. This should be accessible only through
3218
3217
  * `createNewDataPipeFrom` from the outside.
3219
- *
3220
3218
  * @typeParam SI - Source item type.
3221
3219
  * @typeParam SP - Source item type's id property name.
3222
3220
  * @typeParam TI - Target item type.
@@ -3225,7 +3223,6 @@
3225
3223
  var SimpleDataPipe = /*#__PURE__*/function () {
3226
3224
  /**
3227
3225
  * Create a new data pipe.
3228
- *
3229
3226
  * @param _source - The data set or data view that will be observed.
3230
3227
  * @param _transformers - An array of transforming functions to be used to
3231
3228
  * filter or transform the items in the pipe.
@@ -3273,7 +3270,6 @@
3273
3270
  }
3274
3271
  /**
3275
3272
  * Apply the transformers to the items.
3276
- *
3277
3273
  * @param items - The items to be transformed.
3278
3274
  * @returns The transformed items.
3279
3275
  */
@@ -3287,7 +3283,6 @@
3287
3283
  }
3288
3284
  /**
3289
3285
  * Handle an add event.
3290
- *
3291
3286
  * @param _name - Ignored.
3292
3287
  * @param payload - The payload containing the ids of the added items.
3293
3288
  */
@@ -3301,7 +3296,6 @@
3301
3296
  }
3302
3297
  /**
3303
3298
  * Handle an update event.
3304
- *
3305
3299
  * @param _name - Ignored.
3306
3300
  * @param payload - The payload containing the ids of the updated items.
3307
3301
  */
@@ -3315,7 +3309,6 @@
3315
3309
  }
3316
3310
  /**
3317
3311
  * Handle a remove event.
3318
- *
3319
3312
  * @param _name - Ignored.
3320
3313
  * @param payload - The payload containing the data of the removed items.
3321
3314
  */
@@ -3333,7 +3326,6 @@
3333
3326
  /**
3334
3327
  * Internal implementation of the pipe factory. This should be accessible
3335
3328
  * only through `createNewDataPipeFrom` from the outside.
3336
- *
3337
3329
  * @typeParam TI - Target item type.
3338
3330
  * @typeParam TP - Target item type's id property name.
3339
3331
  */
@@ -3341,7 +3333,6 @@
3341
3333
  /**
3342
3334
  * Create a new data pipe factory. This is an internal constructor that
3343
3335
  * should never be called from outside of this file.
3344
- *
3345
3336
  * @param _source - The source data set or data view for this pipe.
3346
3337
  */
3347
3338
  function DataPipeUnderConstruction(_source) {
@@ -3355,7 +3346,6 @@
3355
3346
  }
3356
3347
  /**
3357
3348
  * Filter the items.
3358
- *
3359
3349
  * @param callback - A filtering function that returns true if given item
3360
3350
  * should be piped and false if not.
3361
3351
  * @returns This factory for further configuration.
@@ -3370,7 +3360,6 @@
3370
3360
  }
3371
3361
  /**
3372
3362
  * Map each source item to a new type.
3373
- *
3374
3363
  * @param callback - A mapping function that takes a source item and returns
3375
3364
  * corresponding mapped item.
3376
3365
  * @typeParam TI - Target item type.
@@ -3387,7 +3376,6 @@
3387
3376
  }
3388
3377
  /**
3389
3378
  * Map each source item to zero or more items of a new type.
3390
- *
3391
3379
  * @param callback - A mapping function that takes a source item and returns
3392
3380
  * an array of corresponding mapped items.
3393
3381
  * @typeParam TI - Target item type.
@@ -3404,7 +3392,6 @@
3404
3392
  }
3405
3393
  /**
3406
3394
  * Connect this pipe to given data set.
3407
- *
3408
3395
  * @param target - The data set that will receive the items from this pipe.
3409
3396
  * @returns The pipe connected between given data sets and performing
3410
3397
  * configured transformation on the processed items.
@@ -3421,179 +3408,112 @@
3421
3408
  var componentEmitter = {exports: {}};
3422
3409
 
3423
3410
  (function (module) {
3424
- /**
3425
- * Expose `Emitter`.
3426
- */
3427
-
3428
- {
3429
- module.exports = Emitter;
3430
- }
3431
-
3432
- /**
3433
- * Initialize a new `Emitter`.
3434
- *
3435
- * @api public
3436
- */
3437
-
3438
- function Emitter(obj) {
3439
- if (obj) return mixin(obj);
3440
- }
3441
- /**
3442
- * Mixin the emitter properties.
3443
- *
3444
- * @param {Object} obj
3445
- * @return {Object}
3446
- * @api private
3447
- */
3448
-
3449
- function mixin(obj) {
3450
- for (var key in Emitter.prototype) {
3451
- obj[key] = Emitter.prototype[key];
3452
- }
3453
- return obj;
3454
- }
3455
-
3456
- /**
3457
- * Listen on the given `event` with `fn`.
3458
- *
3459
- * @param {String} event
3460
- * @param {Function} fn
3461
- * @return {Emitter}
3462
- * @api public
3463
- */
3464
-
3465
- Emitter.prototype.on =
3466
- Emitter.prototype.addEventListener = function(event, fn){
3467
- this._callbacks = this._callbacks || {};
3468
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
3469
- .push(fn);
3470
- return this;
3471
- };
3472
-
3473
- /**
3474
- * Adds an `event` listener that will be invoked a single
3475
- * time then automatically removed.
3476
- *
3477
- * @param {String} event
3478
- * @param {Function} fn
3479
- * @return {Emitter}
3480
- * @api public
3481
- */
3482
-
3483
- Emitter.prototype.once = function(event, fn){
3484
- function on() {
3485
- this.off(event, on);
3486
- fn.apply(this, arguments);
3487
- }
3488
-
3489
- on.fn = fn;
3490
- this.on(event, on);
3491
- return this;
3492
- };
3493
-
3494
- /**
3495
- * Remove the given callback for `event` or all
3496
- * registered callbacks.
3497
- *
3498
- * @param {String} event
3499
- * @param {Function} fn
3500
- * @return {Emitter}
3501
- * @api public
3502
- */
3503
-
3504
- Emitter.prototype.off =
3505
- Emitter.prototype.removeListener =
3506
- Emitter.prototype.removeAllListeners =
3507
- Emitter.prototype.removeEventListener = function(event, fn){
3508
- this._callbacks = this._callbacks || {};
3509
-
3510
- // all
3511
- if (0 == arguments.length) {
3512
- this._callbacks = {};
3513
- return this;
3514
- }
3515
-
3516
- // specific event
3517
- var callbacks = this._callbacks['$' + event];
3518
- if (!callbacks) return this;
3519
-
3520
- // remove all handlers
3521
- if (1 == arguments.length) {
3522
- delete this._callbacks['$' + event];
3523
- return this;
3524
- }
3525
-
3526
- // remove specific handler
3527
- var cb;
3528
- for (var i = 0; i < callbacks.length; i++) {
3529
- cb = callbacks[i];
3530
- if (cb === fn || cb.fn === fn) {
3531
- callbacks.splice(i, 1);
3532
- break;
3533
- }
3534
- }
3535
-
3536
- // Remove event specific arrays for event types that no
3537
- // one is subscribed for to avoid memory leak.
3538
- if (callbacks.length === 0) {
3539
- delete this._callbacks['$' + event];
3540
- }
3541
-
3542
- return this;
3543
- };
3544
-
3545
- /**
3546
- * Emit `event` with the given args.
3547
- *
3548
- * @param {String} event
3549
- * @param {Mixed} ...
3550
- * @return {Emitter}
3551
- */
3552
-
3553
- Emitter.prototype.emit = function(event){
3554
- this._callbacks = this._callbacks || {};
3555
-
3556
- var args = new Array(arguments.length - 1)
3557
- , callbacks = this._callbacks['$' + event];
3558
-
3559
- for (var i = 1; i < arguments.length; i++) {
3560
- args[i - 1] = arguments[i];
3561
- }
3562
-
3563
- if (callbacks) {
3564
- callbacks = callbacks.slice(0);
3565
- for (var i = 0, len = callbacks.length; i < len; ++i) {
3566
- callbacks[i].apply(this, args);
3567
- }
3568
- }
3569
-
3570
- return this;
3571
- };
3572
-
3573
- /**
3574
- * Return array of callbacks for `event`.
3575
- *
3576
- * @param {String} event
3577
- * @return {Array}
3578
- * @api public
3579
- */
3580
-
3581
- Emitter.prototype.listeners = function(event){
3582
- this._callbacks = this._callbacks || {};
3583
- return this._callbacks['$' + event] || [];
3584
- };
3585
-
3586
- /**
3587
- * Check if this emitter has `event` handlers.
3588
- *
3589
- * @param {String} event
3590
- * @return {Boolean}
3591
- * @api public
3592
- */
3593
-
3594
- Emitter.prototype.hasListeners = function(event){
3595
- return !! this.listeners(event).length;
3596
- };
3411
+ function Emitter(object) {
3412
+ if (object) {
3413
+ return mixin(object);
3414
+ }
3415
+
3416
+ this._callbacks = new Map();
3417
+ }
3418
+
3419
+ function mixin(object) {
3420
+ Object.assign(object, Emitter.prototype);
3421
+ object._callbacks = new Map();
3422
+ return object;
3423
+ }
3424
+
3425
+ Emitter.prototype.on = function (event, listener) {
3426
+ const callbacks = this._callbacks.get(event) ?? [];
3427
+ callbacks.push(listener);
3428
+ this._callbacks.set(event, callbacks);
3429
+ return this;
3430
+ };
3431
+
3432
+ Emitter.prototype.once = function (event, listener) {
3433
+ const on = (...arguments_) => {
3434
+ this.off(event, on);
3435
+ listener.apply(this, arguments_);
3436
+ };
3437
+
3438
+ on.fn = listener;
3439
+ this.on(event, on);
3440
+ return this;
3441
+ };
3442
+
3443
+ Emitter.prototype.off = function (event, listener) {
3444
+ if (event === undefined && listener === undefined) {
3445
+ this._callbacks.clear();
3446
+ return this;
3447
+ }
3448
+
3449
+ if (listener === undefined) {
3450
+ this._callbacks.delete(event);
3451
+ return this;
3452
+ }
3453
+
3454
+ const callbacks = this._callbacks.get(event);
3455
+ if (callbacks) {
3456
+ for (const [index, callback] of callbacks.entries()) {
3457
+ if (callback === listener || callback.fn === listener) {
3458
+ callbacks.splice(index, 1);
3459
+ break;
3460
+ }
3461
+ }
3462
+
3463
+ if (callbacks.length === 0) {
3464
+ this._callbacks.delete(event);
3465
+ } else {
3466
+ this._callbacks.set(event, callbacks);
3467
+ }
3468
+ }
3469
+
3470
+ return this;
3471
+ };
3472
+
3473
+ Emitter.prototype.emit = function (event, ...arguments_) {
3474
+ const callbacks = this._callbacks.get(event);
3475
+ if (callbacks) {
3476
+ // Create a copy of the callbacks array to avoid issues if it's modified during iteration
3477
+ const callbacksCopy = [...callbacks];
3478
+
3479
+ for (const callback of callbacksCopy) {
3480
+ callback.apply(this, arguments_);
3481
+ }
3482
+ }
3483
+
3484
+ return this;
3485
+ };
3486
+
3487
+ Emitter.prototype.listeners = function (event) {
3488
+ return this._callbacks.get(event) ?? [];
3489
+ };
3490
+
3491
+ Emitter.prototype.listenerCount = function (event) {
3492
+ if (event) {
3493
+ return this.listeners(event).length;
3494
+ }
3495
+
3496
+ let totalCount = 0;
3497
+ for (const callbacks of this._callbacks.values()) {
3498
+ totalCount += callbacks.length;
3499
+ }
3500
+
3501
+ return totalCount;
3502
+ };
3503
+
3504
+ Emitter.prototype.hasListeners = function (event) {
3505
+ return this.listenerCount(event) > 0;
3506
+ };
3507
+
3508
+ // Aliases
3509
+ Emitter.prototype.addEventListener = Emitter.prototype.on;
3510
+ Emitter.prototype.removeListener = Emitter.prototype.off;
3511
+ Emitter.prototype.removeEventListener = Emitter.prototype.off;
3512
+ Emitter.prototype.removeAllListeners = Emitter.prototype.off;
3513
+
3514
+ {
3515
+ module.exports = Emitter;
3516
+ }
3597
3517
  } (componentEmitter));
3598
3518
 
3599
3519
  var componentEmitterExports = componentEmitter.exports;
@@ -6592,8 +6512,8 @@
6592
6512
  *
6593
6513
  * utilitie collection for visjs
6594
6514
  *
6595
- * @version 5.0.6
6596
- * @date 2023-11-04T04:55:09.542Z
6515
+ * @version 5.0.7
6516
+ * @date 2023-11-20T09:06:51.067Z
6597
6517
  *
6598
6518
  * @copyright (c) 2011-2017 Almende B.V, http://almende.com
6599
6519
  * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
@@ -10378,7 +10298,6 @@
10378
10298
 
10379
10299
  /**
10380
10300
  * Determine whether a value can be used as an id.
10381
- *
10382
10301
  * @param value - Input value of unknown type.
10383
10302
  * @returns True if the value is valid id, false otherwise.
10384
10303
  */
@@ -10543,13 +10462,11 @@
10543
10462
 
10544
10463
  /**
10545
10464
  * A queue.
10546
- *
10547
10465
  * @typeParam T - The type of method names to be replaced by queued versions.
10548
10466
  */
10549
10467
  var Queue = /*#__PURE__*/function () {
10550
10468
  /**
10551
10469
  * Construct a new Queue.
10552
- *
10553
10470
  * @param options - Queue configuration.
10554
10471
  */
10555
10472
  function Queue(options) {
@@ -10566,7 +10483,6 @@
10566
10483
  }
10567
10484
  /**
10568
10485
  * Update the configuration of the queue.
10569
- *
10570
10486
  * @param options - Queue configuration.
10571
10487
  */
10572
10488
  _createClass(Queue, [{
@@ -10583,7 +10499,6 @@
10583
10499
  /**
10584
10500
  * Extend an object with queuing functionality.
10585
10501
  * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
10586
- *
10587
10502
  * @param object - The object to be extended.
10588
10503
  * @param options - Additional options.
10589
10504
  * @returns The created queue.
@@ -10614,7 +10529,6 @@
10614
10529
  }
10615
10530
  /**
10616
10531
  * Replace a method on an object with a queued version.
10617
- *
10618
10532
  * @param object - Object having the method.
10619
10533
  * @param method - The method name.
10620
10534
  */
@@ -10641,7 +10555,6 @@
10641
10555
  }
10642
10556
  /**
10643
10557
  * Queue a call.
10644
- *
10645
10558
  * @param entry - The function or entry to be queued.
10646
10559
  */
10647
10560
  }, {
@@ -10727,7 +10640,6 @@
10727
10640
 
10728
10641
  /**
10729
10642
  * {@link DataSet} code that can be reused in {@link DataView} or other similar implementations of {@link DataInterface}.
10730
- *
10731
10643
  * @typeParam Item - Item type that may or may not have an id.
10732
10644
  * @typeParam IdProp - Name of the property that contains the id.
10733
10645
  */
@@ -10754,7 +10666,6 @@
10754
10666
  value:
10755
10667
  /**
10756
10668
  * Trigger an event
10757
- *
10758
10669
  * @param event - Event name.
10759
10670
  * @param payload - Event payload.
10760
10671
  * @param senderId - Id of the sender.
@@ -10770,7 +10681,6 @@
10770
10681
  }
10771
10682
  /**
10772
10683
  * Subscribe to an event, add an event listener.
10773
- *
10774
10684
  * @remarks Non-function callbacks are ignored.
10775
10685
  * @param event - Event name.
10776
10686
  * @param callback - Callback method.
@@ -10785,7 +10695,6 @@
10785
10695
  }
10786
10696
  /**
10787
10697
  * Unsubscribe from an event, remove an event listener.
10788
- *
10789
10698
  * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
10790
10699
  * @param event - Event name.
10791
10700
  * @param callback - Callback method.
@@ -10902,7 +10811,6 @@
10902
10811
  function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10903
10812
  /**
10904
10813
  * Data stream
10905
- *
10906
10814
  * @remarks
10907
10815
  * {@link DataStream} offers an always up to date stream of items from a {@link DataSet} or {@link DataView}.
10908
10816
  * That means that the stream is evaluated at the time of iteration, conversion to another data type or when {@link cache} is called, not when the {@link DataStream} was created.
@@ -10912,7 +10820,6 @@
10912
10820
  var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
10913
10821
  /**
10914
10822
  * Create a new data stream.
10915
- *
10916
10823
  * @param pairs - The id, item pairs.
10917
10824
  */
10918
10825
  function DataStream(pairs) {
@@ -11093,7 +11000,6 @@
11093
11000
  })
11094
11001
  /**
11095
11002
  * Return an array containing all the ids in this stream.
11096
- *
11097
11003
  * @remarks
11098
11004
  * The array may contain duplicities.
11099
11005
  * @returns The array with all ids from this stream.
@@ -11108,7 +11014,6 @@
11108
11014
  }
11109
11015
  /**
11110
11016
  * Return an array containing all the items in this stream.
11111
- *
11112
11017
  * @remarks
11113
11018
  * The array may contain duplicities.
11114
11019
  * @returns The array with all items from this stream.
@@ -11123,7 +11028,6 @@
11123
11028
  }
11124
11029
  /**
11125
11030
  * Return an array containing all the entries in this stream.
11126
- *
11127
11031
  * @remarks
11128
11032
  * The array may contain duplicities.
11129
11033
  * @returns The array with all entries from this stream.
@@ -11135,7 +11039,6 @@
11135
11039
  }
11136
11040
  /**
11137
11041
  * Return an object map containing all the items in this stream accessible by ids.
11138
- *
11139
11042
  * @remarks
11140
11043
  * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
11141
11044
  * @returns The object map of all id → item pairs from this stream.
@@ -11162,7 +11065,6 @@
11162
11065
  }
11163
11066
  /**
11164
11067
  * Return a map containing all the items in this stream accessible by ids.
11165
- *
11166
11068
  * @returns The map of all id → item pairs from this stream.
11167
11069
  */
11168
11070
  }, {
@@ -11172,7 +11074,6 @@
11172
11074
  }
11173
11075
  /**
11174
11076
  * Return a set containing all the (unique) ids in this stream.
11175
- *
11176
11077
  * @returns The set of all ids from this stream.
11177
11078
  */
11178
11079
  }, {
@@ -11182,7 +11083,6 @@
11182
11083
  }
11183
11084
  /**
11184
11085
  * Return a set containing all the (unique) items in this stream.
11185
- *
11186
11086
  * @returns The set of all items from this stream.
11187
11087
  */
11188
11088
  }, {
@@ -11192,7 +11092,6 @@
11192
11092
  }
11193
11093
  /**
11194
11094
  * Cache the items from this stream.
11195
- *
11196
11095
  * @remarks
11197
11096
  * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
11198
11097
  * It can also be used to optimize performance as {@link DataStream} would otherwise reevaluate everything upon each iteration.
@@ -11219,7 +11118,6 @@
11219
11118
  }
11220
11119
  /**
11221
11120
  * Get the distinct values of given property.
11222
- *
11223
11121
  * @param callback - The function that picks and possibly converts the property.
11224
11122
  * @typeParam T - The type of the distinct value.
11225
11123
  * @returns A set of all distinct properties.
@@ -11246,7 +11144,6 @@
11246
11144
  }
11247
11145
  /**
11248
11146
  * Filter the items of the stream.
11249
- *
11250
11147
  * @param callback - The function that decides whether an item will be included.
11251
11148
  * @returns A new data stream with the filtered items.
11252
11149
  */
@@ -11301,7 +11198,6 @@
11301
11198
  }
11302
11199
  /**
11303
11200
  * Execute a callback for each item of the stream.
11304
- *
11305
11201
  * @param callback - The function that will be invoked for each item.
11306
11202
  */
11307
11203
  }, {
@@ -11324,7 +11220,6 @@
11324
11220
  }
11325
11221
  /**
11326
11222
  * Map the items into a different type.
11327
- *
11328
11223
  * @param callback - The function that does the conversion.
11329
11224
  * @typeParam Mapped - The type of the item after mapping.
11330
11225
  * @returns A new data stream with the mapped items.
@@ -11376,7 +11271,6 @@
11376
11271
  }
11377
11272
  /**
11378
11273
  * Get the item with the maximum value of given property.
11379
- *
11380
11274
  * @param callback - The function that picks and possibly converts the property.
11381
11275
  * @returns The item with the maximum if found otherwise null.
11382
11276
  */
@@ -11404,7 +11298,6 @@
11404
11298
  }
11405
11299
  /**
11406
11300
  * Get the item with the minimum value of given property.
11407
- *
11408
11301
  * @param callback - The function that picks and possibly converts the property.
11409
11302
  * @returns The item with the minimum if found otherwise null.
11410
11303
  */
@@ -11432,7 +11325,6 @@
11432
11325
  }
11433
11326
  /**
11434
11327
  * Reduce the items into a single value.
11435
- *
11436
11328
  * @param callback - The function that does the reduction.
11437
11329
  * @param accumulator - The initial value of the accumulator.
11438
11330
  * @typeParam T - The type of the accumulated value.
@@ -11459,7 +11351,6 @@
11459
11351
  }
11460
11352
  /**
11461
11353
  * Sort the items.
11462
- *
11463
11354
  * @param callback - Item comparator.
11464
11355
  * @returns A new stream with sorted items.
11465
11356
  */
@@ -11495,7 +11386,6 @@
11495
11386
  function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11496
11387
  /**
11497
11388
  * Add an id to given item if it doesn't have one already.
11498
- *
11499
11389
  * @remarks
11500
11390
  * The item will be modified.
11501
11391
  * @param item - The item that will have an id after a call to this function.
@@ -11533,15 +11423,15 @@
11533
11423
  * // add items
11534
11424
  * // note that the data items can contain different properties and data formats
11535
11425
  * data.add([
11536
- * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
11537
- * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
11538
- * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
11539
- * {id: 4, text: 'item 4'}
11426
+ * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
11427
+ * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
11428
+ * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
11429
+ * {id: 4, text: 'item 4'}
11540
11430
  * ]);
11541
11431
  *
11542
11432
  * // subscribe to any change in the DataSet
11543
11433
  * data.on('*', function (event, properties, senderId) {
11544
- * console.log('event', event, properties);
11434
+ * console.log('event', event, properties);
11545
11435
  * });
11546
11436
  *
11547
11437
  * // update an existing item
@@ -11560,13 +11450,12 @@
11560
11450
  *
11561
11451
  * // retrieve a filtered subset of the data
11562
11452
  * var items = data.get({
11563
- * filter: function (item) {
11564
- * return item.group == 1;
11565
- * }
11453
+ * filter: function (item) {
11454
+ * return item.group == 1;
11455
+ * }
11566
11456
  * });
11567
11457
  * console.log('filtered items', items);
11568
11458
  * ```
11569
- *
11570
11459
  * @typeParam Item - Item type that may or may not have an id.
11571
11460
  * @typeParam IdProp - Name of the property that contains the id.
11572
11461
  */
@@ -11575,7 +11464,6 @@
11575
11464
  var _super = _createSuper$1(DataSet);
11576
11465
  /**
11577
11466
  * Construct a new DataSet.
11578
- *
11579
11467
  * @param data - Initial data or options.
11580
11468
  * @param options - Options (type error if data is also options).
11581
11469
  */
@@ -11602,7 +11490,6 @@
11602
11490
  }
11603
11491
  /**
11604
11492
  * Set new options.
11605
- *
11606
11493
  * @param options - The new options.
11607
11494
  */
11608
11495
  _createClass(DataSet, [{
@@ -11651,14 +11538,13 @@
11651
11538
  *
11652
11539
  * // add items
11653
11540
  * const ids = data.add([
11654
- * { id: 1, text: 'item 1' },
11655
- * { id: 2, text: 'item 2' },
11656
- * { text: 'item without an id' }
11541
+ * { id: 1, text: 'item 1' },
11542
+ * { id: 2, text: 'item 2' },
11543
+ * { text: 'item without an id' }
11657
11544
  * ])
11658
11545
  *
11659
11546
  * console.log(ids) // [1, 2, '<UUIDv4>']
11660
11547
  * ```
11661
- *
11662
11548
  * @param data - Items to be added (ids will be generated if missing).
11663
11549
  * @param senderId - Sender id.
11664
11550
  * @returns addedIds - Array with the ids (generated if not present) of the added items.
@@ -11700,7 +11586,6 @@
11700
11586
  }
11701
11587
  /**
11702
11588
  * Update existing items. When an item does not exist, it will be created.
11703
- *
11704
11589
  * @remarks
11705
11590
  * The provided properties will be merged in the existing item. When an item does not exist, it will be created.
11706
11591
  *
@@ -11796,7 +11681,6 @@
11796
11681
  }
11797
11682
  /**
11798
11683
  * Update existing items. When an item does not exist, an error will be thrown.
11799
- *
11800
11684
  * @remarks
11801
11685
  * The provided properties will be deeply merged into the existing item.
11802
11686
  * When an item does not exist (id not present in the data set or absent), an error will be thrown and nothing will be changed.
@@ -12103,7 +11987,6 @@
12103
11987
  }
12104
11988
  /**
12105
11989
  * Filter the fields of an item.
12106
- *
12107
11990
  * @param item - The item whose fields should be filtered.
12108
11991
  * @param fields - The names of the fields that will be kept.
12109
11992
  * @typeParam K - Field name type.
@@ -12128,7 +12011,6 @@
12128
12011
  }
12129
12012
  /**
12130
12013
  * Sort the provided array with items.
12131
- *
12132
12014
  * @param items - Items to be sorted in place.
12133
12015
  * @param order - A field name or custom sort function.
12134
12016
  * @typeParam T - The type of the items in the items array.
@@ -12165,9 +12047,9 @@
12165
12047
  * ```javascript
12166
12048
  * // create a DataSet
12167
12049
  * const data = new vis.DataSet([
12168
- * { id: 1, text: 'item 1' },
12169
- * { id: 2, text: 'item 2' },
12170
- * { id: 3, text: 'item 3' }
12050
+ * { id: 1, text: 'item 1' },
12051
+ * { id: 2, text: 'item 2' },
12052
+ * { id: 3, text: 'item 3' }
12171
12053
  * ])
12172
12054
  *
12173
12055
  * // remove items
@@ -12175,7 +12057,6 @@
12175
12057
  *
12176
12058
  * console.log(ids) // [2, 3]
12177
12059
  * ```
12178
- *
12179
12060
  * @param id - One or more items or ids of items to be removed.
12180
12061
  * @param senderId - Sender id.
12181
12062
  * @returns The ids of the removed items.
@@ -12207,7 +12088,6 @@
12207
12088
  }
12208
12089
  /**
12209
12090
  * Remove an item by its id or reference.
12210
- *
12211
12091
  * @param id - Id of an item or the item itself.
12212
12092
  * @returns The removed item if removed, null otherwise.
12213
12093
  */
@@ -12236,7 +12116,6 @@
12236
12116
  * Clear the entire data set.
12237
12117
  *
12238
12118
  * After the items are removed, the {@link DataSet} will trigger an event `remove` for all removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
12239
- *
12240
12119
  * @param senderId - Sender id.
12241
12120
  * @returns removedIds - The ids of all removed items.
12242
12121
  */
@@ -12259,7 +12138,6 @@
12259
12138
  }
12260
12139
  /**
12261
12140
  * Find the item with maximum value of a specified field.
12262
- *
12263
12141
  * @param field - Name of the property that should be searched for max value.
12264
12142
  * @returns Item containing max value, or null if no items.
12265
12143
  */
@@ -12289,7 +12167,6 @@
12289
12167
  }
12290
12168
  /**
12291
12169
  * Find the item with minimum value of a specified field.
12292
- *
12293
12170
  * @param field - Name of the property that should be searched for min value.
12294
12171
  * @returns Item containing min value, or null if no items.
12295
12172
  */
@@ -12319,7 +12196,6 @@
12319
12196
  }
12320
12197
  /**
12321
12198
  * Find all distinct values of a specified field
12322
- *
12323
12199
  * @param prop - The property name whose distinct values should be returned.
12324
12200
  * @returns Unordered array containing all distinct values. Items without specified property are ignored.
12325
12201
  */
@@ -12350,7 +12226,6 @@
12350
12226
  }
12351
12227
  /**
12352
12228
  * Add a single item. Will fail when an item with the same id already exists.
12353
- *
12354
12229
  * @param item - A new item to be added.
12355
12230
  * @returns Added item's id. An id is generated when it is not present in the item.
12356
12231
  */
@@ -12371,7 +12246,6 @@
12371
12246
  /**
12372
12247
  * Update a single item: merge with existing item.
12373
12248
  * Will fail when the item has no id, or when there does not exist an item with the same id.
12374
- *
12375
12249
  * @param update - The new item
12376
12250
  * @returns The id of the updated item.
12377
12251
  */
@@ -12512,25 +12386,25 @@
12512
12386
  * // create a DataSet
12513
12387
  * var data = new vis.DataSet();
12514
12388
  * data.add([
12515
- * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
12516
- * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
12517
- * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
12518
- * {id: 4, text: 'item 4'}
12389
+ * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
12390
+ * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
12391
+ * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
12392
+ * {id: 4, text: 'item 4'}
12519
12393
  * ]);
12520
12394
  *
12521
12395
  * // create a DataView
12522
12396
  * // the view will only contain items having a property group with value 1,
12523
12397
  * // and will only output fields id, text, and date.
12524
12398
  * var view = new vis.DataView(data, {
12525
- * filter: function (item) {
12526
- * return (item.group == 1);
12527
- * },
12528
- * fields: ['id', 'text', 'date']
12399
+ * filter: function (item) {
12400
+ * return (item.group == 1);
12401
+ * },
12402
+ * fields: ['id', 'text', 'date']
12529
12403
  * });
12530
12404
  *
12531
12405
  * // subscribe to any change in the DataView
12532
12406
  * view.on('*', function (event, properties, senderId) {
12533
- * console.log('event', event, properties);
12407
+ * console.log('event', event, properties);
12534
12408
  * });
12535
12409
  *
12536
12410
  * // update an item in the data set
@@ -12543,7 +12417,6 @@
12543
12417
  * // get all items in the view
12544
12418
  * var items = view.get();
12545
12419
  * ```
12546
- *
12547
12420
  * @typeParam Item - Item type that may or may not have an id.
12548
12421
  * @typeParam IdProp - Name of the property that contains the id.
12549
12422
  */
@@ -12554,7 +12427,6 @@
12554
12427
 
12555
12428
  /**
12556
12429
  * Create a DataView.
12557
- *
12558
12430
  * @param data - The instance containing data (directly or indirectly).
12559
12431
  * @param options - Options to configure this data view.
12560
12432
  */
@@ -12576,7 +12448,6 @@
12576
12448
  // and trigger changes accordingly
12577
12449
  /**
12578
12450
  * Set a data source for the view.
12579
- *
12580
12451
  * @param data - The instance containing data (directly or indirectly).
12581
12452
  * @remarks
12582
12453
  * Note that when the data view is bound to a data set it won't be garbage
@@ -12816,7 +12687,6 @@
12816
12687
  }
12817
12688
  /**
12818
12689
  * Render the instance unusable prior to garbage collection.
12819
- *
12820
12690
  * @remarks
12821
12691
  * The intention of this method is to help discover scenarios where the data
12822
12692
  * view is being used when the programmer thinks it has been garbage collected
@@ -12854,7 +12724,6 @@
12854
12724
  }
12855
12725
  /**
12856
12726
  * Event listener. Will propagate all events from the connected data set to the subscribers of the DataView, but will filter the items and only trigger when there are changes in the filtered data set.
12857
- *
12858
12727
  * @param event - The name of the event.
12859
12728
  * @param params - Parameters of the event.
12860
12729
  * @param senderId - Id supplied by the sender.
@@ -12946,7 +12815,6 @@
12946
12815
 
12947
12816
  /**
12948
12817
  * Check that given value is compatible with Vis Data Set interface.
12949
- *
12950
12818
  * @param idProp - The expected property to contain item id.
12951
12819
  * @param v - The value to be tested.
12952
12820
  * @returns True if all expected values and methods match, false otherwise.
@@ -12957,7 +12825,6 @@
12957
12825
 
12958
12826
  /**
12959
12827
  * Check that given value is compatible with Vis Data View interface.
12960
- *
12961
12828
  * @param idProp - The expected property to contain item id.
12962
12829
  * @param v - The value to be tested.
12963
12830
  * @returns True if all expected values and methods match, false otherwise.