@@ -36,8 +36,17 @@ export type AxisName = XAxisName | YAxisName;
3636// ---------------------------------------------------------------------------
3737
3838/**
39- * Names of built-in mode-bar buttons. Used by `config.modeBarButtonsToAdd`
40- * and `config.modeBarButtonsToRemove` to reference Plotly's defaults.
39+ * Identifiers for Plotly's built-in mode-bar buttons. Which of these a config
40+ * option accepts differs:
41+ *
42+ * - `config.modeBarButtonsToRemove` — any identifier below. Removal matches
43+ * case-insensitively against each default button's `name` and its category.
44+ * - `config.modeBarButtons` — the button's registry key, resolved against
45+ * Plotly's button table; an unknown key throws.
46+ * - `config.modeBarButtonsToAdd` — as a *string*, only the shape-drawing
47+ * buttons (`drawline` … `eraseshape`) and the category aliases at the end of
48+ * this union. Any other button has to be added as a `ModeBarButton` object;
49+ * passing its name as a string does not resolve to the built-in button.
4150 */
4251export type ModeBarDefaultButtons =
4352 // Cartesian
@@ -64,8 +73,10 @@ export type ModeBarDefaultButtons =
6473 | 'zoomInMap'
6574 | 'zoomOutMap'
6675 | 'resetViewMap'
67- // Sankey
76+ // Sankey. `resetViewSankey` is the button's object key (for `config.modeBarButtons`
77+ // custom groups); `resetSankeyGroup` is its `name` (for `modeBarButtonsToRemove`).
6878 | 'resetViewSankey'
79+ | 'resetSankeyGroup'
6980 // Hover
7081 | 'hoverClosestCartesian'
7182 | 'hoverCompareCartesian'
@@ -92,8 +103,7 @@ export type ModeBarDefaultButtons =
92103 | 'hoverclosest'
93104 | 'hovercompare'
94105 | 'togglehover'
95- | 'togglespikelines'
96- | 'resetSankeyGroup' ;
106+ | 'togglespikelines' ;
97107
98108/** Click handler signature for custom mode-bar buttons. */
99109export type ButtonClickEvent = ( gd : PlotlyHTMLElement , ev : MouseEvent ) => void ;
0 commit comments