Skip to main content

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.2.0.tar.gz (153.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_aggrid_scales-0.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file dash_aggrid_scales-0.2.0.tar.gz.

File metadata

  • Download URL: dash_aggrid_scales-0.2.0.tar.gz
  • Upload date:
  • Size: 153.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for dash_aggrid_scales-0.2.0.tar.gz
Algorithm Hash digest
SHA256 50c2f37d1b7d2edf8ec73d6e6d6b99f7250a89ee07480288f90b07fcf9175975
MD5 37e8cc0c4265012bffc4f22f4e919e62
BLAKE2b-256 b1437e698cf4c94f94a9cf89eb6aab0fb075c6e9dd7d769189811b9484a61eea

See more details on using hashes here.

File details

Details for the file dash_aggrid_scales-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dash_aggrid_scales-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bc254fd1c70f82353037e4f5da7cd8bf075f87dbf6c187e784ac94d0133e1ff
MD5 2e55441020d14206c3dfd24708361006
BLAKE2b-256 f88e0217ab26a3c978f6ff1faf4c73f2fa82cc049d0999804ca98b5b1ec4b8f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page