@kitware/vtk.js 27.4.2 → 27.4.4

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.
@@ -79,7 +79,7 @@ function vtkFieldData(publicAPI, model) {
79
79
 
80
80
  publicAPI.removeArray = function (arrayName) {
81
81
  var index = model.arrays.findIndex(function (array) {
82
- return array.getName() === arrayName;
82
+ return array.data.getName() === arrayName;
83
83
  });
84
84
  return publicAPI.removeArrayByIndex(index);
85
85
  };
@@ -499,6 +499,18 @@ function removeUnavailableArrays(fields, availableNames) {
499
499
  fields.removeArray(namesToDelete[_i]);
500
500
  }
501
501
  }
502
+ /**
503
+ * Get a unique string suitable for use as state.arrays key.
504
+ * @param {object} arrayMeta
505
+ * @returns {string} array key
506
+ */
507
+
508
+
509
+ function getArrayKey(arrayMeta) {
510
+ // Two arrays can have exactly the same hash so try to distinquish with name.
511
+ var namePart = arrayMeta.name ? "_".concat(arrayMeta.name) : '';
512
+ return "".concat(arrayMeta.hash, "_").concat(arrayMeta.dataType).concat(namePart);
513
+ }
502
514
 
503
515
  function createDataSetUpdate() {
504
516
  var piecesToFetch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -520,7 +532,7 @@ function createDataSetUpdate() {
520
532
  if (state.properties[key]) {
521
533
  var arrayMeta = state.properties[key];
522
534
  arrayMeta.registration = "set".concat(capitalize(key));
523
- var arrayKey = "".concat(arrayMeta.hash, "_").concat(arrayMeta.dataType);
535
+ var arrayKey = getArrayKey(arrayMeta);
524
536
  state.arrays[arrayKey] = arrayMeta;
525
537
  delete localProperties[key];
526
538
  }
@@ -532,7 +544,7 @@ function createDataSetUpdate() {
532
544
  for (var _i2 = 0; _i2 < fieldsArrays.length; _i2++) {
533
545
  var _arrayMeta = fieldsArrays[_i2];
534
546
 
535
- var _arrayKey = "".concat(_arrayMeta.hash, "_").concat(_arrayMeta.dataType);
547
+ var _arrayKey = getArrayKey(_arrayMeta);
536
548
 
537
549
  state.arrays[_arrayKey] = _arrayMeta;
538
550
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "27.4.2",
3
+ "version": "27.4.4",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",