Adding color scale #76
-
Hi, I have just started with the examples given in the tutorial and was trying to understand if/how a 'color scale' can be added to the figure obtained from the file '/trame-tutorial/04_application/solution.py' to display the range values for each variable in the color map. It is possible to print the range value, but I am trying to have it displayed as 'color scale' alongside the figure for different color maps. Also, in the 'slider' option, is it possible to display the minimum or maximum values for the slider? If so, it would be nice to know how to do that as well. Thanks in advance, Best, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
For the scalar bar you can follow that example to set it on the server side. Then for the range for the scalars for the slider, you can put them where ever you want in the UI. If you edit that part with some dynamic text you will have those bounds with ui_card(title="Contour", ui_name="contour") as content:
vuetify.VSelect(
# Contour By
label="Contour by",
v_model=("contour_by_array_idx", 0),
items=("array_list", dataset_arrays),
hide_details=True,
dense=True,
outlined=True,
classes="pt-1",
)
content.add_child("{{ contour_min }}") # <--- NEW
vuetify.VSlider(
# Contour Value
v_model=("contour_value", contour_value),
min=("contour_min", default_min),
max=("contour_max", default_max),
step=("contour_step", 0.01 * (default_max - default_min)),
label="Value",
classes="my-1",
hide_details=True,
dense=True,
)
content.add_child("{{ contour_max }}") # <--- NEW |
Beta Was this translation helpful? Give feedback.
-
The problem is that To do that:
Example for vtkScalarBarActor
|
Beta Was this translation helpful? Give feedback.
For the scalar bar you can follow that example to set it on the server side.
Then for the range for the scalars for the slider, you can put them where ever you want in the UI. If you edit that part with some dynamic text you will have those bounds