title: "App Layout tutorial" linktitle: "Notebook following Part 2 Layout of the Dash tutorial " subtitle: "The layout attribute describes what the app will look like" draft: false date: 2021-08-16

image: ../../dash_plotly/images/dash_layout_tutorial.png alt_text: "App_layout screenshot" summary: "Summary of the App_layout project"

tech_used:

  • Dash
  • HTML
  • Bootstrap

Dash Layout tutorial

See https://dash.plotly.com/layout

Dash includes "hot-reloading" so new features are activated by default when you run the app with debug=True in app.run_server method. Dash automatically refreshes the browser when you make a change in the code.

To turn this off use app.run_server(dev_tools_hot_reload=False). I'm not sure if this works in Jupyter

In [6]:
# First app in dash plotly - layout tutorial
#import dash
from jupyter_dash import JupyterDash

import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

# app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app = JupyterDash(__name__, external_stylesheets=external_stylesheets)

colors = {
    'background': '#111111',
    'text': '#7FDBFF'
}
# assume you have a "long-form" data frame
# see https://plotly.com/python/px-arguments/ for more options
df = pd.DataFrame({
    "Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"],
    "Amount": [4, 1, 2, 2, 4, 5],
    "City": ["SF", "SF", "SF", "Montreal", "Montreal", "Montreal"]
})

fig = px.bar(df, x="Fruit", y="Amount", color="City", barmode="group")

# Add a background colours to the figure
fig.update_layout(
    plot_bgcolor=colors['background'],
    paper_bgcolor=colors['background'],
    font_color=colors['text']
)


app.layout = html.Div(children=[
    html.H1(
        children='Hello Dash',
        
        # can add style change to this div
            style={
            'textAlign': 'center',
            'color': colors['text']
        }
           
           ),

    html.Div(children='''
        Dash: A web application framework for Python.
    ''',
             style={
            'textAlign': 'center',
            'color': colors['text']
        }),

    dcc.Graph(
        id='example-graph',
        figure=fig
    )
])

#if __name__ == '__main__':
#    app.run_server(debug=True)
    
if __name__ == '__main__':
        app.run_server(debug=True, mode= 'inline', port = 8054)

Reusable components

By writing our markup in Python, we can create complex reusable components like tables without switching contexts or languages. See https://dash.plotly.com/layout of the tutorial.

In [ ]:
 
In [ ]:
 
In [7]:
#import dash
from jupyter_dash import JupyterDash


import dash_html_components as html
import pandas as pd

df = pd.read_csv('https://gist.githubusercontent.com/chriddyp/c78bf172206ce24f77d6363a2d754b59/raw/c353e8ef842413cae56ae3920b8fd78468aa4cb2/usa-agricultural-exports-2011.csv')


def generate_table(dataframe, max_rows=10):
    return html.Table([
        html.Thead(
            html.Tr([html.Th(col) for col in dataframe.columns])
        ),
        html.Tbody([
            html.Tr([
                html.Td(dataframe.iloc[i][col]) for col in dataframe.columns
            ]) for i in range(min(len(dataframe), max_rows))
        ])
    ])


external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']


#app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app = JupyterDash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[
    html.H4(children='US Agriculture Exports (2011)'),
    generate_table(df)
])

if __name__ == '__main__':
    app.run_server(debug=True, mode= 'inline', port = 8053)
In [ ]:
 

A scatter plot from a pandas DataFrame

The graph is interactive and responsive.

  • hover over points to see values
  • click on legends to toggle traces
  • click and drag to zoom and
  • shift, click and drag to pan
In [8]:
#import dash
from jupyter_dash import JupyterDash

import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd


external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

#app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app = JupyterDash(__name__, external_stylesheets=external_stylesheets)
df = pd.read_csv('https://gist.githubusercontent.com/chriddyp/5d1ea79569ed194d432e56108a04d188/raw/a9f9e8076b837d541398e999dcbac2b2826a81f8/gdp-life-exp-2007.csv')

fig = px.scatter(df, x="gdp per capita", y="life expectancy",
                 size="population", color="continent", hover_name="country",
                 log_x=True, size_max=60)

app.layout = html.Div([
    dcc.Graph(
        id='life-exp-vs-gdp',
        figure=fig
    )
])

if __name__ == '__main__':
    app.run_server(debug=True, mode="inline", port = 8054)

Markdown

In [9]:
#import dash
from jupyter_dash import JupyterDash
import dash_core_components as dcc
import dash_html_components as html

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = JupyterDash(__name__, external_stylesheets=external_stylesheets)

markdown_text = '''
### Dash and Markdown

Dash apps can be written in Markdown.
Dash uses the [CommonMark](http://commonmark.org/)
specification of Markdown.
Check out their [60 Second Markdown Tutorial](http://commonmark.org/help/)
if this is your first introduction to Markdown!
'''

app.layout = html.Div([
    dcc.Markdown(children=markdown_text)
])

if __name__ == '__main__':
    app.run_server(debug=True, mode = 'inline', port = 8055)

Core components - dropdowns, graphs, markdown blocks, sliders etc

dash_core_components includes a set of higher-level components including dropdowns, sliders, markdown blocks, graphs etc which are described entirely declaratively. Every option that is configurable is available as a keyword argument of the component.

See the Dash Core Components Gallery for all of the available components.

In [10]:
from jupyter_dash import JupyterDash
import dash_core_components as dcc
import dash_html_components as html

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = JupyterDash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div([
    html.Label('Dropdown'),
    dcc.Dropdown(
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': u'Montréal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value='MTL'
    ),

    html.Label('Multi-Select Dropdown'),
    dcc.Dropdown(
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': u'Montréal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value=['MTL', 'SF'],
        multi=True
    ),

    html.Label('Radio Items'),
    dcc.RadioItems(
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': u'Montréal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value='MTL'
    ),

    html.Label('Checkboxes'),
    dcc.Checklist(
        options=[
            {'label': 'New York City', 'value': 'NYC'},
            {'label': u'Montréal', 'value': 'MTL'},
            {'label': 'San Francisco', 'value': 'SF'}
        ],
        value=['MTL', 'SF']
    ),

    html.Label('Text Input'),
    dcc.Input(value='MTL', type='text'),

    html.Label('Slider'),
    dcc.Slider(
        min=0,
        max=9,
        marks={i: 'Label {}'.format(i) if i == 1 else str(i) for i in range(1, 6)},
        value=5,
    ),
], style={'columnCount': 2})

if __name__ == '__main__':
    app.run_server(debug=True, mode="inline", port = 8054)

Getting Help

Dash componets are declarative and every aspect of them that can be configured is done so using keyword arguments during app instantiation.

To find help or more information on any component call help on the component help(dcc.component-name).

In [11]:
help(dcc.Dropdown)
Help on class Dropdown in module dash_core_components.Dropdown:

class Dropdown(dash.development.base_component.Component)
 |  Dropdown(id=undefined, options=undefined, value=undefined, optionHeight=undefined, className=undefined, clearable=undefined, disabled=undefined, multi=undefined, placeholder=undefined, searchable=undefined, search_value=undefined, style=undefined, loading_state=undefined, persistence=undefined, persisted_props=undefined, persistence_type=undefined, **kwargs)
 |  
 |  A Dropdown component.
 |  Dropdown is an interactive dropdown element for selecting one or more
 |  items.
 |  The values and labels of the dropdown items are specified in the `options`
 |  property and the selected item(s) are specified with the `value` property.
 |  
 |  Use a dropdown when you have many options (more than 5) or when you are
 |  constrained for space. Otherwise, you can use RadioItems or a Checklist,
 |  which have the benefit of showing the users all of the items at once.
 |  
 |  Keyword arguments:
 |  
 |  - id (string; optional):
 |      The ID of this component, used to identify dash components in
 |      callbacks. The ID needs to be unique across all of the components
 |      in an app.
 |  
 |  - className (string; optional):
 |      className of the dropdown element.
 |  
 |  - clearable (boolean; default True):
 |      Whether or not the dropdown is "clearable", that is, whether or
 |      not a small "x" appears on the right of the dropdown that
 |      removes the selected value.
 |  
 |  - disabled (boolean; default False):
 |      If True, this dropdown is disabled and the selection cannot be
 |      changed.
 |  
 |  - loading_state (dict; optional):
 |      Object that holds the loading state object coming from
 |      dash-renderer.
 |  
 |      `loading_state` is a dict with keys:
 |  
 |      - component_name (string; optional):
 |          Holds the name of the component that is loading.
 |  
 |      - is_loading (boolean; optional):
 |          Determines if the component is loading or not.
 |  
 |      - prop_name (string; optional):
 |          Holds which property is loading.
 |  
 |  - multi (boolean; default False):
 |      If True, the user can select multiple values.
 |  
 |  - optionHeight (number; default 35):
 |      height of each option. Can be increased when label lengths would
 |      wrap around.
 |  
 |  - options (list of dicts; optional):
 |      An array of options {label: [string|number], value:
 |      [string|number]}, an optional disabled field can be used for each
 |      option.
 |  
 |      `options` is a list of dicts with keys:
 |  
 |      - disabled (boolean; optional):
 |          If True, this option is disabled and cannot be selected.
 |  
 |      - label (string | number; required):
 |          The dropdown's label.
 |  
 |      - title (string; optional):
 |          The HTML 'title' attribute for the option. Allows for
 |          information on hover. For more information on this attribute,
 |          see
 |          https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title.
 |  
 |      - value (string | number; required):
 |          The value of the dropdown. This value corresponds to the items
 |          specified in the `value` property.
 |  
 |  - persisted_props (list of a value equal to: 'value's; default ['value']):
 |      Properties whose user interactions will persist after refreshing
 |      the component or the page. Since only `value` is allowed this prop
 |      can normally be ignored.
 |  
 |  - persistence (boolean | string | number; optional):
 |      Used to allow user interactions in this component to be persisted
 |      when the component - or the page - is refreshed. If `persisted` is
 |      truthy and hasn't changed from its previous value, a `value` that
 |      the user has changed while using the app will keep that change, as
 |      long as the new `value` also matches what was given originally.
 |      Used in conjunction with `persistence_type`.
 |  
 |  - persistence_type (a value equal to: 'local', 'session', 'memory'; default 'local'):
 |      Where persisted user changes will be stored: memory: only kept in
 |      memory, reset on page refresh. local: window.localStorage, data is
 |      kept after the browser quit. session: window.sessionStorage, data
 |      is cleared once the browser quit.
 |  
 |  - placeholder (string; optional):
 |      The grey, default text shown when no option is selected.
 |  
 |  - search_value (string; optional):
 |      The value typed in the DropDown for searching.
 |  
 |  - searchable (boolean; default True):
 |      Whether to enable the searching feature or not.
 |  
 |  - style (dict; optional):
 |      Defines CSS styles which will override styles previously set.
 |  
 |  - value (string | number | list of string | numbers; optional):
 |      The value of the input. If `multi` is False (the default) then
 |      value is just a string that corresponds to the values provided in
 |      the `options` property. If `multi` is True, then multiple values
 |      can be selected at once, and `value` is an array of items with
 |      values corresponding to those in the `options` prop.
 |  
 |  Method resolution order:
 |      Dropdown
 |      dash.development.base_component.Component
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  __init__ = wrapper(self, id=undefined, options=undefined, value=undefined, optionHeight=undefined, className=undefined, clearable=undefined, disabled=undefined, multi=undefined, placeholder=undefined, searchable=undefined, search_value=undefined, style=undefined, loading_state=undefined, persistence=undefined, persisted_props=undefined, persistence_type=undefined, **kwargs)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  __abstractmethods__ = frozenset()
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from dash.development.base_component.Component:
 |  
 |  __delitem__(self, id)
 |      Delete items by ID in the tree of children.
 |  
 |  __getitem__(self, id)
 |      Recursively find the element with the given ID through the tree of
 |      children.
 |  
 |  __iter__(self)
 |      Yield IDs in the tree of children.
 |  
 |  __len__(self)
 |      Return the number of items in the tree.
 |  
 |  __repr__(self)
 |      Return repr(self).
 |  
 |  __setitem__(self, id, item)
 |      Set an element by its ID.
 |  
 |  to_plotly_json(self)
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from dash.development.base_component.Component:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from dash.development.base_component.Component:
 |  
 |  REQUIRED = required
 |  
 |  UNDEFINED = undefined

In [12]:
help(dcc.Graph)
Help on class Graph in module dash_core_components.Graph:

class Graph(dash.development.base_component.Component)
 |  Graph(id=undefined, responsive=undefined, clickData=undefined, clickAnnotationData=undefined, hoverData=undefined, clear_on_unhover=undefined, selectedData=undefined, relayoutData=undefined, extendData=undefined, prependData=undefined, restyleData=undefined, figure=undefined, style=undefined, className=undefined, animate=undefined, animation_options=undefined, config=undefined, loading_state=undefined, **kwargs)
 |  
 |  A Graph component.
 |  Graph can be used to render any plotly.js-powered data visualization.
 |  
 |  You can define callbacks based on user interaction with Graphs such as
 |  hovering, clicking or selecting
 |  
 |  Keyword arguments:
 |  
 |  - id (string; optional):
 |      The ID of this component, used to identify dash components in
 |      callbacks. The ID needs to be unique across all of the components
 |      in an app.
 |  
 |  - animate (boolean; default False):
 |      Beta: If True, animate between updates using plotly.js's `animate`
 |      function.
 |  
 |  - animation_options (dict; default {    frame: {        redraw: False,    },    transition: {        duration: 750,        ease: 'cubic-in-out',    },}):
 |      Beta: Object containing animation settings. Only applies if
 |      `animate` is `True`.
 |  
 |  - className (string; optional):
 |      className of the parent div.
 |  
 |  - clear_on_unhover (boolean; default False):
 |      If True, `clear_on_unhover` will clear the `hoverData` property
 |      when the user "unhovers" from a point. If False, then the
 |      `hoverData` property will be equal to the data from the last point
 |      that was hovered over.
 |  
 |  - clickAnnotationData (dict; optional):
 |      Data from latest click annotation event. Read-only.
 |  
 |  - clickData (dict; optional):
 |      Data from latest click event. Read-only.
 |  
 |  - config (dict; optional):
 |      Plotly.js config options. See
 |      https://plotly.com/javascript/configuration-options/ for more
 |      info.
 |  
 |      `config` is a dict with keys:
 |  
 |      - autosizable (boolean; optional):
 |          DO autosize once regardless of layout.autosize (use default
 |          width or height values otherwise).
 |  
 |      - displayModeBar (a value equal to: true, false, 'hover'; optional):
 |          Display the mode bar (True, False, or 'hover').
 |  
 |      - displaylogo (boolean; optional):
 |          Add the plotly logo on the end of the mode bar.
 |  
 |      - doubleClick (a value equal to: false, 'reset', 'autosize', 'reset+autosize'; optional):
 |          Double click interaction (False, 'reset', 'autosize' or
 |          'reset+autosize').
 |  
 |      - doubleClickDelay (number; optional):
 |          Delay for registering a double-click event in ms. The minimum
 |          value is 100 and the maximum value is 1000. By default this is
 |          300.
 |  
 |      - editable (boolean; optional):
 |          We can edit titles, move annotations, etc - sets all pieces of
 |          `edits` unless a separate `edits` config item overrides
 |          individual parts.
 |  
 |      - edits (dict; optional):
 |          A set of editable properties.
 |  
 |          `edits` is a dict with keys:
 |  
 |          - annotationPosition (boolean; optional):
 |              The main anchor of the annotation, which is the text (if
 |              no arrow) or the arrow (which drags the whole thing
 |              leaving the arrow length & direction unchanged).
 |  
 |          - annotationTail (boolean; optional):
 |              Just for annotations with arrows, change the length and
 |              direction of the arrow.
 |  
 |          - annotationText (boolean; optional)
 |  
 |          - axisTitleText (boolean; optional)
 |  
 |          - colorbarPosition (boolean; optional)
 |  
 |          - colorbarTitleText (boolean; optional)
 |  
 |          - legendPosition (boolean; optional)
 |  
 |          - legendText (boolean; optional):
 |              Edit the trace name fields from the legend.
 |  
 |          - shapePosition (boolean; optional)
 |  
 |          - titleText (boolean; optional):
 |              The global `layout.title`.
 |  
 |      - fillFrame (boolean; optional):
 |          If we DO autosize, do we fill the container or the screen?.
 |  
 |      - frameMargins (number; optional):
 |          If we DO autosize, set the frame margins in percents of plot
 |          size.
 |  
 |      - linkText (string; optional):
 |          Text appearing in the sendData link.
 |  
 |      - locale (string; optional):
 |          The locale to use. Locales may be provided with the plot
 |          (`locales` below) or by loading them on the page, see:
 |          https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization.
 |  
 |      - locales (dict; optional):
 |          Localization definitions, if you choose to provide them with
 |          the plot rather than registering them globally.
 |  
 |      - mapboxAccessToken (boolean | number | string | dict | list; optional):
 |          Mapbox access token (required to plot mapbox trace types) If
 |          using an Mapbox Atlas server, set this option to '', so that
 |          plotly.js won't attempt to authenticate to the public Mapbox
 |          server.
 |  
 |      - modeBarButtons (boolean | number | string | dict | list; optional):
 |          Fully custom mode bar buttons as nested array, where the outer
 |          arrays represents button groups, and the inner arrays have
 |          buttons config objects or names of default buttons.
 |  
 |      - modeBarButtonsToAdd (list; optional):
 |          Add mode bar button using config objects.
 |  
 |      - modeBarButtonsToRemove (list; optional):
 |          Remove mode bar button by name. All modebar button names at
 |          https://github.com/plotly/plotly.js/blob/master/src/components/modebar/buttons.js
 |          Common names include: sendDataToCloud; (2D) zoom2d, pan2d,
 |          select2d, lasso2d, zoomIn2d, zoomOut2d, autoScale2d,
 |          resetScale2d; (Cartesian) hoverClosestCartesian,
 |          hoverCompareCartesian; (3D) zoom3d, pan3d, orbitRotation,
 |          tableRotation, handleDrag3d, resetCameraDefault3d,
 |          resetCameraLastSave3d, hoverClosest3d; (Geo) zoomInGeo,
 |          zoomOutGeo, resetGeo, hoverClosestGeo; hoverClosestGl2d,
 |          hoverClosestPie, toggleHover, resetViews.
 |  
 |      - plotGlPixelRatio (number; optional):
 |          Increase the pixel ratio for Gl plot images.
 |  
 |      - plotlyServerURL (string; optional):
 |          Base URL for a Plotly cloud instance, if `showSendToCloud` is
 |          enabled.
 |  
 |      - queueLength (number; optional):
 |          Set the length of the undo/redo queue.
 |  
 |      - responsive (boolean; optional):
 |          Whether to change layout size when the window size changes.
 |  
 |      - scrollZoom (boolean; optional):
 |          Mousewheel or two-finger scroll zooms the plot.
 |  
 |      - sendData (boolean; optional):
 |          If we show a link, does it contain data or just link to a
 |          plotly file?.
 |  
 |      - showAxisDragHandles (boolean; optional):
 |          Enable axis pan/zoom drag handles.
 |  
 |      - showAxisRangeEntryBoxes (boolean; optional):
 |          Enable direct range entry at the pan/zoom drag points (drag
 |          handles must be enabled above).
 |  
 |      - showEditInChartStudio (boolean; optional):
 |          Should we show a modebar button to send this data to a Plotly
 |          Chart Studio plot. If both this and showSendToCloud are
 |          selected, only showEditInChartStudio will be honored. By
 |          default this is False.
 |  
 |      - showLink (boolean; optional):
 |          Link to open this plot in plotly.
 |  
 |      - showSendToCloud (boolean; optional):
 |          Should we include a modebar button to send this data to a
 |          Plotly Cloud instance, linked by `plotlyServerURL`. By default
 |          this is False.
 |  
 |      - showTips (boolean; optional):
 |          New users see some hints about interactivity.
 |  
 |      - staticPlot (boolean; optional):
 |          No interactivity, for export or image generation.
 |  
 |      - toImageButtonOptions (dict; optional):
 |          Modifications to how the toImage modebar button works.
 |  
 |          `toImageButtonOptions` is a dict with keys:
 |  
 |          - filename (string; optional):
 |              The name given to the downloaded file.
 |  
 |          - format (a value equal to: 'jpeg', 'png', 'webp', 'svg'; optional):
 |              The file format to create.
 |  
 |          - height (number; optional):
 |              Height of the downloaded file, in px.
 |  
 |          - scale (number; optional):
 |              Extra resolution to give the file after rendering it with
 |              the given width and height.
 |  
 |          - width (number; optional):
 |              Width of the downloaded file, in px.
 |  
 |      - topojsonURL (string; optional):
 |          URL to topojson files used in geo charts.
 |  
 |      - watermark (boolean; optional):
 |          Add the plotly logo even with no modebar.
 |  
 |  - extendData (list | dict; optional):
 |      Data that should be appended to existing traces. Has the form
 |      `[updateData, traceIndices, maxPoints]`, where `updateData` is an
 |      object containing the data to extend, `traceIndices` (optional) is
 |      an array of trace indices that should be extended, and `maxPoints`
 |      (optional) is either an integer defining the maximum number of
 |      points allowed or an object with key:value pairs matching
 |      `updateData` Reference the Plotly.extendTraces API for full usage:
 |      https://plotly.com/javascript/plotlyjs-function-reference/#plotlyextendtraces.
 |  
 |  - figure (dict; default {    data: [],    layout: {},    frames: [],}):
 |      Plotly `figure` object. See schema:
 |      https://plotly.com/javascript/reference  `config` is set
 |      separately by the `config` property.
 |  
 |      `figure` is a dict with keys:
 |  
 |      - data (list of dicts; optional)
 |  
 |      - frames (list of dicts; optional)
 |  
 |      - layout (dict; optional)
 |  
 |  - hoverData (dict; optional):
 |      Data from latest hover event. Read-only.
 |  
 |  - loading_state (dict; optional):
 |      Object that holds the loading state object coming from
 |      dash-renderer.
 |  
 |      `loading_state` is a dict with keys:
 |  
 |      - component_name (string; optional):
 |          Holds the name of the component that is loading.
 |  
 |      - is_loading (boolean; optional):
 |          Determines if the component is loading or not.
 |  
 |      - prop_name (string; optional):
 |          Holds which property is loading.
 |  
 |  - prependData (list | dict; optional):
 |      Data that should be prepended to existing traces. Has the form
 |      `[updateData, traceIndices, maxPoints]`, where `updateData` is an
 |      object containing the data to prepend, `traceIndices` (optional)
 |      is an array of trace indices that should be prepended, and
 |      `maxPoints` (optional) is either an integer defining the maximum
 |      number of points allowed or an object with key:value pairs
 |      matching `updateData` Reference the Plotly.prependTraces API for
 |      full usage:
 |      https://plotly.com/javascript/plotlyjs-function-reference/#plotlyprependtraces.
 |  
 |  - relayoutData (dict; optional):
 |      Data from latest relayout event which occurs when the user zooms
 |      or pans on the plot or other layout-level edits. Has the form
 |      `{<attr string>: <value>}` describing the changes made. Read-only.
 |  
 |  - responsive (a value equal to: true, false, 'auto'; default 'auto'):
 |      If True, the Plotly.js plot will be fully responsive to window
 |      resize and parent element resize event. This is achieved by
 |      overriding `config.responsive` to True, `figure.layout.autosize`
 |      to True and unsetting `figure.layout.height` and
 |      `figure.layout.width`. If False, the Plotly.js plot not be
 |      responsive to window resize and parent element resize event. This
 |      is achieved by overriding `config.responsive` to False and
 |      `figure.layout.autosize` to False. If 'auto' (default), the Graph
 |      will determine if the Plotly.js plot can be made fully responsive
 |      (True) or not (False) based on the values in `config.responsive`,
 |      `figure.layout.autosize`, `figure.layout.height`,
 |      `figure.layout.width`. This is the legacy behavior of the Graph
 |      component.  Needs to be combined with appropriate dimension /
 |      styling through the `style` prop to fully take effect.
 |  
 |  - restyleData (list; optional):
 |      Data from latest restyle event which occurs when the user toggles
 |      a legend item, changes parcoords selections, or other trace-level
 |      edits. Has the form `[edits, indices]`, where `edits` is an object
 |      `{<attr string>: <value>}` describing the changes made, and
 |      `indices` is an array of trace indices that were edited.
 |      Read-only.
 |  
 |  - selectedData (dict; optional):
 |      Data from latest select event. Read-only.
 |  
 |  - style (dict; optional):
 |      Generic style overrides on the plot div.
 |  
 |  Method resolution order:
 |      Graph
 |      dash.development.base_component.Component
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  __init__ = wrapper(self, id=undefined, responsive=undefined, clickData=undefined, clickAnnotationData=undefined, hoverData=undefined, clear_on_unhover=undefined, selectedData=undefined, relayoutData=undefined, extendData=undefined, prependData=undefined, restyleData=undefined, figure=undefined, style=undefined, className=undefined, animate=undefined, animation_options=undefined, config=undefined, loading_state=undefined, **kwargs)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |  
 |  __abstractmethods__ = frozenset()
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from dash.development.base_component.Component:
 |  
 |  __delitem__(self, id)
 |      Delete items by ID in the tree of children.
 |  
 |  __getitem__(self, id)
 |      Recursively find the element with the given ID through the tree of
 |      children.
 |  
 |  __iter__(self)
 |      Yield IDs in the tree of children.
 |  
 |  __len__(self)
 |      Return the number of items in the tree.
 |  
 |  __repr__(self)
 |      Return repr(self).
 |  
 |  __setitem__(self, id, item)
 |      Set an element by its ID.
 |  
 |  to_plotly_json(self)
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from dash.development.base_component.Component:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
 |  
 |  ----------------------------------------------------------------------
 |  Data and other attributes inherited from dash.development.base_component.Component:
 |  
 |  REQUIRED = required
 |  
 |  UNDEFINED = undefined

In [ ]: