private static setMeasures()

in src/timeLine.ts [426:466]


    private static setMeasures(
        labelsSettings: LabelsSettings,
        granularityType: GranularityType,
        datePeriodsCount: number,
        viewport: powerbiVisualsApi.IViewport,
        timelineProperties: ITimelineProperties,
        timelineMargins: ITimelineMargins,
    ): void {

        timelineProperties.cellsYPosition = timelineProperties.textYPosition;

        const labelSize: number = pixelConverter.fromPointToPixel(labelsSettings.textSize);

        if (labelsSettings.show) {
            const granularityOffset: number = labelsSettings.displayAll ? granularityType + 1 : 1;

            timelineProperties.cellsYPosition += labelSize
                * Timeline.LabelSizeFactor
                * granularityOffset;
        }

        const svgHeight: number = Math.max(0, viewport.height - timelineMargins.TopMargin);

        const height: number = Math.max(timelineMargins.MinCellHeight,
            Math.min(
                timelineMargins.MaxCellHeight,
                svgHeight
                - timelineProperties.cellsYPosition
                - Timeline.TimelinePropertiesHeightOffset
                + (Timeline.TimelineMargins.LegendHeight - timelineProperties.legendHeight),
            ));

        // Height is deducted here to take account of edge cursors width
        // that in fact is half of cell height for each of them
        const width: number = Math.max(
            timelineMargins.MinCellWidth,
            (viewport.width - height - Timeline.ViewportWidthAdjustment) / (datePeriodsCount));

        timelineProperties.cellHeight = height;
        timelineProperties.cellWidth = width;
    }