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.1.tar.gz (155.4 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.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dash_aggrid_scales-0.2.1.tar.gz
  • Upload date:
  • Size: 155.4 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.1.tar.gz
Algorithm Hash digest
SHA256 2d08b935edf49c83d0fd83a084c289a46a154c8bcc5847eba93de70e7e22d09b
MD5 4ded26ab339c4c9664789128428e1c42
BLAKE2b-256 bf3808b45d9e98b84c30791e02d8279fbe2480cb47a65531dc59e8274c4e0525

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dash_aggrid_scales-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa4a1814569a5ef05ad0f22c6238673a423b0a0102e4f752395ffad2c1d58467
MD5 ad369ec1356cda1a5165dacd306338e4
BLAKE2b-256 a04bc18f9689be5e0ba44a3e1d8b7ecfaa6349f24778cb9a819914131ecce31c

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