vis-data 7.1.9 → 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.
- package/declarations/data-interface.d.ts +0 -46
- package/declarations/data-interface.d.ts.map +1 -1
- package/declarations/data-pipe.d.ts +0 -8
- package/declarations/data-pipe.d.ts.map +1 -1
- package/declarations/data-set-check.d.ts +0 -1
- package/declarations/data-set-check.d.ts.map +1 -1
- package/declarations/data-set-part.d.ts +0 -1
- package/declarations/data-set-part.d.ts.map +1 -1
- package/declarations/data-set.d.ts +14 -28
- package/declarations/data-set.d.ts.map +1 -1
- package/declarations/data-stream.d.ts +0 -18
- package/declarations/data-stream.d.ts.map +1 -1
- package/declarations/data-view-check.d.ts +0 -1
- package/declarations/data-view-check.d.ts.map +1 -1
- package/declarations/data-view.d.ts +9 -15
- package/declarations/data-view.d.ts.map +1 -1
- package/declarations/queue.d.ts +0 -7
- package/declarations/queue.d.ts.map +1 -1
- package/dist/esm.js +25 -91
- package/dist/esm.js.map +1 -1
- package/dist/umd.js +25 -91
- package/dist/umd.js.map +1 -1
- package/esnext/esm/vis-data.js +25 -91
- package/esnext/esm/vis-data.js.map +1 -1
- package/esnext/esm/vis-data.min.js +2 -2
- package/esnext/esm/vis-data.min.js.map +1 -1
- package/esnext/umd/vis-data.js +25 -91
- package/esnext/umd/vis-data.js.map +1 -1
- package/esnext/umd/vis-data.min.js +2 -2
- package/esnext/umd/vis-data.min.js.map +1 -1
- package/package.json +12 -8
- package/peer/esm/vis-data.js +25 -91
- package/peer/esm/vis-data.js.map +1 -1
- package/peer/esm/vis-data.min.js +2 -2
- package/peer/esm/vis-data.min.js.map +1 -1
- package/peer/umd/vis-data.js +25 -91
- package/peer/umd/vis-data.js.map +1 -1
- package/peer/umd/vis-data.min.js +2 -2
- package/peer/umd/vis-data.min.js.map +1 -1
- package/standalone/esm/vis-data.js +25 -91
- package/standalone/esm/vis-data.js.map +1 -1
- package/standalone/esm/vis-data.min.js +2 -2
- package/standalone/esm/vis-data.min.js.map +1 -1
- package/standalone/umd/vis-data.js +25 -91
- package/standalone/umd/vis-data.js.map +1 -1
- package/standalone/umd/vis-data.min.js +2 -2
- package/standalone/umd/vis-data.min.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vis-data",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.10",
|
|
4
4
|
"description": "Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.",
|
|
5
5
|
"homepage": "http://visjs.org/",
|
|
6
6
|
"license": "(Apache-2.0 OR MIT)",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"build:code": "rollup --bundleConfigAsCjs --config rollup.build.js && rollup --bundleConfigAsCjs --config rollup.config.js",
|
|
47
47
|
"build:docs": "typedoc",
|
|
48
48
|
"build:types": "tsc -p tsconfig.types.json",
|
|
49
|
-
"clean": "
|
|
49
|
+
"clean": "shx rm -rf \"{declarations,dist,esnext,peer,standalone,tsdocs}/*\"",
|
|
50
50
|
"contributors:update": "git-authors-cli",
|
|
51
51
|
"style": "prettier --check .",
|
|
52
52
|
"style-fix": "prettier --write .",
|
|
@@ -70,8 +70,12 @@
|
|
|
70
70
|
".*.{js,ts,css,html,json,md,yml,yaml}": "prettier --write",
|
|
71
71
|
".*.{js,ts}": "eslint --fix"
|
|
72
72
|
},
|
|
73
|
+
"volta": {
|
|
74
|
+
"node": "21.7.3",
|
|
75
|
+
"npm": "11.4.2"
|
|
76
|
+
},
|
|
73
77
|
"peerDependencies": {
|
|
74
|
-
"uuid": "^3.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
78
|
+
"uuid": "^3.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0",
|
|
75
79
|
"vis-util": "^5.0.1"
|
|
76
80
|
},
|
|
77
81
|
"devDependencies": {
|
|
@@ -83,17 +87,17 @@
|
|
|
83
87
|
"@types/sinon": "17.0.2",
|
|
84
88
|
"@types/uuid": "9.0.7",
|
|
85
89
|
"component-emitter": "2.0.0",
|
|
86
|
-
"eslint": "8.
|
|
90
|
+
"eslint": "8.55.0",
|
|
87
91
|
"git-authors-cli": "1.0.47",
|
|
88
92
|
"husky": "8.0.3",
|
|
89
|
-
"lint-staged": "15.
|
|
93
|
+
"lint-staged": "15.2.0",
|
|
90
94
|
"mocha": "10.2.0",
|
|
91
95
|
"nyc": "15.1.0",
|
|
92
|
-
"rimraf": "5.0.5",
|
|
93
96
|
"sazerac": "2.0.0",
|
|
97
|
+
"shx": "^0.4.0",
|
|
94
98
|
"sinon": "17.0.1",
|
|
95
99
|
"snap-shot-it": "7.9.10",
|
|
96
|
-
"typedoc": "0.25.
|
|
100
|
+
"typedoc": "0.25.4",
|
|
97
101
|
"uuid": "9.0.1",
|
|
98
102
|
"vis-dev-utils": "4.0.41",
|
|
99
103
|
"vis-util": "5.0.7"
|
|
@@ -104,10 +108,10 @@
|
|
|
104
108
|
"Alexander Wunschik <alex@wunschik.net>",
|
|
105
109
|
"Yotam Berkowitz <yotamberk@gmail.com>",
|
|
106
110
|
"Tomáš Vyčítal <tom.vycital@gmail.com>",
|
|
111
|
+
"Tomina <tomina@vycital.eu>",
|
|
107
112
|
"Alex <AlexDM0@users.noreply.github.com>",
|
|
108
113
|
"wimrijnders <wrijnders@gmail.com>",
|
|
109
114
|
"Eric Gillingham <Gillingham@bikezen.net>",
|
|
110
|
-
"Tomina <tomina@vycital.eu>",
|
|
111
115
|
"Ludo Stellingwerff <ludo@almende.org>",
|
|
112
116
|
"macleodbroad-wf <macleodbroad-wf@users.noreply.github.com>",
|
|
113
117
|
"Brendon Page <brendon.page@chillisoft.co.za>",
|
package/peer/esm/vis-data.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
|
-
* @date
|
|
7
|
+
* @version 7.1.10
|
|
8
|
+
* @date 2025-07-06T08:42:20.006Z
|
|
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
|
|
@@ -3174,7 +3174,6 @@ var _flatMapInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(flatMap);
|
|
|
3174
3174
|
|
|
3175
3175
|
/**
|
|
3176
3176
|
* Create new data pipe.
|
|
3177
|
-
*
|
|
3178
3177
|
* @param from - The source data set or data view.
|
|
3179
3178
|
* @remarks
|
|
3180
3179
|
* Example usage:
|
|
@@ -3210,7 +3209,6 @@ function createNewDataPipeFrom(from) {
|
|
|
3210
3209
|
/**
|
|
3211
3210
|
* Internal implementation of the pipe. This should be accessible only through
|
|
3212
3211
|
* `createNewDataPipeFrom` from the outside.
|
|
3213
|
-
*
|
|
3214
3212
|
* @typeParam SI - Source item type.
|
|
3215
3213
|
* @typeParam SP - Source item type's id property name.
|
|
3216
3214
|
* @typeParam TI - Target item type.
|
|
@@ -3219,7 +3217,6 @@ function createNewDataPipeFrom(from) {
|
|
|
3219
3217
|
var SimpleDataPipe = /*#__PURE__*/function () {
|
|
3220
3218
|
/**
|
|
3221
3219
|
* Create a new data pipe.
|
|
3222
|
-
*
|
|
3223
3220
|
* @param _source - The data set or data view that will be observed.
|
|
3224
3221
|
* @param _transformers - An array of transforming functions to be used to
|
|
3225
3222
|
* filter or transform the items in the pipe.
|
|
@@ -3267,7 +3264,6 @@ var SimpleDataPipe = /*#__PURE__*/function () {
|
|
|
3267
3264
|
}
|
|
3268
3265
|
/**
|
|
3269
3266
|
* Apply the transformers to the items.
|
|
3270
|
-
*
|
|
3271
3267
|
* @param items - The items to be transformed.
|
|
3272
3268
|
* @returns The transformed items.
|
|
3273
3269
|
*/
|
|
@@ -3281,7 +3277,6 @@ var SimpleDataPipe = /*#__PURE__*/function () {
|
|
|
3281
3277
|
}
|
|
3282
3278
|
/**
|
|
3283
3279
|
* Handle an add event.
|
|
3284
|
-
*
|
|
3285
3280
|
* @param _name - Ignored.
|
|
3286
3281
|
* @param payload - The payload containing the ids of the added items.
|
|
3287
3282
|
*/
|
|
@@ -3295,7 +3290,6 @@ var SimpleDataPipe = /*#__PURE__*/function () {
|
|
|
3295
3290
|
}
|
|
3296
3291
|
/**
|
|
3297
3292
|
* Handle an update event.
|
|
3298
|
-
*
|
|
3299
3293
|
* @param _name - Ignored.
|
|
3300
3294
|
* @param payload - The payload containing the ids of the updated items.
|
|
3301
3295
|
*/
|
|
@@ -3309,7 +3303,6 @@ var SimpleDataPipe = /*#__PURE__*/function () {
|
|
|
3309
3303
|
}
|
|
3310
3304
|
/**
|
|
3311
3305
|
* Handle a remove event.
|
|
3312
|
-
*
|
|
3313
3306
|
* @param _name - Ignored.
|
|
3314
3307
|
* @param payload - The payload containing the data of the removed items.
|
|
3315
3308
|
*/
|
|
@@ -3327,7 +3320,6 @@ var SimpleDataPipe = /*#__PURE__*/function () {
|
|
|
3327
3320
|
/**
|
|
3328
3321
|
* Internal implementation of the pipe factory. This should be accessible
|
|
3329
3322
|
* only through `createNewDataPipeFrom` from the outside.
|
|
3330
|
-
*
|
|
3331
3323
|
* @typeParam TI - Target item type.
|
|
3332
3324
|
* @typeParam TP - Target item type's id property name.
|
|
3333
3325
|
*/
|
|
@@ -3335,7 +3327,6 @@ var DataPipeUnderConstruction = /*#__PURE__*/function () {
|
|
|
3335
3327
|
/**
|
|
3336
3328
|
* Create a new data pipe factory. This is an internal constructor that
|
|
3337
3329
|
* should never be called from outside of this file.
|
|
3338
|
-
*
|
|
3339
3330
|
* @param _source - The source data set or data view for this pipe.
|
|
3340
3331
|
*/
|
|
3341
3332
|
function DataPipeUnderConstruction(_source) {
|
|
@@ -3349,7 +3340,6 @@ var DataPipeUnderConstruction = /*#__PURE__*/function () {
|
|
|
3349
3340
|
}
|
|
3350
3341
|
/**
|
|
3351
3342
|
* Filter the items.
|
|
3352
|
-
*
|
|
3353
3343
|
* @param callback - A filtering function that returns true if given item
|
|
3354
3344
|
* should be piped and false if not.
|
|
3355
3345
|
* @returns This factory for further configuration.
|
|
@@ -3364,7 +3354,6 @@ var DataPipeUnderConstruction = /*#__PURE__*/function () {
|
|
|
3364
3354
|
}
|
|
3365
3355
|
/**
|
|
3366
3356
|
* Map each source item to a new type.
|
|
3367
|
-
*
|
|
3368
3357
|
* @param callback - A mapping function that takes a source item and returns
|
|
3369
3358
|
* corresponding mapped item.
|
|
3370
3359
|
* @typeParam TI - Target item type.
|
|
@@ -3381,7 +3370,6 @@ var DataPipeUnderConstruction = /*#__PURE__*/function () {
|
|
|
3381
3370
|
}
|
|
3382
3371
|
/**
|
|
3383
3372
|
* Map each source item to zero or more items of a new type.
|
|
3384
|
-
*
|
|
3385
3373
|
* @param callback - A mapping function that takes a source item and returns
|
|
3386
3374
|
* an array of corresponding mapped items.
|
|
3387
3375
|
* @typeParam TI - Target item type.
|
|
@@ -3398,7 +3386,6 @@ var DataPipeUnderConstruction = /*#__PURE__*/function () {
|
|
|
3398
3386
|
}
|
|
3399
3387
|
/**
|
|
3400
3388
|
* Connect this pipe to given data set.
|
|
3401
|
-
*
|
|
3402
3389
|
* @param target - The data set that will receive the items from this pipe.
|
|
3403
3390
|
* @returns The pipe connected between given data sets and performing
|
|
3404
3391
|
* configured transformation on the processed items.
|
|
@@ -10498,7 +10485,6 @@ function v4(options, buf, offset) {
|
|
|
10498
10485
|
|
|
10499
10486
|
/**
|
|
10500
10487
|
* Determine whether a value can be used as an id.
|
|
10501
|
-
*
|
|
10502
10488
|
* @param value - Input value of unknown type.
|
|
10503
10489
|
* @returns True if the value is valid id, false otherwise.
|
|
10504
10490
|
*/
|
|
@@ -10508,13 +10494,11 @@ function isId(value) {
|
|
|
10508
10494
|
|
|
10509
10495
|
/**
|
|
10510
10496
|
* A queue.
|
|
10511
|
-
*
|
|
10512
10497
|
* @typeParam T - The type of method names to be replaced by queued versions.
|
|
10513
10498
|
*/
|
|
10514
10499
|
var Queue = /*#__PURE__*/function () {
|
|
10515
10500
|
/**
|
|
10516
10501
|
* Construct a new Queue.
|
|
10517
|
-
*
|
|
10518
10502
|
* @param options - Queue configuration.
|
|
10519
10503
|
*/
|
|
10520
10504
|
function Queue(options) {
|
|
@@ -10531,7 +10515,6 @@ var Queue = /*#__PURE__*/function () {
|
|
|
10531
10515
|
}
|
|
10532
10516
|
/**
|
|
10533
10517
|
* Update the configuration of the queue.
|
|
10534
|
-
*
|
|
10535
10518
|
* @param options - Queue configuration.
|
|
10536
10519
|
*/
|
|
10537
10520
|
_createClass(Queue, [{
|
|
@@ -10548,7 +10531,6 @@ var Queue = /*#__PURE__*/function () {
|
|
|
10548
10531
|
/**
|
|
10549
10532
|
* Extend an object with queuing functionality.
|
|
10550
10533
|
* The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
|
|
10551
|
-
*
|
|
10552
10534
|
* @param object - The object to be extended.
|
|
10553
10535
|
* @param options - Additional options.
|
|
10554
10536
|
* @returns The created queue.
|
|
@@ -10579,7 +10561,6 @@ var Queue = /*#__PURE__*/function () {
|
|
|
10579
10561
|
}
|
|
10580
10562
|
/**
|
|
10581
10563
|
* Replace a method on an object with a queued version.
|
|
10582
|
-
*
|
|
10583
10564
|
* @param object - Object having the method.
|
|
10584
10565
|
* @param method - The method name.
|
|
10585
10566
|
*/
|
|
@@ -10606,7 +10587,6 @@ var Queue = /*#__PURE__*/function () {
|
|
|
10606
10587
|
}
|
|
10607
10588
|
/**
|
|
10608
10589
|
* Queue a call.
|
|
10609
|
-
*
|
|
10610
10590
|
* @param entry - The function or entry to be queued.
|
|
10611
10591
|
*/
|
|
10612
10592
|
}, {
|
|
@@ -10692,7 +10672,6 @@ var Queue = /*#__PURE__*/function () {
|
|
|
10692
10672
|
|
|
10693
10673
|
/**
|
|
10694
10674
|
* {@link DataSet} code that can be reused in {@link DataView} or other similar implementations of {@link DataInterface}.
|
|
10695
|
-
*
|
|
10696
10675
|
* @typeParam Item - Item type that may or may not have an id.
|
|
10697
10676
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
10698
10677
|
*/
|
|
@@ -10719,7 +10698,6 @@ var DataSetPart = /*#__PURE__*/function () {
|
|
|
10719
10698
|
value:
|
|
10720
10699
|
/**
|
|
10721
10700
|
* Trigger an event
|
|
10722
|
-
*
|
|
10723
10701
|
* @param event - Event name.
|
|
10724
10702
|
* @param payload - Event payload.
|
|
10725
10703
|
* @param senderId - Id of the sender.
|
|
@@ -10735,7 +10713,6 @@ var DataSetPart = /*#__PURE__*/function () {
|
|
|
10735
10713
|
}
|
|
10736
10714
|
/**
|
|
10737
10715
|
* Subscribe to an event, add an event listener.
|
|
10738
|
-
*
|
|
10739
10716
|
* @remarks Non-function callbacks are ignored.
|
|
10740
10717
|
* @param event - Event name.
|
|
10741
10718
|
* @param callback - Callback method.
|
|
@@ -10750,7 +10727,6 @@ var DataSetPart = /*#__PURE__*/function () {
|
|
|
10750
10727
|
}
|
|
10751
10728
|
/**
|
|
10752
10729
|
* Unsubscribe from an event, remove an event listener.
|
|
10753
|
-
*
|
|
10754
10730
|
* @remarks If the same callback was subscribed more than once **all** occurences will be removed.
|
|
10755
10731
|
* @param event - Event name.
|
|
10756
10732
|
* @param callback - Callback method.
|
|
@@ -10817,7 +10793,6 @@ function _unsupportedIterableToArray$2(o, minLen) { var _context10; if (!o) retu
|
|
|
10817
10793
|
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; }
|
|
10818
10794
|
/**
|
|
10819
10795
|
* Data stream
|
|
10820
|
-
*
|
|
10821
10796
|
* @remarks
|
|
10822
10797
|
* {@link DataStream} offers an always up to date stream of items from a {@link DataSet} or {@link DataView}.
|
|
10823
10798
|
* 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.
|
|
@@ -10827,7 +10802,6 @@ function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) le
|
|
|
10827
10802
|
var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
10828
10803
|
/**
|
|
10829
10804
|
* Create a new data stream.
|
|
10830
|
-
*
|
|
10831
10805
|
* @param pairs - The id, item pairs.
|
|
10832
10806
|
*/
|
|
10833
10807
|
function DataStream(pairs) {
|
|
@@ -11008,7 +10982,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11008
10982
|
})
|
|
11009
10983
|
/**
|
|
11010
10984
|
* Return an array containing all the ids in this stream.
|
|
11011
|
-
*
|
|
11012
10985
|
* @remarks
|
|
11013
10986
|
* The array may contain duplicities.
|
|
11014
10987
|
* @returns The array with all ids from this stream.
|
|
@@ -11023,7 +10996,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11023
10996
|
}
|
|
11024
10997
|
/**
|
|
11025
10998
|
* Return an array containing all the items in this stream.
|
|
11026
|
-
*
|
|
11027
10999
|
* @remarks
|
|
11028
11000
|
* The array may contain duplicities.
|
|
11029
11001
|
* @returns The array with all items from this stream.
|
|
@@ -11038,7 +11010,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11038
11010
|
}
|
|
11039
11011
|
/**
|
|
11040
11012
|
* Return an array containing all the entries in this stream.
|
|
11041
|
-
*
|
|
11042
11013
|
* @remarks
|
|
11043
11014
|
* The array may contain duplicities.
|
|
11044
11015
|
* @returns The array with all entries from this stream.
|
|
@@ -11050,7 +11021,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11050
11021
|
}
|
|
11051
11022
|
/**
|
|
11052
11023
|
* Return an object map containing all the items in this stream accessible by ids.
|
|
11053
|
-
*
|
|
11054
11024
|
* @remarks
|
|
11055
11025
|
* In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
|
|
11056
11026
|
* @returns The object map of all id → item pairs from this stream.
|
|
@@ -11077,7 +11047,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11077
11047
|
}
|
|
11078
11048
|
/**
|
|
11079
11049
|
* Return a map containing all the items in this stream accessible by ids.
|
|
11080
|
-
*
|
|
11081
11050
|
* @returns The map of all id → item pairs from this stream.
|
|
11082
11051
|
*/
|
|
11083
11052
|
}, {
|
|
@@ -11087,7 +11056,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11087
11056
|
}
|
|
11088
11057
|
/**
|
|
11089
11058
|
* Return a set containing all the (unique) ids in this stream.
|
|
11090
|
-
*
|
|
11091
11059
|
* @returns The set of all ids from this stream.
|
|
11092
11060
|
*/
|
|
11093
11061
|
}, {
|
|
@@ -11097,7 +11065,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11097
11065
|
}
|
|
11098
11066
|
/**
|
|
11099
11067
|
* Return a set containing all the (unique) items in this stream.
|
|
11100
|
-
*
|
|
11101
11068
|
* @returns The set of all items from this stream.
|
|
11102
11069
|
*/
|
|
11103
11070
|
}, {
|
|
@@ -11107,7 +11074,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11107
11074
|
}
|
|
11108
11075
|
/**
|
|
11109
11076
|
* Cache the items from this stream.
|
|
11110
|
-
*
|
|
11111
11077
|
* @remarks
|
|
11112
11078
|
* This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
|
|
11113
11079
|
* It can also be used to optimize performance as {@link DataStream} would otherwise reevaluate everything upon each iteration.
|
|
@@ -11134,7 +11100,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11134
11100
|
}
|
|
11135
11101
|
/**
|
|
11136
11102
|
* Get the distinct values of given property.
|
|
11137
|
-
*
|
|
11138
11103
|
* @param callback - The function that picks and possibly converts the property.
|
|
11139
11104
|
* @typeParam T - The type of the distinct value.
|
|
11140
11105
|
* @returns A set of all distinct properties.
|
|
@@ -11161,7 +11126,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11161
11126
|
}
|
|
11162
11127
|
/**
|
|
11163
11128
|
* Filter the items of the stream.
|
|
11164
|
-
*
|
|
11165
11129
|
* @param callback - The function that decides whether an item will be included.
|
|
11166
11130
|
* @returns A new data stream with the filtered items.
|
|
11167
11131
|
*/
|
|
@@ -11216,7 +11180,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11216
11180
|
}
|
|
11217
11181
|
/**
|
|
11218
11182
|
* Execute a callback for each item of the stream.
|
|
11219
|
-
*
|
|
11220
11183
|
* @param callback - The function that will be invoked for each item.
|
|
11221
11184
|
*/
|
|
11222
11185
|
}, {
|
|
@@ -11239,7 +11202,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11239
11202
|
}
|
|
11240
11203
|
/**
|
|
11241
11204
|
* Map the items into a different type.
|
|
11242
|
-
*
|
|
11243
11205
|
* @param callback - The function that does the conversion.
|
|
11244
11206
|
* @typeParam Mapped - The type of the item after mapping.
|
|
11245
11207
|
* @returns A new data stream with the mapped items.
|
|
@@ -11291,7 +11253,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11291
11253
|
}
|
|
11292
11254
|
/**
|
|
11293
11255
|
* Get the item with the maximum value of given property.
|
|
11294
|
-
*
|
|
11295
11256
|
* @param callback - The function that picks and possibly converts the property.
|
|
11296
11257
|
* @returns The item with the maximum if found otherwise null.
|
|
11297
11258
|
*/
|
|
@@ -11319,7 +11280,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11319
11280
|
}
|
|
11320
11281
|
/**
|
|
11321
11282
|
* Get the item with the minimum value of given property.
|
|
11322
|
-
*
|
|
11323
11283
|
* @param callback - The function that picks and possibly converts the property.
|
|
11324
11284
|
* @returns The item with the minimum if found otherwise null.
|
|
11325
11285
|
*/
|
|
@@ -11347,7 +11307,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11347
11307
|
}
|
|
11348
11308
|
/**
|
|
11349
11309
|
* Reduce the items into a single value.
|
|
11350
|
-
*
|
|
11351
11310
|
* @param callback - The function that does the reduction.
|
|
11352
11311
|
* @param accumulator - The initial value of the accumulator.
|
|
11353
11312
|
* @typeParam T - The type of the accumulated value.
|
|
@@ -11374,7 +11333,6 @@ var DataStream = /*#__PURE__*/function (_Symbol$iterator$1) {
|
|
|
11374
11333
|
}
|
|
11375
11334
|
/**
|
|
11376
11335
|
* Sort the items.
|
|
11377
|
-
*
|
|
11378
11336
|
* @param callback - Item comparator.
|
|
11379
11337
|
* @returns A new stream with sorted items.
|
|
11380
11338
|
*/
|
|
@@ -11410,7 +11368,6 @@ function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeRefl
|
|
|
11410
11368
|
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; } }
|
|
11411
11369
|
/**
|
|
11412
11370
|
* Add an id to given item if it doesn't have one already.
|
|
11413
|
-
*
|
|
11414
11371
|
* @remarks
|
|
11415
11372
|
* The item will be modified.
|
|
11416
11373
|
* @param item - The item that will have an id after a call to this function.
|
|
@@ -11448,15 +11405,15 @@ function ensureFullItem(item, idProp) {
|
|
|
11448
11405
|
* // add items
|
|
11449
11406
|
* // note that the data items can contain different properties and data formats
|
|
11450
11407
|
* data.add([
|
|
11451
|
-
*
|
|
11452
|
-
*
|
|
11453
|
-
*
|
|
11454
|
-
*
|
|
11408
|
+
* {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
|
|
11409
|
+
* {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
|
|
11410
|
+
* {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
|
|
11411
|
+
* {id: 4, text: 'item 4'}
|
|
11455
11412
|
* ]);
|
|
11456
11413
|
*
|
|
11457
11414
|
* // subscribe to any change in the DataSet
|
|
11458
11415
|
* data.on('*', function (event, properties, senderId) {
|
|
11459
|
-
*
|
|
11416
|
+
* console.log('event', event, properties);
|
|
11460
11417
|
* });
|
|
11461
11418
|
*
|
|
11462
11419
|
* // update an existing item
|
|
@@ -11475,13 +11432,12 @@ function ensureFullItem(item, idProp) {
|
|
|
11475
11432
|
*
|
|
11476
11433
|
* // retrieve a filtered subset of the data
|
|
11477
11434
|
* var items = data.get({
|
|
11478
|
-
*
|
|
11479
|
-
*
|
|
11480
|
-
*
|
|
11435
|
+
* filter: function (item) {
|
|
11436
|
+
* return item.group == 1;
|
|
11437
|
+
* }
|
|
11481
11438
|
* });
|
|
11482
11439
|
* console.log('filtered items', items);
|
|
11483
11440
|
* ```
|
|
11484
|
-
*
|
|
11485
11441
|
* @typeParam Item - Item type that may or may not have an id.
|
|
11486
11442
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
11487
11443
|
*/
|
|
@@ -11490,7 +11446,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
11490
11446
|
var _super = _createSuper$1(DataSet);
|
|
11491
11447
|
/**
|
|
11492
11448
|
* Construct a new DataSet.
|
|
11493
|
-
*
|
|
11494
11449
|
* @param data - Initial data or options.
|
|
11495
11450
|
* @param options - Options (type error if data is also options).
|
|
11496
11451
|
*/
|
|
@@ -11517,7 +11472,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
11517
11472
|
}
|
|
11518
11473
|
/**
|
|
11519
11474
|
* Set new options.
|
|
11520
|
-
*
|
|
11521
11475
|
* @param options - The new options.
|
|
11522
11476
|
*/
|
|
11523
11477
|
_createClass(DataSet, [{
|
|
@@ -11566,14 +11520,13 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
11566
11520
|
*
|
|
11567
11521
|
* // add items
|
|
11568
11522
|
* const ids = data.add([
|
|
11569
|
-
*
|
|
11570
|
-
*
|
|
11571
|
-
*
|
|
11523
|
+
* { id: 1, text: 'item 1' },
|
|
11524
|
+
* { id: 2, text: 'item 2' },
|
|
11525
|
+
* { text: 'item without an id' }
|
|
11572
11526
|
* ])
|
|
11573
11527
|
*
|
|
11574
11528
|
* console.log(ids) // [1, 2, '<UUIDv4>']
|
|
11575
11529
|
* ```
|
|
11576
|
-
*
|
|
11577
11530
|
* @param data - Items to be added (ids will be generated if missing).
|
|
11578
11531
|
* @param senderId - Sender id.
|
|
11579
11532
|
* @returns addedIds - Array with the ids (generated if not present) of the added items.
|
|
@@ -11615,7 +11568,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
11615
11568
|
}
|
|
11616
11569
|
/**
|
|
11617
11570
|
* Update existing items. When an item does not exist, it will be created.
|
|
11618
|
-
*
|
|
11619
11571
|
* @remarks
|
|
11620
11572
|
* The provided properties will be merged in the existing item. When an item does not exist, it will be created.
|
|
11621
11573
|
*
|
|
@@ -11711,7 +11663,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
11711
11663
|
}
|
|
11712
11664
|
/**
|
|
11713
11665
|
* Update existing items. When an item does not exist, an error will be thrown.
|
|
11714
|
-
*
|
|
11715
11666
|
* @remarks
|
|
11716
11667
|
* The provided properties will be deeply merged into the existing item.
|
|
11717
11668
|
* 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.
|
|
@@ -12018,7 +11969,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12018
11969
|
}
|
|
12019
11970
|
/**
|
|
12020
11971
|
* Filter the fields of an item.
|
|
12021
|
-
*
|
|
12022
11972
|
* @param item - The item whose fields should be filtered.
|
|
12023
11973
|
* @param fields - The names of the fields that will be kept.
|
|
12024
11974
|
* @typeParam K - Field name type.
|
|
@@ -12043,7 +11993,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12043
11993
|
}
|
|
12044
11994
|
/**
|
|
12045
11995
|
* Sort the provided array with items.
|
|
12046
|
-
*
|
|
12047
11996
|
* @param items - Items to be sorted in place.
|
|
12048
11997
|
* @param order - A field name or custom sort function.
|
|
12049
11998
|
* @typeParam T - The type of the items in the items array.
|
|
@@ -12080,9 +12029,9 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12080
12029
|
* ```javascript
|
|
12081
12030
|
* // create a DataSet
|
|
12082
12031
|
* const data = new vis.DataSet([
|
|
12083
|
-
*
|
|
12084
|
-
*
|
|
12085
|
-
*
|
|
12032
|
+
* { id: 1, text: 'item 1' },
|
|
12033
|
+
* { id: 2, text: 'item 2' },
|
|
12034
|
+
* { id: 3, text: 'item 3' }
|
|
12086
12035
|
* ])
|
|
12087
12036
|
*
|
|
12088
12037
|
* // remove items
|
|
@@ -12090,7 +12039,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12090
12039
|
*
|
|
12091
12040
|
* console.log(ids) // [2, 3]
|
|
12092
12041
|
* ```
|
|
12093
|
-
*
|
|
12094
12042
|
* @param id - One or more items or ids of items to be removed.
|
|
12095
12043
|
* @param senderId - Sender id.
|
|
12096
12044
|
* @returns The ids of the removed items.
|
|
@@ -12122,7 +12070,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12122
12070
|
}
|
|
12123
12071
|
/**
|
|
12124
12072
|
* Remove an item by its id or reference.
|
|
12125
|
-
*
|
|
12126
12073
|
* @param id - Id of an item or the item itself.
|
|
12127
12074
|
* @returns The removed item if removed, null otherwise.
|
|
12128
12075
|
*/
|
|
@@ -12151,7 +12098,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12151
12098
|
* Clear the entire data set.
|
|
12152
12099
|
*
|
|
12153
12100
|
* 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.
|
|
12154
|
-
*
|
|
12155
12101
|
* @param senderId - Sender id.
|
|
12156
12102
|
* @returns removedIds - The ids of all removed items.
|
|
12157
12103
|
*/
|
|
@@ -12174,7 +12120,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12174
12120
|
}
|
|
12175
12121
|
/**
|
|
12176
12122
|
* Find the item with maximum value of a specified field.
|
|
12177
|
-
*
|
|
12178
12123
|
* @param field - Name of the property that should be searched for max value.
|
|
12179
12124
|
* @returns Item containing max value, or null if no items.
|
|
12180
12125
|
*/
|
|
@@ -12204,7 +12149,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12204
12149
|
}
|
|
12205
12150
|
/**
|
|
12206
12151
|
* Find the item with minimum value of a specified field.
|
|
12207
|
-
*
|
|
12208
12152
|
* @param field - Name of the property that should be searched for min value.
|
|
12209
12153
|
* @returns Item containing min value, or null if no items.
|
|
12210
12154
|
*/
|
|
@@ -12234,7 +12178,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12234
12178
|
}
|
|
12235
12179
|
/**
|
|
12236
12180
|
* Find all distinct values of a specified field
|
|
12237
|
-
*
|
|
12238
12181
|
* @param prop - The property name whose distinct values should be returned.
|
|
12239
12182
|
* @returns Unordered array containing all distinct values. Items without specified property are ignored.
|
|
12240
12183
|
*/
|
|
@@ -12265,7 +12208,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12265
12208
|
}
|
|
12266
12209
|
/**
|
|
12267
12210
|
* Add a single item. Will fail when an item with the same id already exists.
|
|
12268
|
-
*
|
|
12269
12211
|
* @param item - A new item to be added.
|
|
12270
12212
|
* @returns Added item's id. An id is generated when it is not present in the item.
|
|
12271
12213
|
*/
|
|
@@ -12286,7 +12228,6 @@ var DataSet = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12286
12228
|
/**
|
|
12287
12229
|
* Update a single item: merge with existing item.
|
|
12288
12230
|
* Will fail when the item has no id, or when there does not exist an item with the same id.
|
|
12289
|
-
*
|
|
12290
12231
|
* @param update - The new item
|
|
12291
12232
|
* @returns The id of the updated item.
|
|
12292
12233
|
*/
|
|
@@ -12382,25 +12323,25 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
|
|
|
12382
12323
|
* // create a DataSet
|
|
12383
12324
|
* var data = new vis.DataSet();
|
|
12384
12325
|
* data.add([
|
|
12385
|
-
*
|
|
12386
|
-
*
|
|
12387
|
-
*
|
|
12388
|
-
*
|
|
12326
|
+
* {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
|
|
12327
|
+
* {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
|
|
12328
|
+
* {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
|
|
12329
|
+
* {id: 4, text: 'item 4'}
|
|
12389
12330
|
* ]);
|
|
12390
12331
|
*
|
|
12391
12332
|
* // create a DataView
|
|
12392
12333
|
* // the view will only contain items having a property group with value 1,
|
|
12393
12334
|
* // and will only output fields id, text, and date.
|
|
12394
12335
|
* var view = new vis.DataView(data, {
|
|
12395
|
-
*
|
|
12396
|
-
*
|
|
12397
|
-
*
|
|
12398
|
-
*
|
|
12336
|
+
* filter: function (item) {
|
|
12337
|
+
* return (item.group == 1);
|
|
12338
|
+
* },
|
|
12339
|
+
* fields: ['id', 'text', 'date']
|
|
12399
12340
|
* });
|
|
12400
12341
|
*
|
|
12401
12342
|
* // subscribe to any change in the DataView
|
|
12402
12343
|
* view.on('*', function (event, properties, senderId) {
|
|
12403
|
-
*
|
|
12344
|
+
* console.log('event', event, properties);
|
|
12404
12345
|
* });
|
|
12405
12346
|
*
|
|
12406
12347
|
* // update an item in the data set
|
|
@@ -12413,7 +12354,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
|
|
|
12413
12354
|
* // get all items in the view
|
|
12414
12355
|
* var items = view.get();
|
|
12415
12356
|
* ```
|
|
12416
|
-
*
|
|
12417
12357
|
* @typeParam Item - Item type that may or may not have an id.
|
|
12418
12358
|
* @typeParam IdProp - Name of the property that contains the id.
|
|
12419
12359
|
*/
|
|
@@ -12424,7 +12364,6 @@ var DataView = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12424
12364
|
|
|
12425
12365
|
/**
|
|
12426
12366
|
* Create a DataView.
|
|
12427
|
-
*
|
|
12428
12367
|
* @param data - The instance containing data (directly or indirectly).
|
|
12429
12368
|
* @param options - Options to configure this data view.
|
|
12430
12369
|
*/
|
|
@@ -12446,7 +12385,6 @@ var DataView = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12446
12385
|
// and trigger changes accordingly
|
|
12447
12386
|
/**
|
|
12448
12387
|
* Set a data source for the view.
|
|
12449
|
-
*
|
|
12450
12388
|
* @param data - The instance containing data (directly or indirectly).
|
|
12451
12389
|
* @remarks
|
|
12452
12390
|
* Note that when the data view is bound to a data set it won't be garbage
|
|
@@ -12686,7 +12624,6 @@ var DataView = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12686
12624
|
}
|
|
12687
12625
|
/**
|
|
12688
12626
|
* Render the instance unusable prior to garbage collection.
|
|
12689
|
-
*
|
|
12690
12627
|
* @remarks
|
|
12691
12628
|
* The intention of this method is to help discover scenarios where the data
|
|
12692
12629
|
* view is being used when the programmer thinks it has been garbage collected
|
|
@@ -12724,7 +12661,6 @@ var DataView = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12724
12661
|
}
|
|
12725
12662
|
/**
|
|
12726
12663
|
* 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.
|
|
12727
|
-
*
|
|
12728
12664
|
* @param event - The name of the event.
|
|
12729
12665
|
* @param params - Parameters of the event.
|
|
12730
12666
|
* @param senderId - Id supplied by the sender.
|
|
@@ -12816,7 +12752,6 @@ var DataView = /*#__PURE__*/function (_DataSetPart) {
|
|
|
12816
12752
|
|
|
12817
12753
|
/**
|
|
12818
12754
|
* Check that given value is compatible with Vis Data Set interface.
|
|
12819
|
-
*
|
|
12820
12755
|
* @param idProp - The expected property to contain item id.
|
|
12821
12756
|
* @param v - The value to be tested.
|
|
12822
12757
|
* @returns True if all expected values and methods match, false otherwise.
|
|
@@ -12827,7 +12762,6 @@ function isDataSetLike(idProp, v) {
|
|
|
12827
12762
|
|
|
12828
12763
|
/**
|
|
12829
12764
|
* Check that given value is compatible with Vis Data View interface.
|
|
12830
|
-
*
|
|
12831
12765
|
* @param idProp - The expected property to contain item id.
|
|
12832
12766
|
* @param v - The value to be tested.
|
|
12833
12767
|
* @returns True if all expected values and methods match, false otherwise.
|