Weave.js

Measure

Draw measure reference distance on the canvas

Measure on the Weave.js showcase

The Measure node is a complex node used to render a representation of the the distance between two points on the canvas. It needs:

  • A measure unit, e.g. meters, centimeters, milimeters, or inches.
  • A reference measure. A distance you previously know based on the measure unit.
  • A reference distance. The distance between two points on the canvas that represent the reference measure.

Usage

Import the Node

Start by importing the node:

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

Register the Node

Then register the node on the Weave class instance.

const instance = new Weave({
  ...
  nodes: [
    ...,
    new WeaveMeasureNode(), 
  ]
})

Use the node

Once the node is registered you can use it on Actions or Plugins or even other Nodes.

We provide an action named Measure Tool that allows users to add Measure nodes to the application in a simple way.