Serve data to vtk.js frontend

Hi all,

I’m trying to figure out the best way to serve a user’s .vtp file to a vtk.js frontend. I am creating a Django application in which different users can view their own data in vtk.js. I have been looking at the vtk.js examples, but all the examples use static references to the data. What would be the best way to pass the location of the user’s data to the vtk.js frontend?

Thanks in advance!

You can either use vtkHttpDataSetReader (here is an example), or you can use fetch/XMLHttpRequest to download your dataset and use the vtkXMLPolyDataReader to read in your vtp file.

Hi Forrest,

Thanks a lot!