Options
All
  • Public
  • Public/Protected
  • All
Menu

External module tooltips

Introduction

PiWeb Monitor has a feature we call info mode. While the info mode is active, or while the CTRL key is pressed, the point or geometry that is next to the mouse cursor is highlighted and can be clicked to show a tooltip for the point or geometry. Tooltips usually contain information about the measurement or characteristic that is displayed at this point or region of the plot:

The plot extension API allows you add your own tooltips to a plot:

import * as piweb from 'piweb';

piweb.events.on("render", render);

function render(context: piweb.drawing.DrawingContext) {
        piweb.tooltips.placeTooltip(context, [0,0], new Tooltip("myTooltipText"));

    ...
}

You can also add predefined information for certain entities to a tooltip, which will look exactly like the built in tooltips you find on many plots in PiWeb:

import * as piweb from 'piweb';

piweb.events.on("render", render);

function render(context: piweb.drawing.DrawingContext) {
        const tooltip = new Tooltip();

        tooltip.addMeasurementValueInformations(value);

        piweb.tooltips.placeTooltip(context, [0,0], tooltip );

    ...
}

For more complex geometries than a single point, it's possible to create a highlight geometry with the placeHighlight function of the DrawingContext.

Index

Type aliases

TooltipItem

TooltipItemType

TooltipItemType: "collapsable" | "fixed" | "fallback"

Functions

Private mapItemType

  • mapItemType(tooltipItemType: TooltipItemType): TooltipItemTypeId.Collapsable | TooltipItemTypeId.Fixed | TooltipItemTypeId.Fallback
  • Parameters

    Returns TooltipItemTypeId.Collapsable | TooltipItemTypeId.Fixed | TooltipItemTypeId.Fallback

placeTooltip

Generated using TypeDoc