Published
Edited
May 8, 2020
Fork of Untitled
Insert cell
Insert cell
vl_spec = ({
"data": {
"name": "SOURCE",
"url": "https://tsws.hkvservices.nl/mangrove.ws/data.ashx?function=dataportal.db.getdata&parameters={database:%27vega%27,key:%27nested_data%27}&contentType=application/json",
"format": {"property": "nested"}
},
"transform": [{"flatten": ["foo", "bar"]}],
"mark": "circle",
"encoding": {
"x": {"field": "foo", "type": "quantitative"},
"y": {"field": "bar", "type": "nominal"},
"color": {"field": "key", "type": "nominal"}
}
})
Insert cell
viewof view = embed(vl_spec)
Insert cell
view.data('SOURCE')
Insert cell
// Apply this function and the data object IS NOT emptied
//view.remove('SOURCE', view.data('SOURCE')).run()
Insert cell
// Apply this function and the data object IS NOT emptied
//view.change('SOURCE', embed.vega.changeset().insert([]).remove(view.data('SOURCE'))).run()
Insert cell
// Apply this function and the data object IS emptied
//view.remove('SOURCE', function() { return true }).run();
Insert cell
md`## Appendix`
Insert cell
embed = require("vega-embed@6")
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