✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Parallel Categories Diagram examples

I’m trying to create the basic Parallel Categories chart in Dash but when I run the following code I get only an empty graph. This is what my code looks like:

import dash
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objs as go

app = dash.Dash()

figure = {
    'data': [go.Parcats({
                'dimensions' : [
                    {'label': 'Hair',
                     'values': ['Black', 'Brown', 'Brown', 'Brown', 'Red']},
                    {'label': 'Eye',
                     'values': ['Brown', 'Brown', 'Brown', 'Blue', 'Blue']},
                    {'label': 'Sex',
                     'values': ['Female', 'Male', 'Female', 'Male', 'Male']}
                     ],
                'counts' : [6, 10, 40, 23, 7]})
            ]
}

app.layout = html.Div([
    dcc.Graph(
        id='graph-1',
        figure = figure
    )
])


if __name__ == '__main__':
    app.run_server(debug=True)

Is there something wrong in the definition of the figure?

What is your dcc.__version__?

Thank you! Unfortunately, it was 0.27.1. After upgrading all Dash libraries to newest versions it works and the diagram is correctly displayed:

2 Likes