Options
All
  • Public
  • Public/Protected
  • All
Menu

Module margins

Index

Functions

Const containerDimensionsFrom

  • Calculates the container's dimensions from the plot dimensions and the plot margin. The container dimensions are the plot dimensions plus the margins.

    see

    plotDimensionsFrom

    Parameters

    • plotDimensions: Dimensions

      The (width, height) of the plot

    • plotMargin: Margin

      The margins around the plot

    Returns Dimensions

    The container dimensions.

noMargins

Const plotDimensionsFrom

  • plotDimensionsFrom(containerWidth: number, containerHeight: number, plotMargins: Margin): Dimensions
  • Given the dimensions of the plot (width, height) based on the container's width and height, and the plots margins. Calculates the dimensions of the actual plot by subtracting the margins.

    see

    containerDimensionsFrom

    Parameters

    • containerWidth: number

      The overall width of the container (plot and margins)

    • containerHeight: number

      The overall height of the container (plot and margins)

    • plotMargins: Margin

      The margins around the plot (top, bottom, left, right)

    Returns Dimensions

    The dimensions of the actual plots adjusted for the margins from the overall dimensions

Generated using TypeDoc