Published
Edited
Apr 19, 2019
1 fork
Insert cell
Insert cell
chart = vegaEmbed({
width: 500,
data: {url: dataUrl, format: {type: 'arrow'}},
mark: 'bar',
encoding: {
y: {field: 'PrimaryType', type: 'ordinal', sort: {encoding: 'x'}, axis: {title: 'Crime Type'}},
x: {aggregate: 'count', field: '*', type: 'quantitative', axis: {title: '# of Records'}}
}
})
Insert cell
Insert cell
vegaEmbed = {
const vegaEmbed = await require('vega-embed@4');
// add arrow data vega loader
vegaEmbed.vega.formats('arrow', await require('vega-loader-arrow@0.0.6'));
return vegaEmbed;
}
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