You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[\Users\intern\Documents\universal-ground-system\Node js\node_modules\plotly.js
rc\lib\index.js:397
var style = document.createElement('style');
^
ferenceError: document is not defined
at Object.lib.addStyleRule (C:\Users\intern\Documents\universal-ground-syste
Node js\node_modules\plotly.js\src\lib\index.js:397:21)
at Object.<anonymous> (C:\Users\intern\Documents\universal-ground-system\Nod
js\node_modules\plotly.js\build\plotcss.js:61:16)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\intern\Documents\universal-ground-system\Nod
js\node_modules\plotly.js\src\plotly.js:30:1)
at Module._compile (module.js:409:26)](url)
Getting this error when require(plotly.js) is used in my code. This issue has been brought up before, but was not specified on how to fix. My code is below
var plotly= require('plotly')
var initdata = [{x:[], y:[], stream:{token:'t2166m92ft', maxpoints:100000}}];
var initlayout = {fileopt : 'overwrite', filename : 'nodenodenode5'};
plotly.plot(initdata, initlayout, function (err, msg) {
if (err) return console.log(err);
console.log(msg);
var stream1 = plotly.stream('t2166m92ft', function (err, res) {
if (err) return console.log(err);
console.log(res);
clearInterval(loop); // once stream is closed, stop writing
});
var varCounter = 0;
var i = 0;
var loop = setInterval(function () {
if(varCounter <= 100) {
client.once('message', function (message) {
var data = { x : i , y : message.toString()};
var streamObject = JSON.stringify(data);
stream1.write(streamObject+'\n');
i++;
});
varCounter++;
}
else {
clearInterval(loop);
}
}, 3000);
});
}
The text was updated successfully, but these errors were encountered:
I know its a duplicate, but was wondering if the server side problem is now fixed? Also if you corrected your code to work. Also if it is working, how do you stream data using the plotly.js since you need stream token. Looking for an example
Getting this error when require(plotly.js) is used in my code. This issue has been brought up before, but was not specified on how to fix. My code is below
The text was updated successfully, but these errors were encountered: