embed({
datasets: {
samples: (
DATA
.split(/\s+/g)
.map((d) => Number.parseInt(d, 10))
.filter((d) => d < 10000)
.map((x) => ({ x }))
),
},
data: {
name: 'samples',
},
mark: 'bar',
encoding: {
x: {
bin: true,
field: 'x',
},
y: {
aggregate: 'count',
},
},
});