DashVtk.jl is ready for action!

Over the last few months, work has been undergoing to integrate the Julia ecosystem with the DashVtk.jl package to make it easier to interactively visualise all sorts of VTK data structures in a Dash app from Julia. Here is a workflow that I know now works. But first let me introduce you to a few friends.

  • VTKDataTypes.jl is a Julia package I built many years ago for representing all the VTK data structures natively in Julia. It’s fairly easy to use once you read the README. But then what? Is it just a dumb representation?
  • VTKDataIO.jl is a Julia package I built next to VTKDataTypes for visualising the Julia structures interactively using the vtk Python module and Julia’s excellent foreign function interface (FFI) with Python, PyCall.jl. PyCall is pure magic and by following the VTK documentation and losing my temper more often than I would like to admit, I managed to finally build a compatibility layer that converts the pure Julia representation of the VTK data to the Python objects which can then be interactively visualised in a desktop app. But these are regular desktop apps, can they be webapps instead that we can deploy on Heroku for example?
  • DashVtk.jl is a package that allows you to visualise VTK data structures in a Dash webapp. However, DashVtk expects an input dictionary with a very specific structure in order to work properly and that wasn’t the best user experience.

VTKDataTypes.jl + VTKDataIO.jl + DashVtk.jl to the rescue

It is now possible to create your VTK data structure in Julia using VTKDataTypes.jl, or read a VTK file to Julia using VTKDataIO.jl, inspect the structure in Julia, then convert it to the dictionary that DashVtk.jl expects and create a webapp in Julia all in a few lines of code! See the DashVtk.jl documentation https://dash.plotly.com/julia/vtk for examples and demos.

Currently, this workflow still uses Python and PyCall in a few more places than I would like but in the future, we hope to make it almost completely independent from Python.

Feel free to test this workflow and let me know if you run into issues.

ezgif.com-gif-maker (2)

1 Like