vtk.js for openfoam data

Hello, I’m trying to implement web-based OpenFOAM GUI with vtk.js visualization.

I managed to show the polygons by creating JSON and sending it to client (browser) using the below python code.
https://github.com/Kitware/vtk-js/blob/master/Utilities/ParaView/export-scene-macro.py

However, the resulting JSON only includes polygon data, not the scalar/vector fields (p, U…) calculated by OpenFOAM.

How can I render the resulting fields (p, U…) by vtk.js?
I hope the results would be same or similar with ParaView.
However, I don’t want to use paraviewweb for some reason.

If you are trying to do this kind of export, then you should use the following class to do it.