mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 04:38:15 +00:00
[Plot] Complete specs for plot
Complete specs for transitioned plot view, WTD-533.
This commit is contained in:
@ -36,7 +36,7 @@ define(
|
||||
buffer;
|
||||
|
||||
if (!gl) {
|
||||
return false;
|
||||
throw new Error("WebGL unavailable.");
|
||||
}
|
||||
|
||||
// Initialize shaders
|
||||
|
@ -14,15 +14,23 @@ define(
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function MCTChart($interval) {
|
||||
function MCTChart($interval, $log) {
|
||||
|
||||
function linkChart(scope, element) {
|
||||
var canvas = element.find("canvas")[0],
|
||||
chart;
|
||||
|
||||
// Try to initialize GLChart, which allows drawing using WebGL.
|
||||
// This may fail, particularly where browsers do not support
|
||||
// WebGL, so catch that here.
|
||||
try {
|
||||
chart = new GLChart(canvas);
|
||||
} catch (e) {
|
||||
$log.warn("Cannot initialize mct-chart; " + e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
function doDraw() {
|
||||
var draw = scope.draw;
|
||||
|
||||
function doDraw(draw) {
|
||||
canvas.width = canvas.offsetWidth;
|
||||
canvas.height = canvas.offsetHeight;
|
||||
chart.clear();
|
||||
@ -57,7 +65,7 @@ define(
|
||||
function drawIfResized() {
|
||||
if (canvas.width !== canvas.offsetWidth ||
|
||||
canvas.height !== canvas.offsetHeight) {
|
||||
doDraw();
|
||||
doDraw(scope.draw);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user