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
@@ -32,7 +32,6 @@ import { v4 } from 'uuid';
32
32
  * Create new data pipe.
33
33
  *
34
34
  * @param from - The source data set or data view.
35
- *
36
35
  * @remarks
37
36
  * Example usage:
38
37
  * ```typescript
@@ -59,7 +58,6 @@ import { v4 } from 'uuid';
59
58
  *
60
59
  * pipe.start();
61
60
  * ```
62
- *
63
61
  * @returns A factory whose methods can be used to configure the pipe.
64
62
  */
65
63
  function createNewDataPipeFrom(from) {
@@ -119,7 +117,6 @@ class SimpleDataPipe {
119
117
  * Apply the transformers to the items.
120
118
  *
121
119
  * @param items - The items to be transformed.
122
- *
123
120
  * @returns The transformed items.
124
121
  */
125
122
  _transformItems(items) {
@@ -191,7 +188,6 @@ class DataPipeUnderConstruction {
191
188
  *
192
189
  * @param callback - A filtering function that returns true if given item
193
190
  * should be piped and false if not.
194
- *
195
191
  * @returns This factory for further configuration.
196
192
  */
197
193
  filter(callback) {
@@ -203,10 +199,8 @@ class DataPipeUnderConstruction {
203
199
  *
204
200
  * @param callback - A mapping function that takes a source item and returns
205
201
  * corresponding mapped item.
206
- *
207
202
  * @typeParam TI - Target item type.
208
203
  * @typeParam TP - Target item type's id property name.
209
- *
210
204
  * @returns This factory for further configuration.
211
205
  */
212
206
  map(callback) {
@@ -218,10 +212,8 @@ class DataPipeUnderConstruction {
218
212
  *
219
213
  * @param callback - A mapping function that takes a source item and returns
220
214
  * an array of corresponding mapped items.
221
- *
222
215
  * @typeParam TI - Target item type.
223
216
  * @typeParam TP - Target item type's id property name.
224
- *
225
217
  * @returns This factory for further configuration.
226
218
  */
227
219
  flatMap(callback) {
@@ -232,7 +224,6 @@ class DataPipeUnderConstruction {
232
224
  * Connect this pipe to given data set.
233
225
  *
234
226
  * @param target - The data set that will receive the items from this pipe.
235
- *
236
227
  * @returns The pipe connected between given data sets and performing
237
228
  * configured transformation on the processed items.
238
229
  */
@@ -245,7 +236,6 @@ class DataPipeUnderConstruction {
245
236
  * Determine whether a value can be used as an id.
246
237
  *
247
238
  * @param value - Input value of unknown type.
248
- *
249
239
  * @returns True if the value is valid id, false otherwise.
250
240
  */
251
241
  function isId(value) {
@@ -292,7 +282,6 @@ class Queue {
292
282
  *
293
283
  * @param object - The object to be extended.
294
284
  * @param options - Additional options.
295
- *
296
285
  * @returns The created queue.
297
286
  */
298
287
  static extend(object, options) {
@@ -456,7 +445,6 @@ class DataSetPart {
456
445
  * Subscribe to an event, add an event listener.
457
446
  *
458
447
  * @remarks Non-function callbacks are ignored.
459
- *
460
448
  * @param event - Event name.
461
449
  * @param callback - Callback method.
462
450
  */
@@ -470,7 +458,6 @@ class DataSetPart {
470
458
  * Unsubscribe from an event, remove an event listener.
471
459
  *
472
460
  * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
473
- *
474
461
  * @param event - Event name.
475
462
  * @param callback - Callback method.
476
463
  */
@@ -486,7 +473,6 @@ class DataSetPart {
486
473
  * [[DataStream]] offers an always up to date stream of items from a [[DataSet]] or [[DataView]].
487
474
  * 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.
488
475
  * Multiple invocations of for example [[toItemArray]] may yield different results (if the data source like for example [[DataSet]] gets modified).
489
- *
490
476
  * @typeParam Item - The item type this stream is going to work with.
491
477
  */
492
478
  class DataStream {
@@ -535,7 +521,6 @@ class DataStream {
535
521
  *
536
522
  * @remarks
537
523
  * The array may contain duplicities.
538
- *
539
524
  * @returns The array with all ids from this stream.
540
525
  */
541
526
  toIdArray() {
@@ -546,7 +531,6 @@ class DataStream {
546
531
  *
547
532
  * @remarks
548
533
  * The array may contain duplicities.
549
- *
550
534
  * @returns The array with all items from this stream.
551
535
  */
552
536
  toItemArray() {
@@ -557,7 +541,6 @@ class DataStream {
557
541
  *
558
542
  * @remarks
559
543
  * The array may contain duplicities.
560
- *
561
544
  * @returns The array with all entries from this stream.
562
545
  */
563
546
  toEntryArray() {
@@ -568,7 +551,6 @@ class DataStream {
568
551
  *
569
552
  * @remarks
570
553
  * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
571
- *
572
554
  * @returns The object map of all id → item pairs from this stream.
573
555
  */
574
556
  toObjectMap() {
@@ -622,7 +604,6 @@ class DataStream {
622
604
  * ds.clear()
623
605
  * chachedStream // Still has all the items.
624
606
  * ```
625
- *
626
607
  * @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).
627
608
  */
628
609
  cache() {
@@ -632,9 +613,7 @@ class DataStream {
632
613
  * Get the distinct values of given property.
633
614
  *
634
615
  * @param callback - The function that picks and possibly converts the property.
635
- *
636
616
  * @typeParam T - The type of the distinct value.
637
- *
638
617
  * @returns A set of all distinct properties.
639
618
  */
640
619
  distinct(callback) {
@@ -648,7 +627,6 @@ class DataStream {
648
627
  * Filter the items of the stream.
649
628
  *
650
629
  * @param callback - The function that decides whether an item will be included.
651
- *
652
630
  * @returns A new data stream with the filtered items.
653
631
  */
654
632
  filter(callback) {
@@ -677,9 +655,7 @@ class DataStream {
677
655
  * Map the items into a different type.
678
656
  *
679
657
  * @param callback - The function that does the conversion.
680
- *
681
658
  * @typeParam Mapped - The type of the item after mapping.
682
- *
683
659
  * @returns A new data stream with the mapped items.
684
660
  */
685
661
  map(callback) {
@@ -696,7 +672,6 @@ class DataStream {
696
672
  * Get the item with the maximum value of given property.
697
673
  *
698
674
  * @param callback - The function that picks and possibly converts the property.
699
- *
700
675
  * @returns The item with the maximum if found otherwise null.
701
676
  */
702
677
  max(callback) {
@@ -721,7 +696,6 @@ class DataStream {
721
696
  * Get the item with the minimum value of given property.
722
697
  *
723
698
  * @param callback - The function that picks and possibly converts the property.
724
- *
725
699
  * @returns The item with the minimum if found otherwise null.
726
700
  */
727
701
  min(callback) {
@@ -747,9 +721,7 @@ class DataStream {
747
721
  *
748
722
  * @param callback - The function that does the reduction.
749
723
  * @param accumulator - The initial value of the accumulator.
750
- *
751
724
  * @typeParam T - The type of the accumulated value.
752
- *
753
725
  * @returns The reduced value.
754
726
  */
755
727
  reduce(callback, accumulator) {
@@ -762,7 +734,6 @@ class DataStream {
762
734
  * Sort the items.
763
735
  *
764
736
  * @param callback - Item comparator.
765
- *
766
737
  * @returns A new stream with sorted items.
767
738
  */
768
739
  sort(callback) {
@@ -778,13 +749,10 @@ class DataStream {
778
749
  *
779
750
  * @remarks
780
751
  * The item will be modified.
781
- *
782
752
  * @param item - The item that will have an id after a call to this function.
783
753
  * @param idProp - The key of the id property.
784
- *
785
754
  * @typeParam Item - Item type that may or may not have an id.
786
755
  * @typeParam IdProp - Name of the property that contains the id.
787
- *
788
756
  * @returns true
789
757
  */
790
758
  function ensureFullItem(item, idProp) {
@@ -932,9 +900,7 @@ class DataSet extends DataSetPart {
932
900
  *
933
901
  * @param data - Items to be added (ids will be generated if missing).
934
902
  * @param senderId - Sender id.
935
- *
936
903
  * @returns addedIds - Array with the ids (generated if not present) of the added items.
937
- *
938
904
  * @throws When an item with the same id as any of the added items already exists.
939
905
  */
940
906
  add(data, senderId) {
@@ -993,12 +959,9 @@ class DataSet extends DataSetPart {
993
959
  *
994
960
  * ## Warning for TypeScript users
995
961
  * This method may introduce partial items into the data set. Use add or updateOnly instead for better type safety.
996
- *
997
962
  * @param data - Items to be updated (if the id is already present) or added (if the id is missing).
998
963
  * @param senderId - Sender id.
999
- *
1000
964
  * @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.
1001
- *
1002
965
  * @throws When the supplied data is neither an item nor an array of items.
1003
966
  */
1004
967
  update(data, senderId) {
@@ -1087,12 +1050,9 @@ class DataSet extends DataSetPart {
1087
1050
  *
1088
1051
  * console.log(ids) // [2]
1089
1052
  * ```
1090
- *
1091
1053
  * @param data - Updates (the id and optionally other props) to the items in this data set.
1092
1054
  * @param senderId - Sender id.
1093
- *
1094
1055
  * @returns updatedIds - The ids of the updated items.
1095
- *
1096
1056
  * @throws When the supplied data is neither an item nor an array of items, when the ids are missing.
1097
1057
  */
1098
1058
  updateOnly(data, senderId) {
@@ -1360,9 +1320,7 @@ class DataSet extends DataSetPart {
1360
1320
  *
1361
1321
  * @param item - The item whose fields should be filtered.
1362
1322
  * @param fields - The names of the fields that will be kept.
1363
- *
1364
1323
  * @typeParam K - Field name type.
1365
- *
1366
1324
  * @returns The item without any additional fields.
1367
1325
  */
1368
1326
  _filterFields(item, fields) {
@@ -1384,7 +1342,6 @@ class DataSet extends DataSetPart {
1384
1342
  *
1385
1343
  * @param items - Items to be sorted in place.
1386
1344
  * @param order - A field name or custom sort function.
1387
- *
1388
1345
  * @typeParam T - The type of the items in the items array.
1389
1346
  */
1390
1347
  _sort(items, order) {
@@ -1432,7 +1389,6 @@ class DataSet extends DataSetPart {
1432
1389
  *
1433
1390
  * @param id - One or more items or ids of items to be removed.
1434
1391
  * @param senderId - Sender id.
1435
- *
1436
1392
  * @returns The ids of the removed items.
1437
1393
  */
1438
1394
  remove(id, senderId) {
@@ -1459,7 +1415,6 @@ class DataSet extends DataSetPart {
1459
1415
  * Remove an item by its id or reference.
1460
1416
  *
1461
1417
  * @param id - Id of an item or the item itself.
1462
- *
1463
1418
  * @returns The removed item if removed, null otherwise.
1464
1419
  */
1465
1420
  _remove(id) {
@@ -1488,7 +1443,6 @@ class DataSet extends DataSetPart {
1488
1443
  * 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.
1489
1444
  *
1490
1445
  * @param senderId - Sender id.
1491
- *
1492
1446
  * @returns removedIds - The ids of all removed items.
1493
1447
  */
1494
1448
  clear(senderId) {
@@ -1506,7 +1460,6 @@ class DataSet extends DataSetPart {
1506
1460
  * Find the item with maximum value of a specified field.
1507
1461
  *
1508
1462
  * @param field - Name of the property that should be searched for max value.
1509
- *
1510
1463
  * @returns Item containing max value, or null if no items.
1511
1464
  */
1512
1465
  max(field) {
@@ -1526,7 +1479,6 @@ class DataSet extends DataSetPart {
1526
1479
  * Find the item with minimum value of a specified field.
1527
1480
  *
1528
1481
  * @param field - Name of the property that should be searched for min value.
1529
- *
1530
1482
  * @returns Item containing min value, or null if no items.
1531
1483
  */
1532
1484
  min(field) {
@@ -1546,7 +1498,6 @@ class DataSet extends DataSetPart {
1546
1498
  * Find all distinct values of a specified field
1547
1499
  *
1548
1500
  * @param prop - The property name whose distinct values should be returned.
1549
- *
1550
1501
  * @returns Unordered array containing all distinct values. Items without specified property are ignored.
1551
1502
  */
1552
1503
  distinct(prop) {
@@ -1576,7 +1527,6 @@ class DataSet extends DataSetPart {
1576
1527
  * Add a single item. Will fail when an item with the same id already exists.
1577
1528
  *
1578
1529
  * @param item - A new item to be added.
1579
- *
1580
1530
  * @returns Added item's id. An id is generated when it is not present in the item.
1581
1531
  */
1582
1532
  _addItem(item) {
@@ -1596,7 +1546,6 @@ class DataSet extends DataSetPart {
1596
1546
  * Will fail when the item has no id, or when there does not exist an item with the same id.
1597
1547
  *
1598
1548
  * @param update - The new item
1599
- *
1600
1549
  * @returns The id of the updated item.
1601
1550
  */
1602
1551
  _updateItem(update) {
@@ -1708,7 +1657,6 @@ class DataView extends DataSetPart {
1708
1657
  * Set a data source for the view.
1709
1658
  *
1710
1659
  * @param data - The instance containing data (directly or indirectly).
1711
- *
1712
1660
  * @remarks
1713
1661
  * Note that when the data view is bound to a data set it won't be garbage
1714
1662
  * collected unless the data set is too. Use `dataView.setData(null)` or
@@ -2030,7 +1978,6 @@ class DataView extends DataSetPart {
2030
1978
  *
2031
1979
  * @param idProp - The expected property to contain item id.
2032
1980
  * @param v - The value to be tested.
2033
- *
2034
1981
  * @returns True if all expected values and methods match, false otherwise.
2035
1982
  */
2036
1983
  function isDataSetLike(idProp, v) {
@@ -2062,7 +2009,6 @@ function isDataSetLike(idProp, v) {
2062
2009
  *
2063
2010
  * @param idProp - The expected property to contain item id.
2064
2011
  * @param v - The value to be tested.
2065
- *
2066
2012
  * @returns True if all expected values and methods match, false otherwise.
2067
2013
  */
2068
2014
  function isDataViewLike(idProp, v) {