Plotly color scales to apply to columns in an AgGrid
Project description
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
pip install dash-aggrid-scales
Hello World
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dash_aggrid_scales-0.3.0.tar.gz
(206.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dash_aggrid_scales-0.3.0.tar.gz.
File metadata
- Download URL: dash_aggrid_scales-0.3.0.tar.gz
- Upload date:
- Size: 206.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83aff439237485505aa734ec9b8e23c91a57aadbe4a8f35357a64727f50f3961
|
|
| MD5 |
c770ea106f4d821180878961586bde6e
|
|
| BLAKE2b-256 |
5686141310ba55384e018a5bf2f88de78742b5c481796c08659ae6f0d91e4719
|
File details
Details for the file dash_aggrid_scales-0.3.0-py3-none-any.whl.
File metadata
- Download URL: dash_aggrid_scales-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1b5f788b24e21f7a9f46e1b77cbd8841f2ee0dc2bc6f069221c9d129ebfa9d6
|
|
| MD5 |
dbc4119632c03a4ff26afd01a0ad1195
|
|
| BLAKE2b-256 |
e9cebb61f64a54974bcf7b01cf95fbb1d01e92125d1bef9ead7479d85f22d1ee
|