Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Basthon
Basthon Notebook
Commits
a82b968f
Commit
a82b968f
authored
Nov 18, 2020
by
Romain Casati
Browse files
p5 support.
parent
8aca12b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
notebook/static/services/kernels/basthonwebsocket.js
View file @
a82b968f
...
...
@@ -5,10 +5,10 @@ define([], function() {
var
OPEN
=
1
;
/**
*
Matplotlib
variable exchanger (Bus) to bypass stringifying
*
DOM node
variable exchanger (Bus) to bypass stringifying
* messages between frontend and kernel that prevents DOMNode sharing.
*/
var
mpl
Bus
=
window
.
mpl
Bus
=
(
function
()
{
var
domNode
Bus
=
window
.
domNode
Bus
=
(
function
()
{
var
that
=
{};
/**
...
...
@@ -180,14 +180,14 @@ define([], function() {
root
.
setAttribute
(
'
height
'
,
'
360px
'
);
send_data
=
{
"
image/svg+xml
"
:
root
.
outerHTML
};
break
;
case
"
matplotlib
"
:
case
"
dom-node
"
:
/* /!\ big hack /!\
To allow javascript loading of
matplotlib
node,
To allow javascript loading of
DOM
node,
we get an id identifying the object. We can then
pickup the object from its id.
*/
const
id
=
mpl
Bus
.
push
(
data
.
content
);
send_data
=
{
"
application/javascript
"
:
"
element.append(window.
mpl
Bus.pop(
"
+
id
+
"
));
"
};
const
id
=
domNode
Bus
.
push
(
data
.
content
);
send_data
=
{
"
application/javascript
"
:
"
element.append(window.
domNode
Bus.pop(
"
+
id
+
"
));
"
};
break
;
case
"
multiple
"
:
/* typically dispached by display() */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment