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.
41 lines (40 loc) • 1.32 kB
TypeScript
import * as d3 from 'd3';
import type { OfficeFloor } from '$lib/office/OfficeFloor';
import type { Seat } from '$lib/office/Seat';
import type { BasicSeatViz } from './seat/BasicSeatViz';
import type { SeatingSimulation } from '$lib/seating/SeatingSimulation';
type VizConfig = {
width: number;
height: number;
marginTop: number;
marginRight: number;
marginBottom: number;
marginLeft: number;
xmax: number;
ymax: number;
enableAxis: boolean;
floors: OfficeFloor[];
seatviz: BasicSeatViz | null;
};
export declare class VizFloor {
svg: any;
xScale: d3.ScaleLinear<number, number, never>;
yScale: d3.ScaleLinear<number, number, never>;
config: VizConfig;
xmax: number;
ymax: number;
floors: OfficeFloor[];
seating: SeatingSimulation | null;
callback: ((seat: Seat) => void) | null;
unitSize: number;
constructor(config?: Partial<VizConfig>);
updateConfig(config: Partial<VizConfig>): void;
connect(div: HTMLDivElement): void;
createPath(line: [number, number][]): string;
setSeating(seating: SeatingSimulation): void;
onClick(callback: (seat: Seat) => void): void;
renderSeats(element: any): void;
render(): void;
renderAxis(selection: d3.Selection<SVGGElement, OfficeFloor, any, any>): void;
}
export {};