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

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