Public
Edited
Jan 11
7 stars
Insert cell
Insert cell
viewof clipboard = {
const ui = Inputs.textarea({
label:
"Paste a cell selection into here to see the format of multicell clipboard data"
});
ui.addEventListener("paste", function (event) {
event.preventDefault();
event.stopPropagation();
ui.value = event.clipboardData.getData(MIME_TYPE);
ui.dispatchEvent(new Event("input", { bubbles: true }));
});
return ui;
}
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
{
const ui = Inputs.textarea({
label: "Copy multicell data from here",
rows: 10,
value: `[{"id":80,"value":"viewof name = Inputs.text({ label: \\\"Enter your name\\\" })","pinned":false,"mode":"js","data":null,"name":null},{"id":84,"value":"md\`👋 hi '${name}'.\`","pinned":true,"mode":"js","data":null,"name":null}]`
});
ui.addEventListener("copy", function (event) {
event.preventDefault();
event.stopPropagation();
debugger;
const source = JSON.parse(ui.value);
event.clipboardData.setData("text/plain", source.join("\n\n"));
event.clipboardData.setData(
"application/vnd.observablehq+json",
JSON.stringify(source)
);
});
return ui;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more