Loading src/visualizers/panels/SimulationResultPlotter/SimulationResultPlotterControl.js +4 −4 Changes for src/visualizers/panels/SimulationResultPlotter/SimulationResultPlotterControl.js: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -87,13 +87,13 @@ define([ } }; SimulationResultPlotterControl.prototype._checkForChange = function () { SimulationResultPlotterControl.prototype._isChanged = function () { var node = this._client.getNode(this._currentNodeId); if (node == null) return false; return this._currentHash == node.getAttribute('simRes'); return this._currentHash !== node.getAttribute('simRes'); }; SimulationResultPlotterControl.prototype._buildPlotData = function () { Loading Loading @@ -124,7 +124,7 @@ define([ return; } plot.push({x: timeSeries.time, y: timeSeries[key], name: key, mode: mode}); plot.push({x: timeSeries.time, y: timeSeries[key], name: key, mode: mode, marker: {size: 2}}); }); self._currentPlotData = plot; self._widget.initPlot(self._currentPlotData); Loading Loading @@ -200,7 +200,7 @@ define([ }; SimulationResultPlotterControl.prototype._onUpdate = function (gmeId) { if (this._checkChanged()) { if (this._isChanged()) { this._buildPlotData(); } }; Loading src/visualizers/widgets/SimulationResultPlotter/SimulationResultPlotterWidget.js +19 −4 Changes for src/visualizers/widgets/SimulationResultPlotter/SimulationResultPlotterWidget.js: 19 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -32,20 +32,35 @@ define([ // set widget class this._el.addClass(WIDGET_CLASS); this._plotEl = $(SimulationResultPlotterHTML); this._plotEl.width(width); this._plotEl.height(height); // Create a dummy header // this._el.append('<h3>SimulationResultPlotter Events:</h3>'); console.log(Plotly); this._el.append($(SimulationResultPlotterHTML)); this._el.append(this._plotEl); }; SimulationResultPlotterWidget.prototype.onWidgetContainerResize = function (width, height) { this._logger.debug('Widget is resizing...'); this._plotEl.width(width); this._plotEl.height(height); if (this._plotExists) { Plotly.relayout('plotContainer', { width: width, height: height }); } }; SimulationResultPlotterWidget.prototype.initPlot = function (data) { this._plotExists = true; if (data) { Plotly.react('plotContainer', data, {}); Plotly.react('plotContainer', data, { width: this._plotEl.width(), height: this._plotEl.height(), margin: {t: 20, b: 20, l: 20}, hovermode: 'closest' }); } else { Plotly.purge('plotContainer'); } Loading Loading
src/visualizers/panels/SimulationResultPlotter/SimulationResultPlotterControl.js +4 −4 Changes for src/visualizers/panels/SimulationResultPlotter/SimulationResultPlotterControl.js: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -87,13 +87,13 @@ define([ } }; SimulationResultPlotterControl.prototype._checkForChange = function () { SimulationResultPlotterControl.prototype._isChanged = function () { var node = this._client.getNode(this._currentNodeId); if (node == null) return false; return this._currentHash == node.getAttribute('simRes'); return this._currentHash !== node.getAttribute('simRes'); }; SimulationResultPlotterControl.prototype._buildPlotData = function () { Loading Loading @@ -124,7 +124,7 @@ define([ return; } plot.push({x: timeSeries.time, y: timeSeries[key], name: key, mode: mode}); plot.push({x: timeSeries.time, y: timeSeries[key], name: key, mode: mode, marker: {size: 2}}); }); self._currentPlotData = plot; self._widget.initPlot(self._currentPlotData); Loading Loading @@ -200,7 +200,7 @@ define([ }; SimulationResultPlotterControl.prototype._onUpdate = function (gmeId) { if (this._checkChanged()) { if (this._isChanged()) { this._buildPlotData(); } }; Loading
src/visualizers/widgets/SimulationResultPlotter/SimulationResultPlotterWidget.js +19 −4 Changes for src/visualizers/widgets/SimulationResultPlotter/SimulationResultPlotterWidget.js: 19 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -32,20 +32,35 @@ define([ // set widget class this._el.addClass(WIDGET_CLASS); this._plotEl = $(SimulationResultPlotterHTML); this._plotEl.width(width); this._plotEl.height(height); // Create a dummy header // this._el.append('<h3>SimulationResultPlotter Events:</h3>'); console.log(Plotly); this._el.append($(SimulationResultPlotterHTML)); this._el.append(this._plotEl); }; SimulationResultPlotterWidget.prototype.onWidgetContainerResize = function (width, height) { this._logger.debug('Widget is resizing...'); this._plotEl.width(width); this._plotEl.height(height); if (this._plotExists) { Plotly.relayout('plotContainer', { width: width, height: height }); } }; SimulationResultPlotterWidget.prototype.initPlot = function (data) { this._plotExists = true; if (data) { Plotly.react('plotContainer', data, {}); Plotly.react('plotContainer', data, { width: this._plotEl.width(), height: this._plotEl.height(), margin: {t: 20, b: 20, l: 20}, hovermode: 'closest' }); } else { Plotly.purge('plotContainer'); } Loading