Skip to content

Commit 051d5f3

Browse files
committed
Adopt new mimetype schema
1 parent 54dc6bb commit 051d5f3

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

labextension/src/doc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export class DocWidget extends Widget {
5656
if (this.isAttached) {
5757
const content = this._context.model.toString();
5858
try {
59-
const { resources: [ props ] } = JSON.parse(content);
60-
ReactDOM.render(<JSONTable {...props} />, this.node);
59+
const { data, schema } = JSON.parse(content);
60+
ReactDOM.render(<JSONTable data={data} schema={schema} />, this.node);
6161
} catch (error) {
6262
const ErrorDisplay = props => (
6363
<div

labextension/src/output.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export class OutputWidget extends Widget {
3939
* A render function given the widget's DOM node.
4040
*/
4141
_render() {
42-
const { resources: [ props ] } = this._data.get(this._mimeType);
42+
const { data, schema } = this._data.get(this._mimeType);
4343
// const metadata = this._metadata.get(this._mimeType);
44-
if (props) ReactDOM.render(<JSONTable {...props} />, this.node);
45-
// Inject static HTML into mime bundle
44+
// if (data)
45+
ReactDOM.render(<JSONTable data={data} schema={schema} />, this.node);
4646
this._data.set(
4747
'text/html',
48-
ReactDOMServer.renderToStaticMarkup(<JSONTable {...props} />)
48+
ReactDOMServer.renderToStaticMarkup(<JSONTable data={data} schema={schema} />)
4949
);
5050
}
5151
}

nbextension/src/renderer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ const CLASS_NAME = 'output_JSONTable rendered_html';
1010
/**
1111
* Render data to the output area
1212
*/
13-
function render(data, node) {
14-
const { resources: [ props ] } = data;
15-
ReactDOM.render(<JSONTable {...props} />, node);
13+
function render(json, node) {
14+
const { data, schema } = json;
15+
ReactDOM.render(<JSONTable data={data} schema={schema} />, node);
1616
}
1717

1818
/**

0 commit comments

Comments
 (0)