We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86b1dc4 commit 218bf9dCopy full SHA for 218bf9d
Sources/Common/Core/DataArray/index.js
@@ -231,8 +231,13 @@ function vtkDataArray(publicAPI, model) {
231
: model.values.subarray(0, model.size);
232
233
publicAPI.getRange = (componentIndex = -1) => {
234
- const rangeIdx =
235
- componentIndex < 0 ? model.numberOfComponents : componentIndex;
+ let rangeIdx = componentIndex;
+ if (rangeIdx < 0) {
236
+ // If scalar data, then store in slot 0 (same as componentIndex = 0).
237
+ // If vector data, then store in last slot.
238
+ rangeIdx = model.numberOfComponents === 1 ? 0 : model.numberOfComponents;
239
+ }
240
+
241
let range = null;
242
243
if (!model.ranges) {
0 commit comments