WebKit Bugzilla
Attachment 360500 Details for
Bug 193982
: Web Inspector: Improve API and documentation of ColumnChart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Proposed Fix
cleanup-1.patch (text/plain), 6.27 KB, created by
Joseph Pecoraro
on 2019-01-29 14:11:51 PST
(
hide
)
Description:
[PATCH] Proposed Fix
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2019-01-29 14:11:51 PST
Size:
6.27 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index f6be297ca8b..1abec6fb441 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,32 @@ >+2019-01-29 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Improve API and documentation of ColumnChart >+ https://bugs.webkit.org/show_bug.cgi?id=193982 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This used to be named "BarChart", convert remaining instances >+ of "bar" to "column" and clean up related things. >+ >+ * UserInterface/Views/CPUTimelineOverviewGraph.css: >+ (body[dir=rtl] .timeline-overview-graph.cpu > .column-chart): >+ (.timeline-overview-graph.cpu > .column-chart > svg > rect): >+ (body[dir=rtl] .timeline-overview-graph.cpu > .bar-chart): Deleted. >+ (.timeline-overview-graph.cpu > .bar-chart > svg > rect): Deleted. >+ * UserInterface/Views/CPUTimelineOverviewGraph.js: >+ (WI.CPUTimelineOverviewGraph.prototype.layout): >+ * UserInterface/Views/ColumnChart.js: >+ (WI.ColumnChart): >+ (WI.ColumnChart.prototype.get columns): >+ (WI.ColumnChart.prototype.addColumn): >+ (WI.ColumnChart.prototype.clear): >+ (WI.ColumnChart.prototype.updateLayout): >+ (WI.ColumnChart.prototype.get bars): Deleted. >+ (WI.ColumnChart.prototype.addBar): Deleted. >+ * UserInterface/Views/StackedLineChart.js: >+ (WI.StackedLineChart.prototype.get element): >+ (WI.StackedLineChart.prototype.get points): >+ > 2019-01-28 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Remove unnecessary promise rejection handlers now that we use the global onunhandledrejection handler >diff --git a/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.css b/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.css >index ccde01e074b..c5d14c3f39f 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.css >+++ b/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.css >@@ -67,11 +67,11 @@ body[dir=rtl] .timeline-overview-graph.cpu > .legend { > } > } > >-body[dir=rtl] .timeline-overview-graph.cpu > .bar-chart { >+body[dir=rtl] .timeline-overview-graph.cpu > .column-chart { > transform: scaleX(-1); > } > >-.timeline-overview-graph.cpu > .bar-chart > svg > rect { >+.timeline-overview-graph.cpu > .column-chart > svg > rect { > stroke: var(--cpu-stroke-color); > fill: var(--cpu-fill-color); > } >diff --git a/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js b/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js >index 3065710f9e4..c58fa8ba497 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js >+++ b/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js >@@ -116,7 +116,7 @@ WI.CPUTimelineOverviewGraph = class CPUTimelineOverviewGraph extends WI.Timeline > let h = Math.max(minimumDisplayHeight, yScale(record.usage)); > let x = xScale(record.startTime - (samplingRatePerSecond / 2)); > let y = height - h; >- this._chart.addBar(x, y, w, h); >+ this._chart.addColumn(x, y, w, h); > } > > this._chart.updateLayout(); >diff --git a/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js b/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js >index 13d3755a9f6..b9642ff6c72 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ColumnChart.js >@@ -23,10 +23,10 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-// ColumnChart creates a single filled line chart. >+// ColumnChart creates a chart filled with singular columns. > // >-// Initialize the chart with a size. You can then include a new bar >-// in the bar chart by providing an (x, y, w, h) via `addBar`. >+// Initialize the chart with a size. You can then include a new column >+// in the column chart by providing an (x, y, w, h) via `addColumn`. > // > // SVG: > // >@@ -36,6 +36,7 @@ > // <svg width="800" height="75" viewbox="0 0 800 75"> > // <rect width="<w>" height="<h>" transform="translate(<x>, <y>)" /> > // <rect width="<w>" height="<h>" transform="translate(<x>, <y>)" /> >+// ... > // </svg> > // </div> > >@@ -44,18 +45,18 @@ WI.ColumnChart = class ColumnChart > constructor(size) > { > this._element = document.createElement("div"); >- this._element.classList.add("bar-chart"); >+ this._element.classList.add("column-chart"); > > this._svgElement = this._element.appendChild(createSVGElement("svg")); > >- this._bars = []; >+ this._columns = []; > this.size = size; > } > > // Public > > get element() { return this._element; } >- get bars() { return this._bars; } >+ get columns() { return this._columns; } > > get size() > { >@@ -71,14 +72,14 @@ WI.ColumnChart = class ColumnChart > this._svgElement.setAttribute("viewbox", `0 0 ${size.width} ${size.height}`); > } > >- addBar(x, y, width, height) >+ addColumn(x, y, width, height) > { >- this._bars.push({x, y, width, height}); >+ this._columns.push({x, y, width, height}); > } > > clear() > { >- this._bars = []; >+ this._columns = []; > } > > needsLayout() >@@ -98,7 +99,7 @@ WI.ColumnChart = class ColumnChart > > this._svgElement.removeChildren(); > >- for (let {x, y, width, height} of this._bars) { >+ for (let {x, y, width, height} of this._columns) { > let rect = this._svgElement.appendChild(createSVGElement("rect")); > rect.setAttribute("width", width); > rect.setAttribute("height", height); >diff --git a/Source/WebInspectorUI/UserInterface/Views/StackedLineChart.js b/Source/WebInspectorUI/UserInterface/Views/StackedLineChart.js >index 6454b591202..8dbd61b1ad1 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/StackedLineChart.js >+++ b/Source/WebInspectorUI/UserInterface/Views/StackedLineChart.js >@@ -60,15 +60,8 @@ WI.StackedLineChart = class StackedLineChart > > // Public > >- get element() >- { >- return this._element; >- } >- >- get points() >- { >- return this._points; >- } >+ get element() { return this._element; } >+ get points() { return this._points; } > > get size() > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
hi
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193982
: 360500