@kitware/vtk.js 26.9.11 → 26.9.12

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.
@@ -282,7 +282,7 @@ function genericUpdater(instance, state, context) {
282
282
 
283
283
  if (state.arrays) {
284
284
  var arraysToBind = [];
285
- var promises = state.arrays.map(function (arrayMetadata) {
285
+ var promises = Object.values(state.arrays).map(function (arrayMetadata) {
286
286
  context.start(); // -> start(arrays)
287
287
 
288
288
  return context.getArray(arrayMetadata.hash, arrayMetadata.dataType, context).then(createNewArrayHandler(instance, arrayMetadata, arraysToBind)).catch(function (error) {
@@ -503,31 +503,41 @@ function removeUnavailableArrays(fields, availableNames) {
503
503
  function createDataSetUpdate() {
504
504
  var piecesToFetch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
505
505
  return function (instance, state, context) {
506
- var _state$arrays;
507
-
508
506
  context.start(); // -> start(dataset-update)
509
507
  // Make sure we provide container for std arrays
510
508
 
509
+ var localProperties = _objectSpread({}, state.properties);
510
+
511
511
  if (!state.arrays) {
512
- state.arrays = [];
512
+ state.arrays = {};
513
513
  } // Array members
514
514
  // => convert old format to generic state.arrays
515
515
 
516
516
 
517
- piecesToFetch.forEach(function (key) {
517
+ for (var i = 0; i < piecesToFetch.length; i++) {
518
+ var key = piecesToFetch[i];
519
+
518
520
  if (state.properties[key]) {
519
521
  var arrayMeta = state.properties[key];
520
522
  arrayMeta.registration = "set".concat(capitalize(key));
521
- state.arrays.push(arrayMeta);
522
- delete state.properties[key];
523
+ var arrayKey = "".concat(arrayMeta.hash, "_").concat(arrayMeta.dataType);
524
+ state.arrays[arrayKey] = arrayMeta;
525
+ delete localProperties[key];
523
526
  }
524
- }); // Extract dataset fields
527
+ } // Extract dataset fields
528
+
525
529
 
526
530
  var fieldsArrays = state.properties.fields || [];
527
531
 
528
- (_state$arrays = state.arrays).push.apply(_state$arrays, _toConsumableArray(fieldsArrays));
532
+ for (var _i2 = 0; _i2 < fieldsArrays.length; _i2++) {
533
+ var _arrayMeta = fieldsArrays[_i2];
529
534
 
530
- delete state.properties.fields; // Reset any pre-existing fields array
535
+ var _arrayKey = "".concat(_arrayMeta.hash, "_").concat(_arrayMeta.dataType);
536
+
537
+ state.arrays[_arrayKey] = _arrayMeta;
538
+ }
539
+
540
+ delete localProperties.fields; // Reset any pre-existing fields array
531
541
 
532
542
  var arrayToKeep = {
533
543
  pointData: new Set(),
@@ -542,7 +552,10 @@ function createDataSetUpdate() {
542
552
  removeUnavailableArrays(instance.getPointData(), arrayToKeep.pointData);
543
553
  removeUnavailableArrays(instance.getCellData(), arrayToKeep.cellData); // Generic handling
544
554
 
545
- var res = genericUpdater(instance, state, context); // Finish what we started
555
+ var cleanState = _objectSpread({}, state);
556
+
557
+ cleanState.properties = localProperties;
558
+ var res = genericUpdater(instance, cleanState, context); // Finish what we started
546
559
 
547
560
  context.end(); // -> end(dataset-update)
548
561
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "26.9.11",
3
+ "version": "26.9.12",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",