https://github.com/eliasdabbas/dash-aggrid-scales
Color scales (continuous and categorical) and bar charts for Dash-Ag-Grid
https://github.com/eliasdabbas/dash-aggrid-scales
aggrid color-scales color-scheme data-science data-visualization html plotly-dash table
Last synced: about 1 month ago
JSON representation
Color scales (continuous and categorical) and bar charts for Dash-Ag-Grid
- Host: GitHub
- URL: https://github.com/eliasdabbas/dash-aggrid-scales
- Owner: eliasdabbas
- License: mit
- Created: 2025-01-28T12:35:33.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-05T23:44:31.000Z (8 months ago)
- Last Synced: 2025-04-02T18:50:20.191Z (7 months ago)
- Topics: aggrid, color-scales, color-scheme, data-science, data-visualization, html, plotly-dash, table
- Language: Python
- Homepage: https://dash-aggrid-scales.com
- Size: 207 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dash AgGrid Scales
Plotly color scales for columns in `dash-ag-grid`
This package provides three main scales to highlight values in AgGrid columns. For consistency, the names use the same conventions use by the `plotly.colors` module:
- sequential
- qualitative
- bar
## Installation
```bash
pip install dash-aggrid-scales
```## Hello World
```python
import dash_aggrid_scales as das
from dash import Dash, html
from dash_ag_grid import AgGrid
import plotly.express as px
medals = px.data.medals_long().assign(negative=list(range(-5, 4)))app = Dash()
app.layout = html.Div([
AgGrid(
rowData=medals.to_dict("records"),
columnSize="sizeToFit",
style={"height": 500},
columnDefs=[
{
"field": "nation",
"headerName": "nation (qualitative)",
"cellStyle": {"styleConditions": das.qualitative(medals["nation"])},
},
{
"field": "medal",
"headerName": "medal (qualitative)",
"cellStyle": {"styleConditions": das.qualitative(medals["medal"], "Safe")},
},
{
"field": "count",
"headerName": "count (sequential)",
"cellStyle": {"styleConditions": das.sequential(medals["count"])},
},
{
"field": "count",
"headerName": "count (bar)",
"cellStyle": {"styleConditions": das.bar(medals["count"])},
},
{
"field": "negative",
"headerName": "random +ve & -ve values (bar)",
"cellStyle": {"styleConditions": das.bar(medals["negative"], "teal")},
},
],
)
])if __name__ == "__main__":
app.run(debug=True)```