@nshiab/journalism-dataviz
v1.0.30
Published
Useful TypeScript functions for journalism projects. This library focuses on data visualization.
Readme
The Journalism Library (dataviz)
Useful TypeScript functions for data visualization in journalism projects. Part of the journalism library.
The library is maintained by Nael Shiab, computational journalist and senior data producer for CBC News.
[!TIP] To learn how to use this library and more, check out Code Like a Journalist, a free and open-source data analysis and data visualization course in TypeScript. You might also find simple-data-analysis useful.
Installation
npm install @nshiab/journalism-datavizimport { logBarChart } from "@nshiab/journalism-dataviz";
logBarChart(
[
{ country: "Canada", count: 40 },
{ country: "France", count: 25 },
],
"country",
"count",
);To start a data project with folders, configuration and documentation for AI agents, run:
npx @nshiab/setup-data-projectBrowser use
For browser projects, use the /web entry point with a browser bundler.
import { rewind } from "@nshiab/journalism-dataviz/web";
const polygon = {
type: "Polygon",
coordinates: [
[
[0, 0],
[1, 0],
[1, 1],
[0, 0],
],
],
};
const rewound = rewind(polygon);Documentation
- Documentation
- llms.txt — Documentation index for AI agents
- llm.md — Complete Markdown reference, for AI assistants or offline reading
- npm package
See CONTRIBUTING.md for development commands.
