From 1e0ace6a8139d17b9179626ff640678167c3d4a5 Mon Sep 17 00:00:00 2001 From: Prasun Anand Date: Fri, 15 Nov 2024 14:06:21 +0530 Subject: [PATCH] =?UTF-8?q?Charts=20showing=20up=20in=20notebooks=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/ide/editor/notebook/NotebookEditor.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/src/ide/editor/notebook/NotebookEditor.tsx b/ui/src/ide/editor/notebook/NotebookEditor.tsx index ac7795d..cd7c54f 100644 --- a/ui/src/ide/editor/notebook/NotebookEditor.tsx +++ b/ui/src/ide/editor/notebook/NotebookEditor.tsx @@ -126,10 +126,6 @@ export default function NotebookEditor (props) { // listKernels(); // listAllSessions(); } - // Focus the CodeMirror editor when the index changes - // if (codeMirrorRefs.current[focusedIndex]) { - // codeMirrorRefs.current[focusedIndex].editor.focus(); - // } }, []) @@ -137,12 +133,15 @@ export default function NotebookEditor (props) { if ('outputs' in data) { if (typeof (data.outputs[0]) !== 'undefined') { // console.log(data.outputs[0]); - if (data.outputs[0].hasOwnProperty('text')) { - return
{data.outputs[0].text}
+ if (data.outputs[0].hasOwnProperty('text') ) { + if(data.outputs[0].text){ + return
{data.outputs[0].text}
+ } + } if (data.outputs[0].hasOwnProperty('data')) { if (data.outputs[0].data.hasOwnProperty('text/html')) { - + } if (data.outputs[0].data.hasOwnProperty('image/png')) { const blob = 'data:image/png;base64,' + (data.outputs[0].data['image/png'])