jupyter-display-area
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
224710
1779
0