Skip to content

Commit

Permalink
Charts showing up in notebooks 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
prasunanand committed Nov 15, 2024
1 parent 57f5a86 commit 1e0ace6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ui/src/ide/editor/notebook/NotebookEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,22 @@ export default function NotebookEditor (props) {
// listKernels();
// listAllSessions();
}
// Focus the CodeMirror editor when the index changes
// if (codeMirrorRefs.current[focusedIndex]) {
// codeMirrorRefs.current[focusedIndex].editor.focus();
// }

}, [])

const generateOutput = (data) => {
if ('outputs' in data) {
if (typeof (data.outputs[0]) !== 'undefined') {
// console.log(data.outputs[0]);
if (data.outputs[0].hasOwnProperty('text')) {
return <pre>{data.outputs[0].text}</pre>
if (data.outputs[0].hasOwnProperty('text') ) {
if(data.outputs[0].text){
return <pre>{data.outputs[0].text}</pre>
}

}
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'])
Expand Down

0 comments on commit 1e0ace6

Please sign in to comment.