Skip to main content

Hello, World!

GUI

We include the Observable Inputs library.

// Cell 1
viewof myTextInput = Inputs.text("Enter text")

// Cell 2
Button("log", async () => {
console.log(myTextInput)
});

State

Occasionally you'll want a mutable cell.

// Cell 1
mutable cell = 0

// Cell 2
Button("inc", async () => {
mutable cell = cell + 1
});

GraphXR API

Access GraphXR API with the built-in gxr object.

Button("select", async () => {
gxr.nodes().select();
});