Viewing Speckle in Streamlit

Hello,

I am following the ‘Create your first Speckle App’ tutorial.

I have succesfully embedded my speckle commit within streamlit. My question is, when it loads up for the first time, it loads up with the side panel showing, is there a way for the side panel to not show by default within the first view. Additionally, in the tutorial is shows very cleanly on a dark background with not many tools shown- mine shows all tools on a light background- is this just because the viewer has since been updated.

Finally, my commit has say 5 layers, is there a way I can add a default filter in the viewer when it opens within my app, so I can isolate it down to a single layer.

Thankyou

Hi Sam, thank you for reaching us.

I think you can fix it by displaying the Embed options and selecting Hide viewer sidebar before copying the iframe link. Please let me know if this works for you. Thank you!

embed options

ok that works if I add the following:

commitlink = “https://” + speckleServer + “/embed?stream=” + TowerStream.id + “&commits=” + commit_massing.id + “&commit=4b4f3dee81&transparent=true”

edit- answered my own question- to show model automatically use: &autoload=true

2 Likes

Hi @carlux

In the viewer, is it possible to colour different layers different colours?

Thankyou

Try following this tutorial: How To: Customising the embedded viewer programmatically

Most things, if you can do it in the viewer you can replicate it in embedded viewer.

1 Like

Hi! taking advantage your questions and besides the great Jonathon’s answer, could I ask you what do you mean with “colour different layers with different colours”? What would you like or how would you expect to do that? What are you trying to achieve?

For example we assign some colors when you filter by different values. But I think you are talking about different thing. Could you provide more info? Thank you!
colors

Essentially I am going to have the speckle viewer, and then co-located on that same page, I am going to have a graph that shows various figures by layer. I essentially want to link these two visually.

So I can colour all geometry that occurs on a certain layer in the same way that the layer is represented on the graph. Does that make sense?

The interaction can be linked, and colouring by Layer is also possible.

Using the embedded viewer, however, comes with some drawbacks.

You won’t have control over the colours used for each Layer value. They are programmatically determined, so syncing the two “interfaces” won’t be possible at this time.

Also, as the interaction will be URL based, changing that value will reload the viewer each time. Other users have seen simple interactions as a small UX cost. This can be jarring for the user for more frequent or intricate interactions.

Ah ok- the not being able to pre-determine colours is a bit of a deal breaker for this use case. Thankyou for your quick replies!

1 Like

@jonathon

Thanks for this! I am going to give it a try anyway and push it to as far as it can go- I think I can still someway to where I want to be! thankyou

1 Like