Closed BoPeng closed 7 years ago
The ijavascript process is a full node process and is completely separate from the browser process. For rich display, you'll have to use IJavaScript's helpers for displaying js or html: http://n-riesco.github.io/ijavascript/doc/graphics.ipynb.html
Ohmm, the helpers executes HTML, do you mean I need to get DataTables loaded outside of iJavaScript before I use $$HTML$$
to use them? Have you seen anyone using DataTables
with iJavaScript
?
Essentially speaking, I would like to use iJavaScript to render a JSON table as searchable tables...
@BoPeng In this answer in StackOverflow I gave an example of what you need to do to get IJavascript to render HTML.
But, please, bear in mind that some Jupyter frontends won't allow the injection of Javascript (I'm not familiar with DataTable
).
Alternatively, some frontends (like nteract and hydrogen) can render JSON MIME data. Something like this should work when IJavascript is used in those frontends:
$$.mime({
"application/json": {a: 1, b: 2, c: 3},
});
Thanks for the explanation, I think I got the generally idea. I tried to load DataTable
in jsdom
but got stuck at the first step:
after running npm install -g jsdom
. This is unrelated to iJavaScript
so I am closing the ticket.
jsdom requires node 6 or higher
I am new to JS so please bear with me if this question is too naive. Basically I would like to use ijavascript to display nice tables in Jupyter using DataTables. I have
I am then stuck at how to load datatables to iJavascript. I tried
and got
I understand that we are using node.js but we are in a browser (Jupyter), so
window
should exist, not?