Skip to main content Link Menu Expand (external link) Document Search Copy Copied

dimensions()

Return the calendar’s dimension

type Dimensions = {
  width: number,
  height: number,
};

const cal = new CalHeatmap();
cal.dimensions(): Dimensions;

Return

  • An object, with the calendar width and height in pixels.

You can also retrieve the dimension with the resize event.


Usage

Example

const cal = new CalHeatmap();
cal.paint().then(() => {
  // Wait for paint() to complete before retrieving the dimensions
  cal.dimensions(); // { width: 969, height: 142 }
});