Cheuk Ting Ho
Developer advocate / Data Scientist - support open-source and building the community.
by Cheuk Ting Ho
https://slides.com/cheukting_ho/interactive-knowledge-graph-visualization-in-jupyter-notebook/
Of cause! It's a web application that runs in your browser
You can render a cell as JS by %%javascript magic
However, we did a more elegant job (which I will show you
Sure!
You can use
require(['']);
require in JavaScript let you call-in another script just like import
The magic lies in IPython.display
from IPython.display import Javascript, display
display(
Javascript(
"""
< insert js code here >
"""
)
)
External JS library that we need:
require.config({
paths: {
TerminusClient:'https://unpkg.com/@terminusdb/terminusdb-client@3.0.3/dist/terminusdb-client.min',
TerminusDBGraph:'https://dl.bintray.com/terminusdb/terminusdb/dev/terminusdb-d3-graph.min'
}
});
require(['TerminusClient','TerminusDBGraph'],
function(TerminusClient,TerminusDBGraph){...}
1. What if it is called NOT in a Jupyter notebook?
2. How to test it?
3. What if there's no internet connection?
By Cheuk Ting Ho
Developer advocate / Data Scientist - support open-source and building the community.