Weave.js

WeaveFitToSelectionToolAction

Set the zoom level so all the selected nodes are entirely visible on the screen

Overview

The WeaveFitToSelectionToolAction class that automatically zooms and pans the canvas to fit the currently selected nodes within the visible viewport. It helps users focus on specific elements of their work quickly, especially in large or complex canvases.

This action is the “fit to selection” counterpart of the broader WeaveFitToScreenToolAction, offering precise control and workflow efficiency.

The class extends the WeaveAction class.

Name

This action name property value is fitToSelectionTool.

Import

import { WeaveFitToSelectionToolAction } from "@inditextech/weave-sdk";

Instantiation

new WeaveFitToSelectionToolAction();

TypeScript types

type WeaveFitToScreenToolActionParams = {
  previousAction: string;
};

Trigger function params

trigger(cancelAction: () => void, params?: WeaveFitToSelectionToolActionParams): void;

For WeaveFitToSelectionToolActionParams:

PropTypeDefault
previousAction
string
-