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
Would it be possible to set camera parameters? #59
Comments
I guess we only have those properties so far. |
Is there a way to do that via js so I can get something working until a release of dash-vtk that makes it possible in python? (I'm a novice with react and js so sorry if that's a silly question.) |
I don't think that you have much control on the JS side from Dash but I might be wrong. If you can make a JS call on the react VtkView component, you can get your hand on the camera by calling |
Thanks. I've no idea how to get that view component, yet, but I'll look into it. |
Even if I could find a way to make a JS call on the React-vtk-js View component, I don't think it'd work. I realise now that the resetCamera method is called here, which moves the camera position anyway. So, I think I need to make a custom React class, based on the View component of React-vtk-js, and turn it into a Dash component using the dash-component-boilerplate. Then I think I can get the functionality I need. And, I think I can use clientside callbacks to make the camera updates fast (e.g. for animation). Hopefully that makes sense and will work. And hopefully it's not too hard to do! Thanks again for your comments. I'll close this issue as it doesn't seem like it's a dash-vtk issue to me now. |
I have one more question for you, @jourdain, if you have a moment to answer. If I make a stand-alone Dash component, I'm not sure how to properly configure and write my JS imports so that I can use dash_vtk seamlessly with the new component (still a novice with JS, Dash, React, webpack, etc.). I can't find how to do that. I think I need to import the View.react.js View from dash-vtk. Is there an easy way to do that? Can I do something like this in my JS file?
I'm not sure how to structure the files so that that might work. Or do I need to do something like clone the dash-vtk repo, add a new custom class, and build it? I'd appreciate any guidance you can give. |
If your code is JS, you should import |
Ah, so I just make react-vtk-js a dependency in the package.json and do something like `import VtkView from 'react-vtk-js' in the JS file? And it won't matter that my component doesn't know about dash_vtk? |
yes exactly. You can double check how dash-vtk do its import as you are basically doing the same thing yourself. |
Great, thanks again! |
I'd like to set the camera location, depth of view, etc. via code, but I cannot find any way to do this. Is it possible to add this as a feature? Is there a workaround I could use in the meantime?
Thanks, and thanks for all the great work!
The text was updated successfully, but these errors were encountered: