DataArray example

Thanks for your patience Sebastien! So moving on to the final step of my prototype: Trying to map the scalar data in polydata onto the cells. I feel like I am missing a step. Here’s what I am doing:

//Color range
const lookupTable = vtkLookupTable.newInstance({ hueRange: [1, 0] });
lookupTable.setMappingRange(0,1);
const { ColorMode, ScalarMode } = vtkMapper;
const { FieldDataTypes } = vtkDataSet;
const mapper = vtkMapper.newInstance({
interpolateScalarsBeforeMapping: true,
colorMode: ColorMode.DEFAULT,
scalarMode: ScalarMode.DEFAULT,
useLookupTableScalarRange: true,
lookupTable,});
 //filter
const rgbaFilter = vtkScalarToRGBA.newInstance();
rgbaFilter.setLookupTable(lookupTable);
rgbaFilter.setInputConnection(polydata.getOutputPort());
mapper.setInputConnection(rgbaFilter.getOutputPort());
actor.setMapper(mapper);

The line:

rgbaFilter.setInputConnection(polydata.getOutputPort());

is failing. Polydata does not have this method. I am confused how to connect the polydata to the rgbaFilter.