GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • @maxgraph/core

This view

  • Original page
  • New address

GeezerVison is showing maxgraph.github.io — FitPlugin | @maxgraph/core

  • FitPlugin

Class FitPlugin

A plugin providing methods to fit the graph within its container.

Since

0.17.0

Implements

  • GraphPlugin
  • Defined in view/plugin/FitPlugin.ts:87
Index

Constructors

constructor

Properties

maxFitScale minFitScale pluginId

Methods

fit fitCenter onDestroy

Constructors

constructor

  • new FitPlugin(graph: AbstractGraph): FitPlugin

    Constructs the plugin that provides fit methods.

    Parameters

    • graph: AbstractGraph

      Reference to the enclosing AbstractGraph.

    Returns FitPlugin

    • Defined in view/plugin/FitPlugin.ts:108

Properties

maxFitScale

maxFitScale: number | null = 8

Specifies the maximum scale to be applied in fit and fitCenter. Set this to null to allow any value.

Default

8
  • Defined in view/plugin/FitPlugin.ts:101

minFitScale

minFitScale: number | null = 0.1

Specifies the minimum scale to be applied in fit. Set this to null to allow any value.

Default

0.1

Since

0.21.0

  • Defined in view/plugin/FitPlugin.ts:95

Static ReadonlypluginId

pluginId: "fit" = 'fit'
  • Defined in view/plugin/FitPlugin.ts:88

Methods

fit

  • fit(options?: FitOptions): number

    Scales the graph such that the complete diagram fits into Graph.container and returns the current scale in the view. To fit an initial graph prior to rendering, set GraphView.rendering to false prior to changing the model and execute the following after changing the model.

    graph.view.rendering = false;
    // here, change the model
    graph.getPlugin<FitPlugin>('fit')?.fit();
    graph.view.rendering = true;
    graph.refresh();

    To fit and center the graph, use fitCenter.

    Parameters

    • options: FitOptions = {}

      Optional number that specifies the border.

    Returns number

    Since

    0.21.0

    • Defined in view/plugin/FitPlugin.ts:128

fitCenter

  • fitCenter(options?: FitCenterOptions): number

    Fit and center the graph within its container.

    Parameters

    • Optionaloptions: FitCenterOptions

      Optional options to customize the fit behavior.

    Returns number

    The current scale in the view.

    • Defined in view/plugin/FitPlugin.ts:238

onDestroy

  • onDestroy(): void

    Do nothing here.

    Returns void

    Implementation of GraphPlugin.onDestroy

    • Defined in view/plugin/FitPlugin.ts:282

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Constructors
constructor
Properties
maxFitScaleminFitScalepluginId
Methods
fitfitCenteronDestroy
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.