From 7be530aad24c2e54ef9948bacb18967b4c7f9737 Mon Sep 17 00:00:00 2001 From: Laraib Butt Date: Mon, 30 Nov 2026 23:40:58 +0500 Subject: [PATCH 1/2] docs: document editable chart properties Add a page listing graph properties editable when config editable is True, with one example figure, and link it from Configuration Options (plotly/plotly.py#4635). --- doc/python/configuration-options.md | 5 + doc/python/editable.md | 163 ++++++++++++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 doc/python/editable.md diff --git a/doc/python/configuration-options.md b/doc/python/configuration-options.md index 2c74630c6e..5b208e36f5 100644 --- a/doc/python/configuration-options.md +++ b/doc/python/configuration-options.md @@ -44,6 +44,11 @@ If you don't set an option's value, it will automatically be set to the default For the complete list of configuration options and their defaults see: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js +To let viewers edit titles, annotations, shapes, the legend, and related layout +fields on the chart itself, set `editable` to `True` in the figure config. See +[Editable Charts](/python/editable/) for the full list of properties that +mode enables. + ### Enabling Scroll Zoom This option allows users to zoom in and out of figures using the scroll wheel on their mouse and/or a two-finger scroll. diff --git a/doc/python/editable.md b/doc/python/editable.md new file mode 100644 index 0000000000..763ae16840 --- /dev/null +++ b/doc/python/editable.md @@ -0,0 +1,163 @@ +--- +jupyter: + jupytext: + notebook_metadata_filter: all + text_representation: + extension: .md + format_name: markdown + format_version: '1.3' + jupytext_version: 1.16.4 + kernelspec: + display_name: Python 3 (ipykernel) + language: python + name: python3 + language_info: + codemirror_mode: + name: ipython + version: 3 + file_extension: .py + mimetype: text/x-python + name: python + nbconvert_exporter: python + pygments_lexer: ipython3 + version: 3.9.19 + plotly: + description: Which graph properties you can edit interactively when editable + is True in the figure config. + display_as: file_settings + language: python + layout: base + name: Editable Charts + order: 11.5 + page_type: u-guide + permalink: python/editable/ + thumbnail: thumbnail/modebar-icons.png +--- + +## Editable Charts + +Set `editable` to `True` in the figure `config` to let viewers change some layout +properties directly on the chart (click text to edit it, drag to move or resize +items, and so on). This page lists those properties and shows them on one +example figure. + +For other configuration keys, see [Configuration Options](/python/configuration-options/). + +### Enable Editable Mode + +Pass `config=dict(editable=True)` to `fig.show()`. In Dash, pass the same +dictionary to the `config` prop of `dcc.Graph`. + +```python +import plotly.graph_objects as go + +fig = go.Figure() +fig.add_trace( + go.Scatter( + x=[1, 2, 3, 4], + y=[10, 15, 13, 17], + mode="markers+lines", + name="Series A", + marker=dict( + size=12, + color=[1, 2, 3, 4], + colorscale="Viridis", + showscale=True, + colorbar=dict(title="Intensity"), + ), + ) +) +fig.add_trace( + go.Scatter( + x=[1, 2, 3, 4], + y=[16, 5, 11, 9], + mode="lines", + name="Series B", + ) +) +fig.add_shape( + type="rect", + x0=1.5, + x1=2.5, + y0=8, + y1=14, + line=dict(color="RoyalBlue"), + fillcolor="LightSkyBlue", + opacity=0.4, +) +fig.add_annotation( + x=3.2, + y=17, + text="Click annotation text
or drag to move", + showarrow=True, + arrowhead=1, +) +fig.update_layout( + title="Click titles, legend, colorbar, or shape to edit", + xaxis_title="X Axis Title", + yaxis_title="Y Axis Title", + legend_title_text="Legend", +) + +config = { + "editable": True, + # Optional: add / erase shapes from the modebar + "modeBarButtonsToAdd": [ + "drawline", + "drawopenpath", + "drawclosedpath", + "drawcircle", + "drawrect", + "eraseshape", + ], +} + +fig.show(config=config) +``` + +Try the interactions below on the figure above: + +- Click the **chart title**, **axis titles**, **legend entry names**, **annotation + text**, or **colorbar title** to edit the text +- Click axis-range endpoints to edit the **axis min / max** +- Drag the **legend** or **colorbar** to move them +- Drag the **annotation** text or arrowhead to reposition it +- Drag the **shape** edges to resize it, or its interior to move it +- Use the shape-drawing / erase buttons on the modebar to **add or remove shapes** + +### Editable Properties + +When `config["editable"]` is `True`, these graph properties can be edited in the +UI: + +| Property | How to edit | +| --- | --- | +| Chart title | Click the title text | +| Axis titles | Click an axis title | +| Axis ranges (min and max) | Click the range endpoints | +| Shape position | Drag edges to resize; drag the center to move | +| Shape addition and removal | Use the shape-drawing and erase modebar buttons (add them with `modeBarButtonsToAdd` as above) | +| Annotation text | Click the annotation text | +| Annotation position | Drag the text or arrowhead | +| Legend trace names | Click a legend item name | +| Legend position | Drag the legend | +| Colorbar title | Click the colorbar title | +| Colorbar position | Drag the colorbar | + +#### Shape polygon vertices + +Dragging individual **polygon vertices** is a special case. Those handles are +available only when: + +- the **individual shape** has `editable=True`, and +- chart-wide `config["editable"]` is `False` + +See [Shapes](/python/shapes/) for examples that set `editable=True` on a shape +itself. + +### Related + +- [Configuration Options](/python/configuration-options/) — other `config` keys such as `scrollZoom` and modebar controls +- [Shapes](/python/shapes/) — drawing shapes and per-shape `editable` +- [Text and Annotations](/python/text-and-annotations/) — annotation layout +- [Legend](/python/legend/) — legend positioning and styling From 6fe381fe0f622eaab481a61dffb71626e04237d0 Mon Sep 17 00:00:00 2001 From: Laraib Butt Date: Tue, 1 Dec 2026 21:15:24 +0500 Subject: [PATCH 2/2] docs: use sequential page order for editable charts page CI requires integer sequential order values in file_settings; place the new editable page after Configuration and renumber following pages. --- doc/python/axes.md | 2 +- doc/python/builtin-colorscales.md | 2 +- doc/python/colorscales.md | 2 +- doc/python/discrete-color.md | 2 +- doc/python/editable.md | 2 +- doc/python/figure-factories.md | 2 +- doc/python/figure-introspection.md | 2 +- doc/python/figure-labels.md | 2 +- doc/python/graph-objects.md | 2 +- doc/python/graphing-multiple-chart-types.md | 2 +- doc/python/horizontal-vertical-shapes.md | 2 +- doc/python/hover-text-and-formatting.md | 2 +- doc/python/images.md | 2 +- doc/python/interactive-html-export.md | 2 +- doc/python/ipython-vs-python.md | 2 +- doc/python/legend.md | 2 +- doc/python/marker-style.md | 2 +- doc/python/multiple-axes.md | 2 +- doc/python/pandas-backend.md | 2 +- doc/python/px-arguments.md | 2 +- doc/python/selections.md | 2 +- doc/python/setting-graph-size.md | 2 +- doc/python/shapes.md | 2 +- doc/python/static-image-generation-migration.md | 2 +- doc/python/styling-plotly-express.md | 2 +- doc/python/subplots.md | 2 +- doc/python/supported-colors.md | 2 +- doc/python/text-and-annotations.md | 2 +- doc/python/tick-formatting.md | 2 +- doc/python/troubleshooting.md | 2 +- doc/python/v4-migration.md | 2 +- doc/python/wide-form.md | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/doc/python/axes.md b/doc/python/axes.md index 9d5f154e10..24a7a87ee3 100644 --- a/doc/python/axes.md +++ b/doc/python/axes.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Axes - order: 15 + order: 16 permalink: python/axes/ thumbnail: thumbnail/axes.png --- diff --git a/doc/python/builtin-colorscales.md b/doc/python/builtin-colorscales.md index 01fc9ec8e1..bb94711d2c 100644 --- a/doc/python/builtin-colorscales.md +++ b/doc/python/builtin-colorscales.md @@ -30,7 +30,7 @@ jupyter: language: python layout: base name: Built-in Continuous Color Scales - order: 29 + order: 30 permalink: python/builtin-colorscales/ thumbnail: thumbnail/heatmap_colorscale.jpg v4upgrade: true diff --git a/doc/python/colorscales.md b/doc/python/colorscales.md index aadef07600..2927a8fd9d 100644 --- a/doc/python/colorscales.md +++ b/doc/python/colorscales.md @@ -30,7 +30,7 @@ jupyter: language: python layout: base name: Continuous Color Scales and Color Bars - order: 22 + order: 23 permalink: python/colorscales/ redirect_from: python/logarithmic-color-scale/ thumbnail: thumbnail/heatmap_colorscale.jpg diff --git a/doc/python/discrete-color.md b/doc/python/discrete-color.md index fd4de49201..7b29dbe766 100644 --- a/doc/python/discrete-color.md +++ b/doc/python/discrete-color.md @@ -30,7 +30,7 @@ jupyter: language: python layout: base name: Discrete Colors - order: 30 + order: 31 permalink: python/discrete-color/ thumbnail: thumbnail/heatmap_colorscale.jpg v4upgrade: true diff --git a/doc/python/editable.md b/doc/python/editable.md index 763ae16840..7108b5cc6b 100644 --- a/doc/python/editable.md +++ b/doc/python/editable.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Editable Charts - order: 11.5 + order: 12 page_type: u-guide permalink: python/editable/ thumbnail: thumbnail/modebar-icons.png diff --git a/doc/python/figure-factories.md b/doc/python/figure-factories.md index 199d6ac98f..fc0317623c 100644 --- a/doc/python/figure-factories.md +++ b/doc/python/figure-factories.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Figure Factories - order: 34 + order: 35 permalink: python/figure-factories/ thumbnail: thumbnail/streamline.jpg --- diff --git a/doc/python/figure-introspection.md b/doc/python/figure-introspection.md index b007fa2e8a..8228f91b2b 100644 --- a/doc/python/figure-introspection.md +++ b/doc/python/figure-introspection.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Introspecting Figures - order: 37 + order: 38 page_type: u-guide permalink: python/figure-introspection/ thumbnail: thumbnail/violin.jpg diff --git a/doc/python/figure-labels.md b/doc/python/figure-labels.md index 1374188910..09cdc3a571 100644 --- a/doc/python/figure-labels.md +++ b/doc/python/figure-labels.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Setting the Font, Title, Legend Entries, and Axis Titles - order: 14 + order: 15 permalink: python/figure-labels/ redirect_from: python/font/ thumbnail: thumbnail/figure-labels.png diff --git a/doc/python/graph-objects.md b/doc/python/graph-objects.md index 92f34fdfb8..9f4b31f177 100644 --- a/doc/python/graph-objects.md +++ b/doc/python/graph-objects.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Graph Objects - order: 36 + order: 37 page_type: u-guide permalink: python/graph-objects/ thumbnail: thumbnail/horizontal-bar.jpg diff --git a/doc/python/graphing-multiple-chart-types.md b/doc/python/graphing-multiple-chart-types.md index a1f7fca1c7..e51a68683a 100644 --- a/doc/python/graphing-multiple-chart-types.md +++ b/doc/python/graphing-multiple-chart-types.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Multiple Chart Types - order: 19 + order: 20 page_type: u-guide permalink: python/graphing-multiple-chart-types/ thumbnail: thumbnail/multiple-chart-type.jpg diff --git a/doc/python/horizontal-vertical-shapes.md b/doc/python/horizontal-vertical-shapes.md index d533904aac..345e24bad2 100644 --- a/doc/python/horizontal-vertical-shapes.md +++ b/doc/python/horizontal-vertical-shapes.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Horizontal and Vertical Lines and Rectangles - order: 38 + order: 39 permalink: python/horizontal-vertical-shapes/ thumbnail: thumbnail/shape.jpg --- diff --git a/doc/python/hover-text-and-formatting.md b/doc/python/hover-text-and-formatting.md index ccfefc85a7..2697b9e4a7 100644 --- a/doc/python/hover-text-and-formatting.md +++ b/doc/python/hover-text-and-formatting.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Hover Text and Formatting - order: 24 + order: 25 permalink: python/hover-text-and-formatting/ thumbnail: thumbnail/hover-text.png --- diff --git a/doc/python/images.md b/doc/python/images.md index 898a65898a..947b25bdcf 100644 --- a/doc/python/images.md +++ b/doc/python/images.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Images - order: 25 + order: 26 permalink: python/images/ thumbnail: thumbnail/images.png v4upgrade: true diff --git a/doc/python/interactive-html-export.md b/doc/python/interactive-html-export.md index 49871e5cb4..9bcf76df97 100644 --- a/doc/python/interactive-html-export.md +++ b/doc/python/interactive-html-export.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Interactive HTML Export - order: 32 + order: 33 page_type: u-guide permalink: python/interactive-html-export/ thumbnail: thumbnail/static-image-export.png diff --git a/doc/python/ipython-vs-python.md b/doc/python/ipython-vs-python.md index 3e630b8201..14d62aa70f 100644 --- a/doc/python/ipython-vs-python.md +++ b/doc/python/ipython-vs-python.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: IPython vs Python - order: 27 + order: 28 permalink: python/ipython-vs-python/ thumbnail: thumbnail/venn.jpg --- diff --git a/doc/python/legend.md b/doc/python/legend.md index d75ce2f5d2..6fbed2ae20 100644 --- a/doc/python/legend.md +++ b/doc/python/legend.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Legends - order: 16 + order: 17 permalink: python/legend/ redirect_from: python/horizontal-legend/ thumbnail: thumbnail/legends.gif diff --git a/doc/python/marker-style.md b/doc/python/marker-style.md index 6a75ccbd48..511b7adb89 100644 --- a/doc/python/marker-style.md +++ b/doc/python/marker-style.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Styling Markers - order: 21 + order: 22 permalink: python/marker-style/ thumbnail: thumbnail/marker-style.gif --- diff --git a/doc/python/multiple-axes.md b/doc/python/multiple-axes.md index 96e2f19b16..c7ce3b9f54 100644 --- a/doc/python/multiple-axes.md +++ b/doc/python/multiple-axes.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Multiple Axes - order: 17 + order: 18 permalink: python/multiple-axes/ thumbnail: thumbnail/multiple-axes.jpg --- diff --git a/doc/python/pandas-backend.md b/doc/python/pandas-backend.md index e3ce5e28a7..e671108d98 100644 --- a/doc/python/pandas-backend.md +++ b/doc/python/pandas-backend.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Pandas Plotting Backend - order: 33 + order: 34 permalink: python/pandas-backend/ redirect_from: python/cufflinks/ thumbnail: thumbnail/plotly-express.png diff --git a/doc/python/px-arguments.md b/doc/python/px-arguments.md index d0346292e5..d797c05aba 100644 --- a/doc/python/px-arguments.md +++ b/doc/python/px-arguments.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Plotly Express Arguments - order: 20 + order: 21 page_type: u-guide permalink: python/px-arguments/ thumbnail: thumbnail/plotly-express.png diff --git a/doc/python/selections.md b/doc/python/selections.md index bc2c96d0d6..cd5a84f259 100644 --- a/doc/python/selections.md +++ b/doc/python/selections.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Selections - order: 39 + order: 40 permalink: python/selections/ thumbnail: thumbnail/ml_apps.png --- diff --git a/doc/python/setting-graph-size.md b/doc/python/setting-graph-size.md index ea28db23fa..3027798e16 100644 --- a/doc/python/setting-graph-size.md +++ b/doc/python/setting-graph-size.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Setting Graph Size - order: 12 + order: 13 permalink: python/setting-graph-size/ thumbnail: thumbnail/sizing.png --- diff --git a/doc/python/shapes.md b/doc/python/shapes.md index 78beaad9a9..787b130d70 100644 --- a/doc/python/shapes.md +++ b/doc/python/shapes.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Shapes - order: 26 + order: 27 permalink: python/shapes/ thumbnail: thumbnail/shape.jpg --- diff --git a/doc/python/static-image-generation-migration.md b/doc/python/static-image-generation-migration.md index 1ce6e8cdbb..256805cc33 100644 --- a/doc/python/static-image-generation-migration.md +++ b/doc/python/static-image-generation-migration.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Static Image Generation Changes in Plotly.py 6.1 - order: 41 + order: 42 page_type: u-guide permalink: python/static-image-generation-changes/ thumbnail: thumbnail/static-image-export.png diff --git a/doc/python/styling-plotly-express.md b/doc/python/styling-plotly-express.md index ab8e62df8e..1903683be5 100644 --- a/doc/python/styling-plotly-express.md +++ b/doc/python/styling-plotly-express.md @@ -29,7 +29,7 @@ jupyter: language: python layout: base name: Styling Plotly Express Figures - order: 31 + order: 32 page_type: u-guide permalink: python/styling-plotly-express/ thumbnail: thumbnail/plotly-express.png diff --git a/doc/python/subplots.md b/doc/python/subplots.md index d63e928ceb..834e64ff86 100644 --- a/doc/python/subplots.md +++ b/doc/python/subplots.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Subplots - order: 18 + order: 19 page_type: u-guide permalink: python/subplots/ redirect_from: ipython-notebooks/subplots/ diff --git a/doc/python/supported-colors.md b/doc/python/supported-colors.md index eb362c8bbb..5136bc5883 100644 --- a/doc/python/supported-colors.md +++ b/doc/python/supported-colors.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Supported CSS Colors - order: 42 + order: 43 page_type: example_index permalink: python/css-colors/ thumbnail: thumbnail/shape.jpg diff --git a/doc/python/text-and-annotations.md b/doc/python/text-and-annotations.md index 5b7992168a..b292331fee 100644 --- a/doc/python/text-and-annotations.md +++ b/doc/python/text-and-annotations.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Text and Annotations - order: 23 + order: 24 permalink: python/text-and-annotations/ thumbnail: thumbnail/text-and-annotations.png --- diff --git a/doc/python/tick-formatting.md b/doc/python/tick-formatting.md index 7c7ce34248..61da2c87d2 100644 --- a/doc/python/tick-formatting.md +++ b/doc/python/tick-formatting.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Formatting Ticks - order: 13 + order: 14 permalink: python/tick-formatting/ thumbnail: thumbnail/tick-formatting.gif --- diff --git a/doc/python/troubleshooting.md b/doc/python/troubleshooting.md index 981b5f9fa7..9c385920da 100644 --- a/doc/python/troubleshooting.md +++ b/doc/python/troubleshooting.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Troubleshooting - order: 28 + order: 29 page_type: u-guide permalink: python/troubleshooting/ thumbnail: thumbnail/modebar-icons.png diff --git a/doc/python/v4-migration.md b/doc/python/v4-migration.md index 1035feb51f..5222e48da5 100644 --- a/doc/python/v4-migration.md +++ b/doc/python/v4-migration.md @@ -27,7 +27,7 @@ jupyter: language: python layout: base name: Version 4 Migration Guide - order: 40 + order: 41 page_type: example_index permalink: python/v4-migration/ thumbnail: thumbnail/v4-migration.png diff --git a/doc/python/wide-form.md b/doc/python/wide-form.md index b48aad418f..a928afda32 100644 --- a/doc/python/wide-form.md +++ b/doc/python/wide-form.md @@ -28,7 +28,7 @@ jupyter: language: python layout: base name: Plotly Express Wide-Form Support - order: 35 + order: 36 page_type: u-guide permalink: python/wide-form/ thumbnail: thumbnail/plotly-express.png