app

app

Main file to run the application.

This script initializes the application, sets up the user interface, and determines which functionality to execute based on the selected tab and the options in the sidebar.

The application includes various tabs for different functionalities, such as:
  • One agent (for 2D/3D agent creation and visualisation)

  • Crowd (for 2D/3D crowd creation, visualisation, and generation of .xml config files)

  • Anthropometry (for data visualisation and analysis)

  • About (for displaying general information about the project)

Examples

To run the application, execute these commands from the root directory of the project:

>>> pip install --upgrade pip
>>> pip install uv
>>> uv sync
>>> uv run streamlit run src/streamlit_app/app/app.py

documentation

About tab of the app.

streamlit_app.app.documentation.about()[source]

Write about text.

Return type:

None

ui

User interface module.

streamlit_app.app.ui.setup_app()[source]

Set up the Streamlit page configuration.

Return type:

None

streamlit_app.app.ui.menubar()[source]

Create a menu bar with multiple tabs and icons, adapting its appearance to Streamlit's selected theme.

Returns:

The selected option from the menu bar.

Return type:

Any

Notes

  • Streamlit's st.markdown is used to apply custom CSS styles.

  • The option_menu function creates the menu bar with specified tabs and icons.

  • The unsafe_allow_html=True parameter enables Streamlit to render raw HTML and CSS.

  • The styles dictionary customizes the appearance of the menu bar.

  • Icons can be selected from https://icons.getbootstrap.com/.

streamlit_app.app.ui.init_sidebar_looks()[source]

Initialize the appearance of the sidebar with several badges and a logo image.

Return type:

None