-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dash-vtk chapter #1091
Add dash-vtk chapter #1091
Conversation
@jourdain If there's anything you'd like to modify, could you update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but also eager to see it live on your website
Seems like i'm getting this error in the tests:
|
@xhlulu Just a reminder that we will need to edit the |
This PR looks good to me 💃🏿 I tested that the async functionality works on the Heroku review app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor comments, otherwise this looks OK to me.
content = dash_vtk.View([ | ||
dash_vtk.VolumeRepresentation([ | ||
# GUI to control Volume Rendering | ||
# + Setup good default at startup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# + Setup good default at startup
Is it possible to elaborate/clarify why this step is necessary? Is it because the default values are not provided unless VolumeController()
is invoked? Or does it modify the existing defaults when called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jourdain ☝️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The values get computed based on the volume data and geometry. While the default values are static and therefore will have little chance to produce a good result across a various set of volumes.
Normally an advanced user will update the parameters the way he wants the volume to be rendered. But if you don't know what the data is about, using the controller would give you a reasonable first rendering (on top of being dynamically tunable). We could recreate the computation of those values inside the volume representation but it will have to be under a property like viz-profile="auto"
or something equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic value computations is happening here
import dash_html_components as html | ||
|
||
import dash_vtk | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we missing the compatibility block used above here?
try:
# VTK 9+
from vtkmodules.vtkImagingCore import vtkRTAnalyticSource
except:
# VTK =< 8
from vtk.vtkImagingCore import vtkRTAnalyticSource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpkyle that's handled internally by dash_vtk
I believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpkyle Note that this example piece of code is importing from the vtkmodules
library, not dash_vtk
.
No compatibility check needed if the import is not from vtkmodules
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vtkmodules
is only available for 9+, so the check should be made where the import happen...
Any version will work if using vtk.xxx
but doing so will load the full library rather than just the required subset.
import dash_html_components as html | ||
|
||
import dash_vtk | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about the VTK 9+ vs. earlier versions codeblock used above but missing here. Should we add it for this example and any others that follow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same response as above.
@@ -48,7 +48,7 @@ def test_page_menu_001(dash_doc): | |||
dash_doc.wait_for_element_by_id("page-menu--links") | |||
|
|||
home_links = [ | |||
'Dash User Guide', | |||
'Dash Python User Guide', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Dash Python User Guide', | |
'Dash for Python User Guide', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is outside of the scope of this PR- if we want to reword the heading let's do it in a separate PR where we change it both here in the test and in the markup so that CI keeps passing.
Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>
Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>
Co-authored-by: Ryan Patrick Kyle <rpkyle@users.noreply.github.com>
Once we can get the tests passing, 💃 |
Summary
I'm porting the docs written by @jourdain in the dash-vtk repo. I also added the dash examples.
dash-vtk/docs/images
todash_docs/assets/images/vtk/
libgl1-mesa-glx
andlibXt
to Aptfile since it is required byvtk
forpip<=18
dash_docs/chapter_index.py
dash_docs/chapters/dash_vtk/
directory module and import it indash_docs/chapter_index.py
dash-vtk/docs/tutorials
todash_docs/chapters/dash_vtk/examples
dash-vtk/docs/README.md
todash_docs/chapters/dash_vtk/index.py
; modified to dynamically display the demos indash_docs/chapters/dash_vtk/examples
datasets/cow-nonormals.obj
dash-vtk==0.0.4
,vtk==9.*;python_version>="3.7"
andvtk==8.*;python_version<="3.6"
torequirements.txt
Post-merge checklist:
The master branch is auto-deployed to
dash.plotly.com
.Once you have merged your PR, wait 5-10 minutes and check dash.plotly.com
to verify that your changes have been made.
If this PR documents a new feature of Dash:
If this PR includes a new dataset available at a remote URL:
datasets/
folderdatasets/
folder into thefind_and_replace
dict indash_docs/tools.py
If this PR adds an image or animated GIF:
If I introduced a new relative link inside
dcc.Markdown
:dcc.Markdown
call withrc.Markdown
, which will replace relative links withtools.relpath
internally. Otherwise, I used e.g.<dccLink href=tools.relpath('/layout') children="the first chapter"/>
instead of[the first chapter](/layout)
(importingtools
fromdash_docs
), and setdangerously_allow_html=true
in thedcc.Markdown
call.If I changed the
chapter_index
by removing or relocating a page:dash_docs/server.py
from the old URL to the new URL