Repository for IDD figures and interactive plotting tools in Python.
You can launch an interactive Python Shiny app to explore map figures with sliders and dropdowns for plot options (e.g., number of bins, colormap):
Make sure your environment includes:
- shiny
- geopandas
- matplotlib
- numpy
If using conda:
conda install -c conda-forge shiny geopandas matplotlib numpy
Or with pip:
pip install shiny geopandas matplotlib numpy
python src/idd_figures/shiny_app.py
This will start a local Shiny server. Open the provided URL in your browser to interact with the app.
# Clone the repository
git clone https://github.com/ihmeuw/idd-figures.git
cd idd-figures
# Create and activate the conda environment
conda env create -f environment.yml
conda activate idd-figures
You can install and use idd_figures
in other projects/environments:
pip install git+https://github.com/ihmeuw/idd-figures.git
Then, in your Python code:
from idd_figures import plot_map
def get_plot_data(plot_dict):
# User-defined logic to prepare plot_dict for plotting
return plot_dict
plot_map(plot_dict, get_plot_data)