_.each(values, (value, seriesName) => { if (!this.series[seriesName]) { return; } if (this._isHighwater(seriesName)) { this.series[seriesName].y = _.times(this.limit, _.constant(value)); } else { this.series[seriesName].y.shift(); this.series[seriesName].y.push(value); } });
describe("constructor", () => { beforeEach(() => { sandbox.stub(BaseLineGraph.prototype, "_createGraph"); }); it("should use limit from layoutConfig", () => { const limit = 7; options.layoutConfig.view.limit = limit; const baseGraph = new BaseLineGraph(options); expect(baseGraph).to.have.property("limit", limit); expect(baseGraph).to.have.nested.property("series.a.y") .that.deep.equals(_.times(limit, _.constant(0))); }); it("should create graph and set up event listener", () => { const baseGraph = new BaseLineGraph(options); expect(baseGraph).to.be.an.instanceof(BaseView); expect(baseGraph._createGraph).to.have.been.calledOnce; expect(testContainer.screen.on).to.have.been.calledWithExactly("metrics", sinon.match.func); }); });
y: _.times(this.layoutConfig.limit, _.constant(0)), style: { line: seriesConfig.color
_.each(data[0], (value, seriesName) => { if (!this.series[seriesName]) { return; } if (this._isHighwater(seriesName)) { this.series[seriesName].y = _.times(this.limit, _.constant(value)); } else { this.series[seriesName].y = _.times(this.limit, _.constant(0)); } this.series[seriesName].x = xAxis; });
doc += '\n### Results\n'; doc += `|benchmark|${names.join('|')}|\n`; doc += `|---|${_.times(names.length, _.constant('---')).join('|')}|\n`; doc += _.reduce( result,
this.res.redirect(this.req.header('Referer') || Config.get('remote.base'), _.constant(''));