The ScalarBar, OrientationAxes, and AxesGrid fail to render when calling paraview.VtkLocalView #524
-
Hello, I have a trame/paraview application written in vue3. When I test the app locally using VtkRemoteView, everything works as expected. But when I swtich to VtkLocalView, which I need for deployment, only the VTKs render but none of the other elements. Do you have any thoughts as to why the other elements are lost in LocalView? In case it helps, here is the last part of the GUI with layout.content:
with vuetify.VContainer(fluid=True, classes="fill-height pa-0 ma-0"):
html_view = paraview.VtkLocalView(
view, namespace="view")
ctrl.view_update = html_view.update
ctrl.view_reset_camera = html_view.reset_camera And here is the callback where I define the scalarbar @ state.change("active_array")
def update_color_by(active_array, fields, **kwargs):
global color_bar
if len(fields) == 0:
return
array = fields[active_array]
simple.ColorBy(representation, (array.get("location"), array.get("title")))
representation.RescaleTransferFunctionToDataRange(True, False)
name = pv.make_name_valid(array.get("title"))
lut = simple.GetColorTransferFunction(name)
pwf = simple.GetOpacityTransferFunction(name)
_min, _max = array.get("range")
lut.RescaleTransferFunction(_min, _max)
pwf.RescaleTransferFunction(_min, _max)
color_bar = simple.GetScalarBar(lut, view)
color_bar.Title = array.get("title")
color_bar.RangeLabelFormat = '%-#3.2f'
color_bar.ComponentTitle = ""
color_bar.WindowLocation = 'Lower Center'
color_bar.Orientation = 'Horizontal'
simple.UpdateScalarBars(view)
ctrl.view_update() |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Those discrepancy are expected when using vtk.js as rendering implementation. But we are working on a WASM implementation that will fix that. But it won't be ready for prime time before 5.13 at least. |
Beta Was this translation helpful? Give feedback.
-
You can get most of it working if you create the scalar bar in plain VTK and put it into the ParaView view. |
Beta Was this translation helpful? Give feedback.
-
Forgive the stupid question but if I don't have a GPU in my server is it still possible to use paraview.VtkRemoteRendering? Maybe a better question is when should I use Local vs Remote rendering? |
Beta Was this translation helpful? Give feedback.
Those discrepancy are expected when using vtk.js as rendering implementation. But we are working on a WASM implementation that will fix that. But it won't be ready for prime time before 5.13 at least.