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)

The resulting app will display an AgGrid as follows:

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: dash_aggrid_scales-0.3.1.tar.gz
  • Upload date:
  • Size: 332.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for dash_aggrid_scales-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f17aa14d49866a540221ce0ad8ecf598566ab7286386cc92b6946a5b053971eb
MD5 66ea08bd044dfbf1cae81734d5b64c3a
BLAKE2b-256 24bd942ea58aea6aa50b214a9a2d32a1c22d3ff2589e00b1aa7e766d703c48f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dash_aggrid_scales-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9eed3926bfa0baa32b612d1e1cd499b2ded95c03828dafc779ac95b601861950
MD5 73578c8819c5f9b22890018f30098d68
BLAKE2b-256 2ab96640e39fd53c945fe3728dde09c96a467a4116c802dfdf01628fb9d68738

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