An interactive web application built with Dash and Plotly that allows users to create and visualize custom colormaps dynamically.
- Default Colormap: Starts with a white colormap from 0 to 100.
- Add Custom Colors:
- Select a color from a predefined list.
- Define the range (minimum and maximum) for the selected color.
- Real-time Visualization:
- The colormap updates dynamically as new colors are added.
- Overlapping ranges are handled intelligently:
- Overlapping colors are adjusted to maintain non-overlapping ranges.
- White remains the default color for any unused intervals.
- Dynamic Labels:
- Transitions between color ranges are displayed as tick labels on the colormap axis.
- Color Info Display:
- A detailed list of all added colors and their respective ranges is displayed below the colormap.
-
Clone the repository:
git clone https://github.com/yourusername/interactive-colormap-builder.git cd interactive-colormap-builder
-
Install the dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Open a browser and navigate to:
http://127.0.0.1:8050/
-
Start customizing your colormap by:
- Selecting a color.
- Specifying its range.
- Clicking "Add Color" to update the colormap.
.
├── app.py # Initializes the Dash app and runs the server
├── layout.py # Defines the layout of the app
├── callback.py # Contains the callback logic for interactivity
├── README.md # Project documentation
├── requirements.txt # Python dependencies
├── images/
│ └── screenshot.png # Screenshot of the application
- Python 3.7+
- Dash
- Plotly
To install all required Python libraries, run:
pip install -r requirements.txt
In the example above:
- The initial colormap is white from 0 to 100.
- A blue color is added for the range
[20, 40]
. - A orange color is added for the range
[20, 25]
.- Blue is updated to
[35, 40]
to avoid overlap. - White fills the remaining intervals.
- Blue is updated to
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License.