mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.7K
active users

#plotlydash

0 posts0 participants0 posts today
Scott H.<p>Right in the middle of writing my large paper Triple System Analysis in 2023, I envisioned <a href="https://mastodon.social/tags/PlotlyDash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PlotlyDash</span></a> and <a href="https://mastodon.social/tags/MQTT" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>MQTT</span></a> as handling the streams, and built this demonstration. This might still be good for some, particularly those who need other integrations and <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a>.<br><a href="https://youtu.be/U8ZtJ-kr_2o" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">youtu.be/U8ZtJ-kr_2o</span><span class="invisible"></span></a></p>
Julien :ve: 🔭:python:<p>TIL: Plotly Dash uses the order of the pages in the pages registry to evaluate whether the requested URL matches a page's `path_template` value. By default, pages are ordered alphabetically based on the pages filename.</p><p>In my case, I had two pages defined with the following `path_template` values:<br>- `/datasets/&lt;dataset_id&gt;` in `pages/dataset.py`<br>- `/datasets/&lt;dataset_id&gt;/labelsets/&lt;labelset_id&gt;` in `pages/labelset.py`</p><p>When trying to open a URL matching the second template, it was matching the first one and using the remainder of the URL as `dataset_id`.</p><p>Setting the `order` parameter in the `dash.register_page()` function changes the order of the pages in the page registry, thus changing the path matching order. To match the longest/nested `path_template`, the corresponding page has to be registered with a lower `order` value.</p><p>That makes sense in hindsight but the docs do not mention that the path evaluation is affected by the page order.</p><p><a href="https://dash.plotly.com/urls" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">dash.plotly.com/urls</span><span class="invisible"></span></a></p><p><a href="https://techhub.social/tags/Plotly" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Plotly</span></a> <a href="https://techhub.social/tags/PlotlyDash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PlotlyDash</span></a> <a href="https://techhub.social/tags/Dash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Dash</span></a> <a href="https://techhub.social/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> <a href="https://techhub.social/tags/WebDev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>WebDev</span></a></p>