166 |
193 | {showPlotViewer ? (
194 |
221 | ) : undefined}
222 | {showCopyImage ? (
223 |
251 | ) : undefined}
252 | {contents}
253 |
254 | );
255 | }
256 | private renderOutput(data: nbformat.MultilineString | PartialJSONObject, mimeType?: string) {
257 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unused-vars, no-unused-vars, @typescript-eslint/no-explicit-any
258 | const Transform: any = getTransform(this.props.mimeType!);
259 | const vegaPlot = mimeType && isVegaPlot(mimeType);
260 | const divStyle: React.CSSProperties = {
261 | backgroundColor: vegaPlot ? 'white' : undefined
262 | };
263 | if (vegaPlot) {
264 | // Vega library expects data to be passed as serialized JSON instead of a native
265 | // JS object.
266 | data = typeof data === 'string' ? data : JSON.stringify(data);
267 | }
268 | return (
269 |