Published
Edited
Mar 21, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function executor(code) {
window.CanvasKit = CanvasKit;
var self = document.getElementById('execution');
var parent = self.parentElement;
var removed = parent.removeChild(self);

var canvas = html`<canvas id="execution" width="500" height="500"></canvas>`;
parent.appendChild(canvas);

eval(`${code}`);
}
Insert cell
Insert cell
function setupToolbar() {
const initial = foxFontCode;

const toolbarLoadCode = document.querySelector("#toolbar_load_code");
const toolbarRunCode = document.querySelector("#toolbar_run_code");

toolbarLoadCode.disabled = false;
// Toolbar onclick Handles
toolbarLoadCode.onclick = () => {
if (window.editor) {
window.editor.setValue(initial);
}
};

toolbarRunCode.onclick = () => {
if (window.editor) {
executor(window.editor.getValue());
}
};
}
Insert cell
Insert cell
Insert cell
initialize()
Insert cell
paint = new CanvasKit.Paint()
Insert cell
Insert cell
Insert cell
import { createCodeMirrorWidget } from '@fengyfei/blockly-widgets'
Insert cell
import { loadCanvasKit } from '@yhyddr/canvaskit-library'
Insert cell
CanvasKit = loadCanvasKit("0.19.0")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more