Replies: 9 comments 44 replies
-
What a coincidence! I was exploring this very topic yesterday. Mesa models can be run headless without browser, so in theory it should be possible to use any Python frontend for visualization, with of course some extra work linking Mesa models and these frontend frameworks. What I created yesterday was a very simple visual for the Schelling example. The code is available at this link and it looks like the following: If Mesa can provide some View classes for the built-in spaces (grid, continuous, network, etc), then we can re-use lots of widgets/components (slider, button, etc) in Streamlit, and plot whatever diagram we want in matplotlib and show it in Streamlit app. The downside of it is that there's an extra dependency on Streamlit, and users will need to learn how to use it. But given the ease of use and richness of its documentation, hopefully this won't cause too much trouble. |
Beta Was this translation helpful? Give feedback.
-
Hi all, I also tested Panel. It works quite well with Jupyter notebook. I use the same example. The source can be found in the notebook |
Beta Was this translation helpful? Give feedback.
-
There is also Voilà. |
Beta Was this translation helpful? Give feedback.
-
Comparison articles:
|
Beta Was this translation helpful? Give feedback.
-
I have this thought in mind but haven't said it: the extra value in Mesa in switching to pure Python frontend is that we may no longer have to deal with custom JS deps downloads. They all can be removed, and we can finally move to declarative pyproject.toml and setup.cfg. (Then finally I can have the bandwidth to grow mesa-examples instead of having to worry about the software engineering stuff.) |
Beta Was this translation helpful? Give feedback.
-
I have seen that https://gradio.app/ is used in the UIs for Hugging Face. @wang-boyu have you looked into it, since it is listed in one of the possible frameworks to use in the GSoC wiki? |
Beta Was this translation helpful? Give feedback.
-
see attached proposal and provide comments and or critiques. A lot was taken from Ankit's proposal but based on the typeform where it needs to be submitted I was unable to add pictures in my test so no diagram. Mesa NumFOCUS Small Development Grant Application Questions -draft.pdf |
Beta Was this translation helpful? Give feedback.
-
Maybe this is also a good time to rethink splitting mesa into different packages? (#1295) With mesa-examples already gone it would be a smaller step to create an own repo for the frontend and leave the remaining bits of mesa as mesa-core. It would also allow us to keep the current frontend in a separate repo. I think the current ModularServer has some nice properties that would be a pity to miss. First of all the possibility to create truly custom displays is something I have rarely seen anywhere. Second it is fairly easy to host. You just have to start the server and that's it. Separating the repo would also have the advantage that we could build the frontend gradually without worrying about breaking changes for mesa-core. Starting in a pre-v1 environment allows for rapid development, whereas we should be more careful with mesa-core. On the topic of choosing a framework, I think it would be very nice to have the ability to trigger an action on clicks inside the visualisations as this would allow you to build more interactive experiences. I don't know which of the proposed frameworks allow this. |
Beta Was this translation helpful? Give feedback.
-
Hi, you might also want to consider Solara (disclaimer: I'm an author for both Voila and Solara). Voila is focused on executing Jupyter notebooks, and rendering the output, where ipywidgets are the default way to build interactive interfaces. Solara has two parts:
The server part can be seen as an alternative to Voila if the focus is to only show a UI (and not notebook output) and will perform better due to having a single process vs 1 kernel/process per request. Regards, Maarten |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I am looking at a pure python frontend framework to be used for Mesa. So far I'm looking into StreamLit, Dash and Panel. All these are open-source packages.
For an initial pipe-cleaner/proof of concept I tried to the Boltzmann Money Model example from the documentation. I was able to start the simulation and visualise the results using StreamLit browser based UI . The more details on the approach and the instruction to run the UI can be found here: github Link.
Here is a screenshot:
I now try to see the Jupyter compatibility of these packages. Looking forward for your views on this.
Beta Was this translation helpful? Give feedback.
All reactions