Changeset 248134 in webkit


Ignore:
Timestamp:
Aug 1, 2019 2:45:42 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[results.webkit.org] Timeline.CanvasXAxisComponent height should be defined by option
https://bugs.webkit.org/show_bug.cgi?id=200321

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-08-01
Reviewed by Jonathan Bedard.

*resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
Let the axis' height be defined in the option. Timeine component will use this value as
padding-top for headers which allows headers start in the right position, even with multiple
top axises.
(Timeline.CanvasSeriesComponent):
(prototype.Timeline.CanvasContainer):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r248117 r248134  
     12019-08-01  Zhifei Fang  <zhifei_fang@apple.com>
     2
     3        [results.webkit.org] Timeline.CanvasXAxisComponent height should be defined by option
     4        https://bugs.webkit.org/show_bug.cgi?id=200321
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        *resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
     9        Let the axis' height be defined in the option. Timeine component will use this value as
     10        padding-top for headers which allows headers start in the right position, even with multiple
     11        top axises.
     12        (Timeline.CanvasSeriesComponent):
     13        (prototype.Timeline.CanvasContainer):
     14
    1152019-08-01  Zhifei Fang  <zhifei_fang@apple.com>
    216
  • trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js

    r248117 r248134  
    510510    const scaleBroadLineHeight = parseInt(computedStyle.getPropertyValue('--tinySize')) / 2;
    511511    const maxinumTextHeight = scaleWidth * 4.5;
    512     const canvasHeight = parseInt(computedStyle.getPropertyValue('--smallSize')) * 4;
     512    const canvasHeight = typeof option.height === "number" ? option.height : parseInt(computedStyle.getPropertyValue('--smallSize')) * 5;
    513513    const sqrt3 = Math.sqrt(3);
    514514
     
    733733            </div>`;
    734734        }),
    735         isAxis: true // Mark self as an axis
     735        isAxis: true, // Mark self as an axis,
     736        height: canvasHeight, // Expose Height to parent
    736737    };
    737738}
    738739
    739740Timeline.CanvasContainer = (exporter, ...children) => {
    740     const hasTopXAxis = children[0].isAxis;
     741    let headerAxisPlaceHolderHeight = 0;
     742    let topAxis = true;
    741743    const upackChildren = (children) => {
    742744        const headers = [];
     
    750752                headers.push(child.header);
    751753            serieses.push(child.series);
     754            if (child.isAxis && topAxis)
     755                headerAxisPlaceHolderHeight += child.height;
     756            else if (topAxis)
     757                topAxis = false;
    752758        });
    753759        return {headers, serieses};
     
    764770    return (
    765771        `<div class="timeline">
    766             <div class="header ${hasTopXAxis ? "with-top-x-axis" : ""}">
     772            <div class="header" style="padding-top:${headerAxisPlaceHolderHeight}px">
    767773                ${ListComponent(composer, ...headers)}
    768774            </div>
Note: See TracChangeset for help on using the changeset viewer.