leaflet: update d3 package.
Change-Id: I3afe1021edf9e77ff7a62de0a0d4478c974af57b Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95534 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com>
This commit is contained in:
parent
2063d2bec6
commit
9d0fc3801d
2 changed files with 12 additions and 19 deletions
|
@ -97,21 +97,20 @@ var AdminSocketAnalytics = AdminSocketBase.extend({
|
||||||
else if (option === 'net')
|
else if (option === 'net')
|
||||||
data = this._sentStatsData.concat(this._recvStatsData);
|
data = this._sentStatsData.concat(this._recvStatsData);
|
||||||
|
|
||||||
xScale = d3.scale.linear().range([this._graphMargins.left, this._graphWidth - this._graphMargins.right]).domain([d3.min(data, function(d) {
|
xScale = d3.scaleLinear().range([this._graphMargins.left, this._graphWidth - this._graphMargins.right]).domain([d3.min(data, function(d) {
|
||||||
return d.time;
|
return d.time;
|
||||||
}), d3.max(data, function(d) {
|
}), d3.max(data, function(d) {
|
||||||
return d.time;
|
return d.time;
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
|
|
||||||
yScale = d3.scale.linear().range([this._graphHeight - this._graphMargins.bottom, this._graphMargins.top]).domain([d3.min(data, function(d) {
|
yScale = d3.scaleLinear().range([this._graphHeight - this._graphMargins.bottom, this._graphMargins.top]).domain([d3.min(data, function(d) {
|
||||||
return d.value;
|
return d.value;
|
||||||
}), d3.max(data, function(d) {
|
}), d3.max(data, function(d) {
|
||||||
return d.value;
|
return d.value;
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
d3XAxis = d3.svg.axis()
|
d3XAxis = d3.axisBottom(xScale)
|
||||||
.scale(xScale)
|
|
||||||
.tickFormat(function(d) {
|
.tickFormat(function(d) {
|
||||||
d = Math.abs(d / 1000);
|
d = Math.abs(d / 1000);
|
||||||
var sUnit = 0;
|
var sUnit = 0;
|
||||||
|
@ -128,49 +127,43 @@ var AdminSocketAnalytics = AdminSocketBase.extend({
|
||||||
return d + units[i];
|
return d + units[i];
|
||||||
});
|
});
|
||||||
|
|
||||||
d3Line = d3.svg.line()
|
d3Line = d3.line()
|
||||||
.x(function(d) {
|
.x(function(d) {
|
||||||
return xScale(d.time);
|
return xScale(d.time);
|
||||||
})
|
})
|
||||||
.y(function(d) {
|
.y(function(d) {
|
||||||
return yScale(d.value);
|
return yScale(d.value);
|
||||||
})
|
})
|
||||||
.interpolate('monotone');
|
.curve(d3.curveMonotoneX);
|
||||||
|
|
||||||
if (option === 'mem') {
|
if (option === 'mem') {
|
||||||
this._xMemScale = xScale;
|
this._xMemScale = xScale;
|
||||||
this._yMemScale = yScale;
|
this._yMemScale = yScale;
|
||||||
this._d3MemXAxis = d3XAxis;
|
this._d3MemXAxis = d3XAxis;
|
||||||
this._d3MemYAxis = d3.svg.axis()
|
this._d3MemYAxis = d3.axisLeft(this._yMemScale)
|
||||||
.scale(this._yMemScale)
|
|
||||||
.tickFormat(function (d) {
|
.tickFormat(function (d) {
|
||||||
return Util.humanizeMem(d);
|
return Util.humanizeMem(d);
|
||||||
})
|
});
|
||||||
.orient('left');
|
|
||||||
this._d3MemLine = d3Line;
|
this._d3MemLine = d3Line;
|
||||||
}
|
}
|
||||||
else if (option === 'cpu') {
|
else if (option === 'cpu') {
|
||||||
this._xCpuScale = xScale;
|
this._xCpuScale = xScale;
|
||||||
this._yCpuScale = yScale;
|
this._yCpuScale = yScale;
|
||||||
this._d3CpuXAxis = d3XAxis;
|
this._d3CpuXAxis = d3XAxis;
|
||||||
this._d3CpuYAxis = d3.svg.axis()
|
this._d3CpuYAxis = d3.axisLeft(this._yCpuScale)
|
||||||
.scale(this._yCpuScale)
|
|
||||||
.tickFormat(function (d) {
|
.tickFormat(function (d) {
|
||||||
return d + '%';
|
return d + '%';
|
||||||
})
|
});
|
||||||
.orient('left');
|
|
||||||
this._d3CpuLine = d3Line;
|
this._d3CpuLine = d3Line;
|
||||||
}
|
}
|
||||||
else if (option === 'net') {
|
else if (option === 'net') {
|
||||||
this._xNetScale = xScale;
|
this._xNetScale = xScale;
|
||||||
this._yNetScale = yScale;
|
this._yNetScale = yScale;
|
||||||
this._d3NetXAxis = d3XAxis;
|
this._d3NetXAxis = d3XAxis;
|
||||||
this._d3NetYAxis = d3.svg.axis()
|
this._d3NetYAxis = d3.axisLeft(this._yNetScale)
|
||||||
.scale(this._yNetScale)
|
|
||||||
.tickFormat(function (d) {
|
.tickFormat(function (d) {
|
||||||
return Util.humanizeMem(d/1000) + '/sec';
|
return Util.humanizeMem(d/1000) + '/sec';
|
||||||
})
|
});
|
||||||
.orient('left');
|
|
||||||
this._d3NetSentLine = d3Line;
|
this._d3NetSentLine = d3Line;
|
||||||
this._d3NetRecvLine = d3Line;
|
this._d3NetRecvLine = d3Line;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"autolinker": "3.14.1",
|
"autolinker": "3.14.1",
|
||||||
"browserify": "16.5.1",
|
"browserify": "16.5.1",
|
||||||
"browserify-css": "0.15.0",
|
"browserify-css": "0.15.0",
|
||||||
"d3": "3.5.17",
|
"d3": "5.16.0",
|
||||||
"eslint": "3.0.0",
|
"eslint": "3.0.0",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
"jquery": "2.2.4",
|
"jquery": "2.2.4",
|
||||||
|
|
Loading…
Reference in a new issue