Are you using the embedded viewer?
Most things you can do in the general Speckle viewer (and the embedded viewer) are possible to replicate as each interaction is recorded in the browser URL query parameters.
Colouring:
Assuming you mean controlling the colour akin to the frontend object filtering method. This is the simplest answer.
filter={"propertyInfoKey":"PROPERTY_TO_COLOR_BY"}
You may need to experiment with what values to set in a server frontend, but if you have some relative control over the content coming in from Grasshopper, this shouldn’t be too much of a stretch.
Bear in mind, there is no control by the viewer over what colours are used for each value of the coloured property. There is also NO means of overriding the appearance on an individual object basis, unless you address the object id as the property to colour by.
Isolating/Hiding:
This is more complicated and I can offer two options.
Option A. The URL method:
Objects in the viewer are hidden by a singular method: a hidden Ids array. The UI of the Speckle frontend calculates these ids for you as you interact with the object data.
filter={"hiddenIds":["05f3...","06d2...","08426..."]}
Your Streamlit code would have to parse the Commit Version data to generate these lists for you per Level. This is not HARD to do with python and specklepy, but it is work to setup your UI buttons.
Option B. The Model Branch method.
Whether this is useful to you or not is dependant on what your overall objectives are for this project. The basic principle would be that each Level in the Rhino model be sent to a separate Version Commit or Model Branch.
Your Streamlit hosted viewer would then assemble each component of the whole using the objects overlay method, again with URL construction
streams/STREAMID/commits/COMMITID_LAYER1?overlay=COMMITID_LAYER2,COMMITID_LAYER3
All you’d need to do here in your Streamlit app is keep track of the commit_id
s for each branch/commit representing the layers.
Neither option is without work, but with more complex models, the latter is a lot less data processing. It somewhat depends on what you are creating to present to the viewer.
The bonus good news is that the color-by-property instruction applies to all overlaid models, not just the base model.
I can post some example python code for Option A or B if you think that either sounds close.