d3-seating-chart
Version:
A simple but pleasant seating chart written using d3js
43 lines (42 loc) • 2.01 kB
TypeScript
import { Selection, EnterElement } from "d3";
import { D3SeatingChartConfig } from './d3SeatingChartConfig.interface';
import { SelectionChangeEvent } from './selectionChangeEvent.model';
export declare type ElementSelector = SVGElement | SVGElement[] | string;
export declare class D3SeatingChart {
private element;
private margin;
focusedElement: any;
private history;
private zoomChangedListeners;
private selectionChangeListeners;
private selectedElements;
private config;
private uniqueIdentifier;
private constructor();
private init(config);
stripStyles(selector: string): void;
getBoard(): Selection<Element | Window | Document | EnterElement, {}, null, undefined>;
selectElement(query: string): Selection<Element | Window | Document | EnterElement, {}, null, undefined>;
selectElements(query: string): Selection<Element | Window | Document | EnterElement, {}, HTMLElement, {}>;
goToBoard(): void;
clearHistory(): void;
canGoBack(): boolean;
goBack(): void;
registerZoomChangeListener(fn: Function): () => void;
registerSelectionChangeListener(fn: (e: SelectionChangeEvent) => void): () => void;
zoom(selection: any, animate?: boolean): void;
private getShowList(selection);
private getHideList(selection);
refresh(): void;
private bindEvents();
lock(ele: ElementSelector, c?: string, emitEvents?: boolean): void;
unlockAll(c?: string): void;
unlock(ele: ElementSelector): void;
deselectAll(emitEvents?: boolean): void;
deselect(ele: ElementSelector, emitEvents?: boolean): void;
select(ele: ElementSelector, emitEvents?: boolean): void;
getClosestSeats(seatingAreaName: string, numSeats: number, contiguous?: boolean, scatterFallback?: boolean): SVGElement[];
private emitSelectionChangeEvent(r);
private resolveElements(ele);
static attach(element: HTMLElement, config?: D3SeatingChartConfig): D3SeatingChart;
}