vis-data 7.1.2 → 7.1.3

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 (46) hide show
  1. package/declarations/data-interface.d.ts +1 -28
  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.map +1 -1
  8. package/declarations/data-set.d.ts +0 -16
  9. package/declarations/data-set.d.ts.map +1 -1
  10. package/declarations/data-stream.d.ts +0 -16
  11. package/declarations/data-stream.d.ts.map +1 -1
  12. package/declarations/data-view-check.d.ts +0 -1
  13. package/declarations/data-view-check.d.ts.map +1 -1
  14. package/declarations/data-view.d.ts +0 -1
  15. package/declarations/data-view.d.ts.map +1 -1
  16. package/declarations/queue.d.ts +0 -1
  17. package/declarations/queue.d.ts.map +1 -1
  18. package/dist/esm.js +3517 -2767
  19. package/dist/esm.js.map +1 -1
  20. package/dist/umd.js +11969 -11218
  21. package/dist/umd.js.map +1 -1
  22. package/esnext/esm/vis-data.js +2 -56
  23. package/esnext/esm/vis-data.js.map +1 -1
  24. package/esnext/esm/vis-data.min.js +2 -2
  25. package/esnext/esm/vis-data.min.js.map +1 -1
  26. package/esnext/umd/vis-data.js +5 -61
  27. package/esnext/umd/vis-data.js.map +1 -1
  28. package/esnext/umd/vis-data.min.js +2 -2
  29. package/esnext/umd/vis-data.min.js.map +1 -1
  30. package/package.json +67 -20
  31. package/peer/esm/vis-data.js +3516 -2765
  32. package/peer/esm/vis-data.js.map +1 -1
  33. package/peer/esm/vis-data.min.js +4 -5
  34. package/peer/esm/vis-data.min.js.map +1 -1
  35. package/peer/umd/vis-data.js +11928 -11177
  36. package/peer/umd/vis-data.js.map +1 -1
  37. package/peer/umd/vis-data.min.js +8 -9
  38. package/peer/umd/vis-data.min.js.map +1 -1
  39. package/standalone/esm/vis-data.js +3516 -2765
  40. package/standalone/esm/vis-data.js.map +1 -1
  41. package/standalone/esm/vis-data.min.js +4 -5
  42. package/standalone/esm/vis-data.min.js.map +1 -1
  43. package/standalone/umd/vis-data.js +11928 -11177
  44. package/standalone/umd/vis-data.js.map +1 -1
  45. package/standalone/umd/vis-data.min.js +8 -9
  46. package/standalone/umd/vis-data.min.js.map +1 -1
@@ -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.2
8
- * @date 2021-01-08T20:37:11.601Z
7
+ * @version 7.1.3
8
+ * @date 2022-03-02T13:02:54.265Z
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,11 @@
28
28
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vis-util/esnext/umd/vis-util.js'), require('uuid')) :
29
29
  typeof define === 'function' && define.amd ? define(['exports', 'vis-util/esnext/umd/vis-util.js', 'uuid'], factory) :
30
30
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vis = global.vis || {}, global.vis, global.uuidv4));
31
- }(this, (function (exports, esnext, uuid) {
31
+ })(this, (function (exports, esnext, uuid) {
32
32
  /**
33
33
  * Create new data pipe.
34
34
  *
35
35
  * @param from - The source data set or data view.
36
- *
37
36
  * @remarks
38
37
  * Example usage:
39
38
  * ```typescript
@@ -60,7 +59,6 @@
60
59
  *
61
60
  * pipe.start();
62
61
  * ```
63
- *
64
62
  * @returns A factory whose methods can be used to configure the pipe.
65
63
  */
66
64
  function createNewDataPipeFrom(from) {
@@ -120,7 +118,6 @@
120
118
  * Apply the transformers to the items.
121
119
  *
122
120
  * @param items - The items to be transformed.
123
- *
124
121
  * @returns The transformed items.
125
122
  */
126
123
  _transformItems(items) {
@@ -192,7 +189,6 @@
192
189
  *
193
190
  * @param callback - A filtering function that returns true if given item
194
191
  * should be piped and false if not.
195
- *
196
192
  * @returns This factory for further configuration.
197
193
  */
198
194
  filter(callback) {
@@ -204,10 +200,8 @@
204
200
  *
205
201
  * @param callback - A mapping function that takes a source item and returns
206
202
  * corresponding mapped item.
207
- *
208
203
  * @typeParam TI - Target item type.
209
204
  * @typeParam TP - Target item type's id property name.
210
- *
211
205
  * @returns This factory for further configuration.
212
206
  */
213
207
  map(callback) {
@@ -219,10 +213,8 @@
219
213
  *
220
214
  * @param callback - A mapping function that takes a source item and returns
221
215
  * an array of corresponding mapped items.
222
- *
223
216
  * @typeParam TI - Target item type.
224
217
  * @typeParam TP - Target item type's id property name.
225
- *
226
218
  * @returns This factory for further configuration.
227
219
  */
228
220
  flatMap(callback) {
@@ -233,7 +225,6 @@
233
225
  * Connect this pipe to given data set.
234
226
  *
235
227
  * @param target - The data set that will receive the items from this pipe.
236
- *
237
228
  * @returns The pipe connected between given data sets and performing
238
229
  * configured transformation on the processed items.
239
230
  */
@@ -246,7 +237,6 @@
246
237
  * Determine whether a value can be used as an id.
247
238
  *
248
239
  * @param value - Input value of unknown type.
249
- *
250
240
  * @returns True if the value is valid id, false otherwise.
251
241
  */
252
242
  function isId(value) {
@@ -293,7 +283,6 @@
293
283
  *
294
284
  * @param object - The object to be extended.
295
285
  * @param options - Additional options.
296
- *
297
286
  * @returns The created queue.
298
287
  */
299
288
  static extend(object, options) {
@@ -457,7 +446,6 @@
457
446
  * Subscribe to an event, add an event listener.
458
447
  *
459
448
  * @remarks Non-function callbacks are ignored.
460
- *
461
449
  * @param event - Event name.
462
450
  * @param callback - Callback method.
463
451
  */
@@ -471,7 +459,6 @@
471
459
  * Unsubscribe from an event, remove an event listener.
472
460
  *
473
461
  * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
474
- *
475
462
  * @param event - Event name.
476
463
  * @param callback - Callback method.
477
464
  */
@@ -487,7 +474,6 @@
487
474
  * [[DataStream]] offers an always up to date stream of items from a [[DataSet]] or [[DataView]].
488
475
  * That means that the stream is evaluated at the time of iteration, conversion to another data type or when [[cache]] is called, not when the [[DataStream]] was created.
489
476
  * Multiple invocations of for example [[toItemArray]] may yield different results (if the data source like for example [[DataSet]] gets modified).
490
- *
491
477
  * @typeParam Item - The item type this stream is going to work with.
492
478
  */
493
479
  class DataStream {
@@ -536,7 +522,6 @@
536
522
  *
537
523
  * @remarks
538
524
  * The array may contain duplicities.
539
- *
540
525
  * @returns The array with all ids from this stream.
541
526
  */
542
527
  toIdArray() {
@@ -547,7 +532,6 @@
547
532
  *
548
533
  * @remarks
549
534
  * The array may contain duplicities.
550
- *
551
535
  * @returns The array with all items from this stream.
552
536
  */
553
537
  toItemArray() {
@@ -558,7 +542,6 @@
558
542
  *
559
543
  * @remarks
560
544
  * The array may contain duplicities.
561
- *
562
545
  * @returns The array with all entries from this stream.
563
546
  */
564
547
  toEntryArray() {
@@ -569,7 +552,6 @@
569
552
  *
570
553
  * @remarks
571
554
  * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
572
- *
573
555
  * @returns The object map of all id → item pairs from this stream.
574
556
  */
575
557
  toObjectMap() {
@@ -623,7 +605,6 @@
623
605
  * ds.clear()
624
606
  * chachedStream // Still has all the items.
625
607
  * ```
626
- *
627
608
  * @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).
628
609
  */
629
610
  cache() {
@@ -633,9 +614,7 @@
633
614
  * Get the distinct values of given property.
634
615
  *
635
616
  * @param callback - The function that picks and possibly converts the property.
636
- *
637
617
  * @typeParam T - The type of the distinct value.
638
- *
639
618
  * @returns A set of all distinct properties.
640
619
  */
641
620
  distinct(callback) {
@@ -649,7 +628,6 @@
649
628
  * Filter the items of the stream.
650
629
  *
651
630
  * @param callback - The function that decides whether an item will be included.
652
- *
653
631
  * @returns A new data stream with the filtered items.
654
632
  */
655
633
  filter(callback) {
@@ -678,9 +656,7 @@
678
656
  * Map the items into a different type.
679
657
  *
680
658
  * @param callback - The function that does the conversion.
681
- *
682
659
  * @typeParam Mapped - The type of the item after mapping.
683
- *
684
660
  * @returns A new data stream with the mapped items.
685
661
  */
686
662
  map(callback) {
@@ -697,7 +673,6 @@
697
673
  * Get the item with the maximum value of given property.
698
674
  *
699
675
  * @param callback - The function that picks and possibly converts the property.
700
- *
701
676
  * @returns The item with the maximum if found otherwise null.
702
677
  */
703
678
  max(callback) {
@@ -722,7 +697,6 @@
722
697
  * Get the item with the minimum value of given property.
723
698
  *
724
699
  * @param callback - The function that picks and possibly converts the property.
725
- *
726
700
  * @returns The item with the minimum if found otherwise null.
727
701
  */
728
702
  min(callback) {
@@ -748,9 +722,7 @@
748
722
  *
749
723
  * @param callback - The function that does the reduction.
750
724
  * @param accumulator - The initial value of the accumulator.
751
- *
752
725
  * @typeParam T - The type of the accumulated value.
753
- *
754
726
  * @returns The reduced value.
755
727
  */
756
728
  reduce(callback, accumulator) {
@@ -763,7 +735,6 @@
763
735
  * Sort the items.
764
736
  *
765
737
  * @param callback - Item comparator.
766
- *
767
738
  * @returns A new stream with sorted items.
768
739
  */
769
740
  sort(callback) {
@@ -779,13 +750,10 @@
779
750
  *
780
751
  * @remarks
781
752
  * The item will be modified.
782
- *
783
753
  * @param item - The item that will have an id after a call to this function.
784
754
  * @param idProp - The key of the id property.
785
- *
786
755
  * @typeParam Item - Item type that may or may not have an id.
787
756
  * @typeParam IdProp - Name of the property that contains the id.
788
- *
789
757
  * @returns true
790
758
  */
791
759
  function ensureFullItem(item, idProp) {
@@ -933,9 +901,7 @@
933
901
  *
934
902
  * @param data - Items to be added (ids will be generated if missing).
935
903
  * @param senderId - Sender id.
936
- *
937
904
  * @returns addedIds - Array with the ids (generated if not present) of the added items.
938
- *
939
905
  * @throws When an item with the same id as any of the added items already exists.
940
906
  */
941
907
  add(data, senderId) {
@@ -994,12 +960,9 @@
994
960
  *
995
961
  * ## Warning for TypeScript users
996
962
  * This method may introduce partial items into the data set. Use add or updateOnly instead for better type safety.
997
- *
998
963
  * @param data - Items to be updated (if the id is already present) or added (if the id is missing).
999
964
  * @param senderId - Sender id.
1000
- *
1001
965
  * @returns updatedIds - The ids of the added (these may be newly generated if there was no id in the item from the data) or updated items.
1002
- *
1003
966
  * @throws When the supplied data is neither an item nor an array of items.
1004
967
  */
1005
968
  update(data, senderId) {
@@ -1088,12 +1051,9 @@
1088
1051
  *
1089
1052
  * console.log(ids) // [2]
1090
1053
  * ```
1091
- *
1092
1054
  * @param data - Updates (the id and optionally other props) to the items in this data set.
1093
1055
  * @param senderId - Sender id.
1094
- *
1095
1056
  * @returns updatedIds - The ids of the updated items.
1096
- *
1097
1057
  * @throws When the supplied data is neither an item nor an array of items, when the ids are missing.
1098
1058
  */
1099
1059
  updateOnly(data, senderId) {
@@ -1361,9 +1321,7 @@
1361
1321
  *
1362
1322
  * @param item - The item whose fields should be filtered.
1363
1323
  * @param fields - The names of the fields that will be kept.
1364
- *
1365
1324
  * @typeParam K - Field name type.
1366
- *
1367
1325
  * @returns The item without any additional fields.
1368
1326
  */
1369
1327
  _filterFields(item, fields) {
@@ -1385,7 +1343,6 @@
1385
1343
  *
1386
1344
  * @param items - Items to be sorted in place.
1387
1345
  * @param order - A field name or custom sort function.
1388
- *
1389
1346
  * @typeParam T - The type of the items in the items array.
1390
1347
  */
1391
1348
  _sort(items, order) {
@@ -1433,7 +1390,6 @@
1433
1390
  *
1434
1391
  * @param id - One or more items or ids of items to be removed.
1435
1392
  * @param senderId - Sender id.
1436
- *
1437
1393
  * @returns The ids of the removed items.
1438
1394
  */
1439
1395
  remove(id, senderId) {
@@ -1460,7 +1416,6 @@
1460
1416
  * Remove an item by its id or reference.
1461
1417
  *
1462
1418
  * @param id - Id of an item or the item itself.
1463
- *
1464
1419
  * @returns The removed item if removed, null otherwise.
1465
1420
  */
1466
1421
  _remove(id) {
@@ -1489,7 +1444,6 @@
1489
1444
  * After the items are removed, the [[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.
1490
1445
  *
1491
1446
  * @param senderId - Sender id.
1492
- *
1493
1447
  * @returns removedIds - The ids of all removed items.
1494
1448
  */
1495
1449
  clear(senderId) {
@@ -1507,7 +1461,6 @@
1507
1461
  * Find the item with maximum value of a specified field.
1508
1462
  *
1509
1463
  * @param field - Name of the property that should be searched for max value.
1510
- *
1511
1464
  * @returns Item containing max value, or null if no items.
1512
1465
  */
1513
1466
  max(field) {
@@ -1527,7 +1480,6 @@
1527
1480
  * Find the item with minimum value of a specified field.
1528
1481
  *
1529
1482
  * @param field - Name of the property that should be searched for min value.
1530
- *
1531
1483
  * @returns Item containing min value, or null if no items.
1532
1484
  */
1533
1485
  min(field) {
@@ -1547,7 +1499,6 @@
1547
1499
  * Find all distinct values of a specified field
1548
1500
  *
1549
1501
  * @param prop - The property name whose distinct values should be returned.
1550
- *
1551
1502
  * @returns Unordered array containing all distinct values. Items without specified property are ignored.
1552
1503
  */
1553
1504
  distinct(prop) {
@@ -1577,7 +1528,6 @@
1577
1528
  * Add a single item. Will fail when an item with the same id already exists.
1578
1529
  *
1579
1530
  * @param item - A new item to be added.
1580
- *
1581
1531
  * @returns Added item's id. An id is generated when it is not present in the item.
1582
1532
  */
1583
1533
  _addItem(item) {
@@ -1597,7 +1547,6 @@
1597
1547
  * Will fail when the item has no id, or when there does not exist an item with the same id.
1598
1548
  *
1599
1549
  * @param update - The new item
1600
- *
1601
1550
  * @returns The id of the updated item.
1602
1551
  */
1603
1552
  _updateItem(update) {
@@ -1709,7 +1658,6 @@
1709
1658
  * Set a data source for the view.
1710
1659
  *
1711
1660
  * @param data - The instance containing data (directly or indirectly).
1712
- *
1713
1661
  * @remarks
1714
1662
  * Note that when the data view is bound to a data set it won't be garbage
1715
1663
  * collected unless the data set is too. Use `dataView.setData(null)` or
@@ -2031,7 +1979,6 @@
2031
1979
  *
2032
1980
  * @param idProp - The expected property to contain item id.
2033
1981
  * @param v - The value to be tested.
2034
- *
2035
1982
  * @returns True if all expected values and methods match, false otherwise.
2036
1983
  */
2037
1984
  function isDataSetLike(idProp, v) {
@@ -2063,7 +2010,6 @@
2063
2010
  *
2064
2011
  * @param idProp - The expected property to contain item id.
2065
2012
  * @param v - The value to be tested.
2066
- *
2067
2013
  * @returns True if all expected values and methods match, false otherwise.
2068
2014
  */
2069
2015
  function isDataViewLike(idProp, v) {
@@ -2084,9 +2030,7 @@
2084
2030
 
2085
2031
  Object.defineProperty(exports, 'DELETE', {
2086
2032
  enumerable: true,
2087
- get: function () {
2088
- return esnext.DELETE;
2089
- }
2033
+ get: function () { return esnext.DELETE; }
2090
2034
  });
2091
2035
  exports.DataSet = DataSet;
2092
2036
  exports.DataStream = DataStream;
@@ -2098,5 +2042,5 @@
2098
2042
 
2099
2043
  Object.defineProperty(exports, '__esModule', { value: true });
2100
2044
 
2101
- })));
2045
+ }));
2102
2046
  //# sourceMappingURL=vis-data.js.map