Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change mime renderer type to not interfere with saving notebook #51

Closed
wants to merge 6 commits into from
Closed
Prev Previous commit
Next Next commit
remove console logs
  • Loading branch information
timkpaine committed Feb 9, 2018
commit 1479663841f0eb637ef02c4297d299a5dcfbb6aa
9 changes: 2 additions & 7 deletions packages/perspective-jupyterlab/src/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ class RenderedPSP extends Widget implements IRenderMime.IRenderer {
// TODO finish this part eventually
let socket = new WebSocket(this._datasrc);
socket.onopen = function (event: any) {
console.log('connected to ' + this.datasrc);
// console.log('connected to ' + this.datasrc);
}.bind(this);
socket.onmessage = function (event: any) {
console.log(event.data);
// console.log(event.data);
}.bind(this);

} else if (this._datatype === 'http' || this._datatype === 'https'){
Expand All @@ -89,20 +89,17 @@ class RenderedPSP extends Widget implements IRenderMime.IRenderer {

Session.listRunning().then(sessionModels => {
for(let i=0; i<sessionModels.length; i++){
console.log(sessionModels[i]);
if(sessionModels[i].kernel.id === kernelId){
Session.connectTo(sessionModels[i]).then((session) => {

let comm = session.kernel.connectToComm(name + '/' + channel);
comm.open('ack');
comm.onMsg = (msg: any) => {
console.log(msg); // 'hello'
let dat = msg['content']['data'];
let tmp = JSON.parse(dat);
psp.update(tmp);
};
comm.onClose = (msg: any) => {
console.log(msg); // 'bye'
};

});
Expand All @@ -114,8 +111,6 @@ class RenderedPSP extends Widget implements IRenderMime.IRenderer {

renderModel(model: IRenderMime.IMimeModel): Promise<void> {
const { data, layout } = model.data[MIME_TYPE] as any|PerspectiveSpec;
console.log(data);
console.log(layout);
this._lyt = layout;

try {
Expand Down