Published
Edited
Jun 11, 2020
Fork of Networks LEI
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chart
Insert cell
viewof name = text({ title: "Enter a name", submit: null })
Insert cell
viewof group = text({ title: "Enter a group number", submit: null })
Insert cell
{
const button = html`<button>submit`;

button.onclick = submitNode;

return button;
}
Insert cell
viewof name1 = select({
title: "Select a name",
options: getName(data),
value: "Myriel"
})
Insert cell
viewof name2 = select({
title: "Select another name",
options: getName(data),
value: "Napoleon"
})
Insert cell
viewof length = text({ title: "Enter length of link", submit: null })
Insert cell
{
const btn = html`<button>submit`;

btn.onclick = submitLink;

return btn;
}
Insert cell
Insert cell
Insert cell
Insert cell
import { chart } with { data } from '@d3/force-directed-graph'
Insert cell
mutable data = FileAttachment("miserables.json").json()
Insert cell
import { text, button, select } from "@jashkenas/inputs"
Insert cell
_ = require('lodash')
Insert cell
getName = function(data) {
let result = [];
for (let i = 0; i < data.nodes.length; i++) {
result.push(data.nodes[i].id);
}
return result;
}
Insert cell
submitNode = () => {
const Data = _.cloneDeep(data);

if (name != "" && group != "") {
data.nodes.unshift({
id: name,
group: group
});

mutable data = Data;
}
}
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