UNPKG

agentscape

Version:

Agentscape is a library for creating agent-based simulations. It provides a simple API for defining agents and their behavior, and for defining the environment in which the agents interact. Agentscape is designed to be flexible and extensible, allowing

33 lines (32 loc) 773 B
import { Color } from '../numbers'; export interface DatasetOptions { label: string; color?: Color; } export interface ChartConstructor { root: HTMLElement; datasets: DatasetOptions[]; maxDataSize?: number; axisLabels?: { x: string; y: string; }; title?: string; width?: number; } /** * Creates a time series chart. * The x-axis is time and the y-axis is a number. */ export default class TimeSeries { private chart; private width; private maxDataSize; constructor(opts: ChartConstructor); /** * Pushes data to the chart. * The data should be an array of numbers, where each array corresponds to a dataset * in the order they were added. */ pushData(data: number[]): void; }