This guide illustrates how to build an application using vtk.js as a pre-built script file. This is not the recommended way of building vtk.js applications but enables quick prototyping and easy access without any tools or infrastructure needed.
Below you can find an html file example that leverages vtk.js and builds a visualization with it. You can see its ES6 example counter part here.
vtk-js-demo.html
<!DOCTYPE html> <html> <body> <scripttype="text/javascript"src="https://unpkg.com/@babel/polyfill@7.0.0/dist/polyfill.js"></script> <scripttype="text/javascript"src="https://unpkg.com/vtk.js"></script> <scripttype="text/javascript"> // -------------------------------------------------------------------------- // Example code // -------------------------------------------------------------------------- var fullScreenRenderer = vtk.Rendering.Misc.vtkFullScreenRenderWindow.newInstance(); var actor = vtk.Rendering.Core.vtkActor.newInstance(); var mapper = vtk.Rendering.Core.vtkMapper.newInstance(); var cone = vtk.Filters.Sources.vtkConeSource.newInstance(); actor.setMapper(mapper); mapper.setInputConnection(cone.getOutputPort()); var renderer = fullScreenRenderer.getRenderer(); renderer.addActor(actor); renderer.resetCamera(); var renderWindow = fullScreenRenderer.getRenderWindow(); renderWindow.render(); </script> </body> </html>