Title: [194234] trunk/Websites/perf.webkit.org
- Revision
- 194234
- Author
- [email protected]
- Date
- 2015-12-17 14:19:52 -0800 (Thu, 17 Dec 2015)
Log Message
Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
https://bugs.webkit.org/show_bug.cgi?id=152389
Reviewed by Darin Adler.
Compute the x coordinate of the popover from the center of each annotation bar.
Also adjust the x coordinate to keep the popover within the charts.
* public/v3/components/interactive-time-series-chart.js:
(InteractiveTimeSeriesChart.prototype._renderChartContent):
Modified Paths
Diff
Modified: trunk/Websites/perf.webkit.org/ChangeLog (194233 => 194234)
--- trunk/Websites/perf.webkit.org/ChangeLog 2015-12-17 22:13:51 UTC (rev 194233)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2015-12-17 22:19:52 UTC (rev 194234)
@@ -1,5 +1,19 @@
2015-12-17 Ryosuke Niwa <[email protected]>
+ Popover for analysis tasks shows up at the left edge of annotation bars in the v3 UI
+ https://bugs.webkit.org/show_bug.cgi?id=152389
+
+ Reviewed by Darin Adler.
+
+ Compute the x coordinate of the popover from the center of each annotation bar.
+
+ Also adjust the x coordinate to keep the popover within the charts.
+
+ * public/v3/components/interactive-time-series-chart.js:
+ (InteractiveTimeSeriesChart.prototype._renderChartContent):
+
+2015-12-17 Ryosuke Niwa <[email protected]>
+
Dashboard charts should have uniform widths on v3 UI
https://bugs.webkit.org/show_bug.cgi?id=152395
Modified: trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js (194233 => 194234)
--- trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js 2015-12-17 22:13:51 UTC (rev 194233)
+++ trunk/Websites/perf.webkit.org/public/v3/components/interactive-time-series-chart.js 2015-12-17 22:19:52 UTC (rev 194234)
@@ -382,9 +382,12 @@
var labelWidth = this._annotationLabel.offsetWidth;
var labelHeight = this._annotationLabel.offsetHeight;
- var x = Math.round(annotation.x - labelWidth / 2);
- var y = Math.floor(annotation.y - labelHeight);
+ var centerX = annotation.x + annotation.width / 2 - labelWidth / 2;
+ var maxX = metrics.chartX + metrics.chartWidth - labelWidth - 2;
+ var x = Math.round(Math.min(maxX, Math.max(metrics.chartX + 2, centerX)));
+ var y = Math.floor(annotation.y - labelHeight - 1);
+
// Use transform: translate to position the label to avoid triggering another browser layout.
this._annotationLabel.style.transform = `translate(${x}px, ${y}px)`;
} else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes