Unlisted
Edited
Oct 31, 2024
Insert cell
Insert cell
original_data = ({
name: "Sample Project",
description: "Initial project data",
status: "active"
})
Insert cell
state_data = ({})
Insert cell
changed_data = ({
name: "Specific Project",
description: "Adjusted project data",
status: "closed"
})
Insert cell
viewof load_original_data = Inputs.button("Load Original Data");
Insert cell
write_original_data = {
if (load_original_data) {
Object.assign(state_data, original_data);
}
state_data;
};
Insert cell
viewof load_changed_data = Inputs.button("Load Changed Data");
Insert cell
write_changed_data = {
if (load_changed_data) {
Object.assign(state_data, changed_data);
}
state_data;
};
Insert cell
state_data
Insert cell
state_data.name
Insert cell
Insert cell
new_state_data = {
if (load_original_data) {
Object.assign(state_data, original_data);
} else if (load_changed_data) {
Object.assign(state_data, changed_data);
}
return state_data;
}
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