diff --git a/DESCRIPTION b/DESCRIPTION index 2a9485b..3523fb1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashVtk Title: React based declarative usage of vtk.js for Dash -Version: 0.0.3 +Version: 0.0.4 Description: React based declarative usage of vtk.js for Dash Depends: R (>= 3.0.2) Imports: diff --git a/Project.toml b/Project.toml index 4921bbc..9c951b1 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "DashVtk" uuid = "1b08a953-4be3-4667-9a23-818b1eccd4c7" authors = ["Kitware Inc and Plotly Technologies "] -version = "0.0.3" +version = "0.0.4" [deps] Dash = "1b08a953-4be3-4667-9a23-3db579824955" diff --git a/R/internal.R b/R/internal.R index 3e5c89b..b81aa16 100644 --- a/R/internal.R +++ b/R/internal.R @@ -1,12 +1,12 @@ .dashVtk_js_metadata <- function() { deps_metadata <- list(`dash_vtk` = structure(list(name = "dash_vtk", -version = "0.0.3", src = list(href = NULL, +version = "0.0.4", src = list(href = NULL, file = "deps"), meta = NULL, script = 'dash_vtk.min.js', stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", all_files = FALSE), class = "html_dependency"), `dash_vtk` = structure(list(name = "dash_vtk", -version = "0.0.3", src = list(href = NULL, +version = "0.0.4", src = list(href = NULL, file = "deps"), meta = NULL, script = 'dash_vtk.min.js.map', stylesheet = NULL, head = NULL, attachment = NULL, package = "dashVtk", diff --git a/README.md b/README.md index 541bb8f..d6612a1 100644 --- a/README.md +++ b/README.md @@ -112,9 +112,27 @@ python app.py Depending on your Python environment, you may run into deployment issue related to the vtk version that get pulled in. -Ideally we want a version of vtk equal or newer than 9. When using such version of VTK, dash-vtk won't even try to load the rendering module of VTK and if OpenGL is not available on your system everything will still be fine. +Ideally we want a version of vtk equal or newer than 9. When using such version of VTK, `dash-vtk` won't even try to load the rendering module of VTK and if OpenGL is not available on your system everything will still be fine. -On the other hand, if you are running Python 3.6 or less and you don't upgrade your pip version you will get vtk 8. With vtk 8, there is no way to prevent the loading of the GL library which means that you will have to install libGL on your system. The way [Heroku](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt) and [dash-enterprise](https://github.com/plotly/dash-sample-apps/blob/master/apps/dash-vtk-explorer/apt-packages) handle it is slightly different but technically you will have to install `libgl1-mesa-glx` via some `apt` infrastructure. +On the other hand, if you are running python-3.6 and/or pip-18 or less and you don't upgrade your pip version, you will only be able to use `vtk<=8.1.2`. With vtk 8, there is no way to prevent the loading of the GL library which means that you will have to install libGL on your system, or you will run into errors like this: + +``` + File ".../python/lib/python3.6/site-packages/vtkmodules/all.py", line 29, in + from .vtkRenderingOpenGL2 import * +ImportError: libGL.so.1: cannot open shared object file: No such file or directory +[2021-02-08 18:36:15 +0000] [10] [INFO] Worker exiting (pid: 10) +``` + +or this: +``` + File ".../python3.7/site-packages/vtk/__init__.py", line 12, in + from .vtkOpenGLKit import * + File ".../python3.7/site-packages/vtk/vtkOpenGLKit.py", line 9, in + from vtkOpenGLKitPython import * +ModuleNotFoundError: No module named 'vtkOpenGLKitPython' +``` + +Heroku and Dash Enterprise handle it is slightly different because you will have to install `libgl1-mesa-glx` via some `apt` files. In the case of Heroku, you will have to use a [buildpack](https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-apt) and add `libgl1-mesa-glx` to a `Aptfile` located in the root of your project. In the case of Dash Enterprise, you do not need to change the buildpack (it is handled automatically) but you will need to add `libgl1-mesa-glx` to a `apt-packages` file instead of `Aptfile`; see [this app](https://github.com/plotly/dash-sample-apps/blob/master/apps/dash-vtk-explorer/apt-packages) as an example. ## References diff --git a/dash_vtk/package-info.json b/dash_vtk/package-info.json index cf368d7..4f868d6 100644 --- a/dash_vtk/package-info.json +++ b/dash_vtk/package-info.json @@ -1,6 +1,6 @@ { "name": "dash_vtk", - "version": "0.0.3", + "version": "0.0.4", "description": "React based declarative usage of vtk.js for Dash", "repository": { "type": "git", diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e5ddf8e..dafb98c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.4] - 2021-02-08 + +### Changed +* Added section about deployment in `README.md` +* `dash_vtk.utils`: Will try to import `vtkmodules` (`>=9.0.1`) before falling back to `vtk` (`<=8.1.2`) to avoid requiring `libGL`. + ## [0.0.3] - 2021-02-04 ### Changed diff --git a/package.json b/package.json index cf368d7..4f868d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dash_vtk", - "version": "0.0.3", + "version": "0.0.4", "description": "React based declarative usage of vtk.js for Dash", "repository": { "type": "git", diff --git a/src/DashVtk.jl b/src/DashVtk.jl index de055b5..41fabbe 100644 --- a/src/DashVtk.jl +++ b/src/DashVtk.jl @@ -3,7 +3,7 @@ module DashVtk using Dash const resources_path = realpath(joinpath( @__DIR__, "..", "deps")) -const version = "0.0.3" +const version = "0.0.4" include("vtk_algorithm.jl") include("vtk_calculator.jl") @@ -34,14 +34,14 @@ function __init__() [ DashBase.Resource( relative_package_path = "dash_vtk.min.js", - external_url = "https://unpkg.com/dash_vtk@0.0.3/dash_vtk/dash_vtk.min.js", + external_url = "https://unpkg.com/dash_vtk@0.0.4/dash_vtk/dash_vtk.min.js", dynamic = nothing, async = nothing, type = :js ), DashBase.Resource( relative_package_path = "dash_vtk.min.js.map", - external_url = "https://unpkg.com/dash_vtk@0.0.3/dash_vtk/dash_vtk.min.js.map", + external_url = "https://unpkg.com/dash_vtk@0.0.4/dash_vtk/dash_vtk.min.js.map", dynamic = true, async = nothing, type = :js