Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jupyter-display-area

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jupyter-display-area - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/custom-renderers.js

43

lib/jupyter-display-area.js

@@ -13,3 +13,3 @@ "use strict";

var _tracebackRenderer = require("./traceback-renderer");
var _customRenderers = require("./custom-renderers");

@@ -54,3 +54,4 @@ (function () {

this.transformime.renderers.push(new _tracebackRenderer.TracebackRenderer());
this.transformime.renderers.push(new _customRenderers.TracebackRenderer());
this.transformime.renderers.push(new _customRenderers.StreamRenderer());

@@ -186,3 +187,3 @@ // 'Private'

case "stream":
bundle = this.createStreamBundle(json);
bundle = { "jupyter/stream": json };
break;

@@ -202,36 +203,2 @@ case "error":

}
}, {
key: "createStreamBundle",
/**
* Appends stream data to the output area.
* @param {object} json - see nbformat
*/
value: function createStreamBundle(json) {
var text = json.text;
if (typeof text !== "string") {
console.error("Stream output is invalid (missing text)", json);
return;
}
if (!text.replace("\r", "")) {
return;
}
return { "text/plain": text };
}
}, {
key: "createErrorBundle",
value: function createErrorBundle(json) {
var traceback = json.traceback;
if (traceback !== undefined && traceback.length > 0) {
var text = "";
var len = traceback.length;
for (var i = 0; i < len; i++) {
text = text + traceback[i] + "\n";
}
text = text + "\n";
return { "text/plain": text };
}
}
}]);

@@ -243,4 +210,4 @@

// Register jupyter-display-area with the document
document.registerElement("jupyter-display-area", JupyterDisplayArea);
owner.registerElement("jupyter-display-area", JupyterDisplayArea);
})();
//# sourceMappingURL=jupyter-display-area.js.map
{
"name": "jupyter-display-area",
"version": "0.0.2",
"version": "0.0.3",
"description": "Web component for Jupyter kernel rich output/display",

@@ -5,0 +5,0 @@ "main": "dist/jupyter-display-area.js",

import {Transformime} from "transformime";
import {TracebackRenderer} from "./traceback-renderer";
import {TracebackRenderer, StreamRenderer} from "./custom-renderers";

@@ -32,2 +32,3 @@ (function() {

this.transformime.renderers.push(new TracebackRenderer());
this.transformime.renderers.push(new StreamRenderer());

@@ -150,3 +151,3 @@ // 'Private'

case 'stream':
bundle = this.createStreamBundle(json);
bundle = {'jupyter/stream': json};
break;

@@ -168,38 +169,7 @@ case 'error':

/**
* Appends stream data to the output area.
* @param {object} json - see nbformat
*/
createStreamBundle(json) {
var text = json.text;
if (typeof text !== 'string') {
console.error('Stream output is invalid (missing text)', json);
return;
}
if (!text.replace('\r', '')) {
return;
}
return {'text/plain': text};
}
createErrorBundle(json) {
var traceback = json.traceback;
if (traceback !== undefined && traceback.length > 0) {
var text = '';
var len = traceback.length;
for (var i=0; i<len; i++) {
text = text + traceback[i] + '\n';
}
text = text + '\n';
return {'text/plain': text};
}
}
}
// Register jupyter-display-area with the document
document.registerElement('jupyter-display-area', JupyterDisplayArea);
owner.registerElement('jupyter-display-area', JupyterDisplayArea);
})();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc