Published
Edited
Dec 26, 2020
Insert cell
Insert cell
Insert cell
Insert cell
import {vl} from '@vega/vega-lite-api'
Insert cell
import {daily_case_national, total_case_national, prov, provTidy} from '@adityawarmanfw/indonesia-covid-19-data'
Insert cell
// provs = {
// const area = vl.markArea()
// .encode(
// vl.y().fieldQ('mean').axis(null).stack("center"),
// vl.x().fieldT('tanggal')
// .axis({domain: false, tickCount: 0})
// .title("Waktu"),
// vl.color({value: 'red'}),
// vl.tooltip([vl.fieldT('tanggal'), vl.fieldQ('mean'), vl.fieldQ('MENINGGAL')])
// );
// return vl.layer(area)
// .width(width - width*0.05)
// .height(30)
// .facet(vl.facet().fieldN('Provinsi').title(null))
// .columns(1)
// .resolve({axis: { x: 'shared' },scale: { y: 'shared' }})
// .config({bar: {continuousBandSize: 1}, style: { cell: { stroke: 'transparent' } },
// header: { labelFontSize: 10, labelPadding: 0, labelAnchor: 'end' }})
// .transform(
// vl.window({ op: 'mean', field: 'MENINGGAL', as: 'mean' }).groupby('Provinsi').frame([-3, 3])
// )
// .data(provTidy)
// //toJSON()
// .render({renderer: ''})
// }
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