You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,33 @@ For use in containers bound to annotations e.g. as children of `<AnnotationAccor
145
145
*`connectShapeToLayout( Container )`: returns a wrapped container component that can be bound to a shape such that its children are bound to that shape's figure entry under the `layout.shapes` key, e.g. the `<Fold>`s in `<ShapeAccordion />` above.
146
146
*`connectImagesToLayout( Container )`: returns a wrapped container component that can be bound to an image such that its children are bound to that image's figure entry under the `layout.image` key, e.g. the `<Fold>`s in `<ImageAccordion />` above.
147
147
148
+
### Action History
149
+
150
+
You can show/hide undo/redo buttons via `showUndoRedo` prop of `<PlotlyEditor />`.
151
+
152
+
You can trigger undo/redo actions programmatically by passing a ref to `PlotlyEditor` or `EditorControls` and calling `undo` or `redo` methods on the ref. E.g.:
153
+
154
+
```javascript
155
+
constrceRef=useRef(null);
156
+
...
157
+
<EditModeController
158
+
ref={rceRef}
159
+
...
160
+
/>
161
+
...
162
+
rceRef.current.undo()
163
+
```
164
+
165
+
Use `onAddToUndo` and `onAddToRedo` hooks to trigger events when an action is added to undo or redo history in the `<PlotlyEditor />` component.
166
+
167
+
```javascript
168
+
<PlotlyEditor
169
+
...
170
+
onAddToUndo={() => { console.log('action added to undo') }}
171
+
onAddToRedo={() => { console.log('action added to redo') }}
172
+
/>
173
+
```
174
+
148
175
## Mapbox Access Tokens
149
176
150
177
To use Satellite Maps in the Editor, [Mapbox access tokens](https://www.mapbox.com/help/how-access-tokens-work/) are required.
0 commit comments