UNPKG

officekit

Version:

A toolkit to represent and visualize office spaces. It also provides functionality to simulate usage of offices, and calculate a score given a fitness function. It also have functionatlity for automatic allocation of offices using a genetic algorithm.

29 lines (28 loc) 883 B
import * as d3 from 'd3'; import type { Seat } from '$lib/office/Seat'; import type { Genome } from '$lib/evolution/Genome'; import type { OfficeBuilding } from '$lib/office/OfficeBuilding'; type VizConfig = { width: number; height: number; marginTop: number; marginRight: number; marginBottom: number; marginLeft: number; genomes: Genome[]; building: OfficeBuilding | null; }; export declare class VizGenome { svg: any; xScale: d3.ScaleLinear<number, number, never>; colorScale: d3.ScaleOrdinal<string, string>; config: VizConfig; seatIndex: Map<number, number>; callback: ((seat: Seat) => void) | null; constructor(config?: Partial<VizConfig>); updateConfig(config: Partial<VizConfig>): void; connect(div: HTMLDivElement): void; render(): void; onClick(callback: (seat: Seat) => void): void; } export {};