Skip to content

Commit 39a6ef1

Browse files
committed
Adopt new mimetype schema
1 parent 05a5440 commit 39a6ef1

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +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);
44+
// if (data)
45+
ReactDOM.render(<JSONTable data={data} schema={schema} />, this.node);
4546
this._data.set(
4647
'text/html',
47-
ReactDOMServer.renderToStaticMarkup(<JSONTable {...props} />)
48+
ReactDOMServer.renderToStaticMarkup(<JSONTable data={data} schema={schema} />)
4849
);
4950
}
5051
}

nbextension/src/renderer.js

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

1717
/**

0 commit comments

Comments
 (0)