diff --git a/docs/visual-editor/setup.md b/docs/visual-editor/setup.md
index 63ad0930..c67d5315 100644
--- a/docs/visual-editor/setup.md
+++ b/docs/visual-editor/setup.md
@@ -85,6 +85,10 @@ Settings can be changed by accessing the `settings` property of the view model r
| nodes.reverseY | boolean | false |
| contextMenu.enabled | boolean | true |
| contextMenu.additionalItems | ContextMenuItem[] | [] |
+| zoomToFit.paddingLeft | number | 300 |
+| zoomToFit.paddingRight | number | 50 |
+| zoomToFit.paddingTop | number | 110 |
+| zoomToFit.paddingBottom | number | 50 |
For example, to enable displaying the value of a node interface on hover:
diff --git a/packages/renderer-vue/playground/App.vue b/packages/renderer-vue/playground/App.vue
index a9f70f0b..35033a9e 100644
--- a/packages/renderer-vue/playground/App.vue
+++ b/packages/renderer-vue/playground/App.vue
@@ -15,6 +15,7 @@
+
@@ -154,6 +155,16 @@ const changeSidebarWidth = () => {
const clearHistory = () => {
baklavaView.commandHandler.executeCommand(Commands.CLEAR_HISTORY_COMMAND);
};
+
+const zoomToFitRandomNode = () => {
+ if (baklavaView.displayedGraph.nodes.length === 0) {
+ return;
+ }
+
+ const nodes = baklavaView.displayedGraph.nodes;
+ const node = nodes[Math.floor(Math.random() * nodes.length)];
+ baklavaView.commandHandler.executeCommand(Commands.ZOOM_TO_FIT_NODES_COMMAND, true, [node]);
+}