0.0.92 • Published 3 days ago

dash_express_components v0.0.92

Weekly downloads
-
License
MIT
Repository
-
Last release
3 days ago

Dash Express Components

Publish release PyPI npm Documentation Test codecov

Components to bring Plotly Express style plots to Dash:

A typical data flow looks like this:

First, the metadata is extracted from the dataframe df with dxc.get_meta(df). This meta json is needed for dxc.Filter, dxc.Transform or dxc.Plotter to show all options without additional queries to the dataframe. As a result, the components react quite quickly.

Since the metadata can be changed by filter or transform operations, and we don't want additional server calls, the changes are directly computed in the web components. You can access the metadata after transformations via the meta_out property of dxc.Filter and dxc.Transform.

A combined config is needed to compute the final plot with dxc.get_plot(df, config). You can combine the configurations of each component yourself or use the dxc.Configurator to get a combined configuration like:

{
    "filter": [
        {
            "col": "continent",
            "type": "isnotin",
            "value": ["Oceania"]
        }
    ],    
    "transform": [
        {
            "type": "aggr",
            "groupby": [
                "country",
                "continent"
            ],
            "cols": ["gdpPercap"],
            "types": ["median"]
        }
    ],
    "plot": {
        "type": "box",
        "params": {
            "x": "continent",
            "y": "gdpPercap_median",
            "color": "continent",
            "aggr": ["mean"],
            "reversed_x": True
        }
    }
}

An example with the gapminder dataset and dash-lumino-components for the MDI layout. example

Try it

Install dependencies

$ pip install dash-express-components

and start with quickly editable graphs:

import dash_express_components as dxc
app.layout = html.Div([

    # add a plot dxc.Configurator
    html.Div([
        dxc.Configurator(
            id="plotConfig",
            meta=meta,
        ),
    ], style={"width": "500px", "float": "left"}),

    # add an editable dxc.Graph 
    html.Div([
        dxc.Graph(id="fig",
                  meta=meta,
                  style={"height": "100%", "width": "100%"}
                 )],
        style={"width": "calc(100% - 500px)", "height": "calc(100vh - 30px)",
               "display": "inline-block", "float": "left"}
    )
])

Develop

  1. Install npm packages

    $ npm install
  2. Create a virtual env and activate.

    $ virtualenv venv
    $ . venv/bin/activate

    Note: venv\Scripts\activate for windows

  3. Install python packages required to build components.

    $ pip install -r requirements.txt
  4. Build your code

    $ npm run build
  5. Run the example

    $ python usage.py
0.0.92

3 days ago

0.0.91

27 days ago

0.0.84

6 months ago

0.0.85

6 months ago

0.0.86

6 months ago

0.0.87

6 months ago

0.0.88

6 months ago

0.0.89

5 months ago

0.0.80

6 months ago

0.0.81

6 months ago

0.0.82

6 months ago

0.0.83

6 months ago

0.0.73

8 months ago

0.0.74

8 months ago

0.0.75

6 months ago

0.0.76

6 months ago

0.0.77

6 months ago

0.0.78

6 months ago

0.0.79

6 months ago

0.0.70

10 months ago

0.0.71

10 months ago

0.0.72

10 months ago

0.0.67

10 months ago

0.0.68

10 months ago

0.0.69

10 months ago

0.0.90

5 months ago

0.0.66

10 months ago

0.0.65

1 year ago

0.0.64

1 year ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.58

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago