Title: [250523] trunk/Tools
Revision
250523
Author
zhifei_f...@apple.com
Date
2019-09-30 12:36:26 -0700 (Mon, 30 Sep 2019)

Log Message

[results.webkit.org Timeline] New axis style
https://bugs.webkit.org/show_bug.cgi?id=202292

Reviewed by Jonathan Bedard.

* resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (250522 => 250523)


--- trunk/Tools/ChangeLog	2019-09-30 19:10:57 UTC (rev 250522)
+++ trunk/Tools/ChangeLog	2019-09-30 19:36:26 UTC (rev 250523)
@@ -1,3 +1,12 @@
+2019-09-30  Zhifei Fang  <zhifei_f...@apple.com>
+
+        [results.webkit.org Timeline] New axis style
+        https://bugs.webkit.org/show_bug.cgi?id=202292
+
+        Reviewed by Jonathan Bedard.
+
+        * resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js:
+
 2019-09-30  Alex Christensen  <achristen...@webkit.org>
 
         Move DownloadMonitor test speed multiplier from WebProcessPool to WebsiteDataStoreConfiguration

Modified: trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js (250522 => 250523)


--- trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js	2019-09-30 19:10:57 UTC (rev 250522)
+++ trunk/Tools/resultsdbpy/resultsdbpy/view/static/library/js/components/TimelineComponents.js	2019-09-30 19:36:26 UTC (rev 250523)
@@ -623,6 +623,8 @@
     const scaleWidth = parseInt(computedStyle.getPropertyValue('--smallSize')) + parseInt(computedStyle.getPropertyValue('--tinySize'));
     const scaleTagLineHeight = parseInt(computedStyle.getPropertyValue('--smallSize'));
     const scaleTagLinePadding = 10;
+    const scaleGroupTagLinePadding = 3;
+    const scaleGroupMargin = fontSizeNumber / 2;
     const scaleBroadLineHeight = parseInt(computedStyle.getPropertyValue('--tinySize')) / 2;
     const maxinumTextHeight = scaleWidth * 4.5;
     const canvasHeight = typeof option.height === "number" ? option.height : parseInt(computedStyle.getPropertyValue('--smallSize')) * 5;
@@ -637,6 +639,7 @@
         const baseLineY = isTop ? y + canvasHeight - scaleBroadLineHeight : y + scaleBroadLineHeight;
         const middlePointX = x + totalWidth / 2;
         if (group > 1) {
+            const groupBaselineY = isTop ? baseLineY - scaleBroadLineHeight : baseLineY + scaleBroadLineHeight;
             colorBatchRender.lazyCreateColorSeqs(usedGroupColor, (context) => {
                 context.beginPath();
             }, (context, color) => {
@@ -645,20 +648,20 @@
                 context.stroke();
             });
             colorBatchRender.addSeq(usedGroupColor, (context) => {
-                context.moveTo(x + context.lineWidth, isTop ? canvasHeight : y);
-                context.lineTo(x + context.lineWidth, baseLineY);
-                context.moveTo(x, baseLineY);
-                context.lineTo(x + totalWidth, baseLineY);
-                context.moveTo(x + totalWidth, isTop ? canvasHeight : y);
-                context.lineTo(x + totalWidth, baseLineY);
-                context.moveTo(middlePointX, baseLineY);
+                context.moveTo(x + scaleGroupMargin, groupBaselineY);
+                context.lineTo(x + scaleGroupMargin, baseLineY);
+                context.moveTo(x + scaleGroupMargin, groupBaselineY);
+                context.lineTo(x + totalWidth - scaleGroupMargin, groupBaselineY);
+                context.moveTo(x + totalWidth - scaleGroupMargin, groupBaselineY);
+                context.lineTo(x + totalWidth - scaleGroupMargin, baseLineY);
+                context.moveTo(middlePointX, groupBaselineY);
                 if (!isTop)
-                    context.lineTo(middlePointX, baseLineY + scaleTagLineHeight - scaleTagLinePadding);
+                    context.lineTo(middlePointX, groupBaselineY + scaleTagLineHeight - scaleTagLinePadding - scaleGroupTagLinePadding);
                 else
-                    context.lineTo(middlePointX, baseLineY - scaleTagLineHeight + scaleTagLinePadding);
+                    context.lineTo(middlePointX, groupBaselineY - scaleTagLineHeight + scaleTagLinePadding + scaleGroupTagLinePadding);
             });
         } else {
-            colorBatchRender.lazyCreateColorSeqs(usedLineColor, (context) => {
+            colorBatchRender.lazyCreateColorSeqs(usedGroupColor, (context) => {
                 context.beginPath();
             }, (context, color) => {
                 context.lineWidth = 1;
@@ -665,7 +668,7 @@
                 context.strokeStyle = color;
                 context.stroke();
             });
-            colorBatchRender.addSeq(usedLineColor, (context) => {
+            colorBatchRender.addSeq(usedGroupColor, (context) => {
                 context.moveTo(middlePointX, baseLineY);
                 if (!isTop)
                     context.lineTo(middlePointX, baseLineY + scaleTagLineHeight - scaleTagLinePadding);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to