Published
Edited
Aug 24, 2018
1 fork
Importers
Insert cell
Insert cell
Insert cell
data = Object({
name: 'flare',
children: Object.keys(crimeData)
.map(crimeType => {
return {name: crimeType.toLowerCase(), children: groupChildren(crimeData[crimeType], 'info')};
})
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
crimeData = groupByField(dataTable, 'PrimaryType')
Insert cell
Insert cell
dataTable = loadData(dataUrl).then(buffer => arrow.Table.from(new Uint8Array(buffer)))
Insert cell
function groupChildren(arrayData, groupField) {
const groups = {};
arrayData.map(data => {
const info = data[groupField].toLowerCase();
if (!groups[info]) {
groups[info] = [];
}
groups[info].push(data);
});
return Object.keys(groups)
.map(key => {
return {name: key, size: groups[key].length};
});
}
Insert cell
import {loadData} from '@randomfractals/apache-arrow'
Insert cell
import {groupByField} from '@randomfractals/chicago-crimes-by-type'
Insert cell
arrow = require('apache-arrow')
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