UNPKG

agentjs-core

Version:

A comprehensive agent-based modeling framework with built-in p5.js visualization

94 lines (92 loc) 2.26 kB
import { SimulationController } from './SimulationController'; import { ParameterManager } from './ParameterManager'; /** * Control panel configuration */ export interface ControlPanelConfig { container: HTMLElement; position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; theme?: 'light' | 'dark'; collapsible?: boolean; showPerformanceStats?: boolean; showParameterControls?: boolean; } /** * HTML/CSS control panel for simulation management */ export declare class ControlPanel { private controller; private parameterManager?; private config; private container; private panelElement; private isCollapsed; private updateInterval; private elements; private themes; constructor(controller: SimulationController, config: ControlPanelConfig); /** * Set parameter manager for dynamic controls */ setParameterManager(parameterManager: ParameterManager): void; /** * Create the control panel HTML structure */ private createPanel; /** * Add CSS styles to the document */ private addStyles; /** * Apply theme colors */ private applyTheme; /** * Position the panel based on config */ private positionPanel; /** * Attach event listeners to controls */ private attachEventListeners; /** * Make the panel draggable */ private makeDraggable; /** * Update button states based on simulation state */ private updateButtonStates; /** * Create parameter controls dynamically */ private createParameterControls; /** * Start the update loop for performance stats */ private startUpdateLoop; /** * Update performance display */ private updatePerformanceDisplay; /** * Set theme */ setTheme(theme: 'light' | 'dark'): void; /** * Show the panel */ show(): void; /** * Hide the panel */ hide(): void; /** * Destroy the control panel */ destroy(): void; } /** * Factory function for creating control panels */ export declare function createControlPanel(controller: SimulationController, config: ControlPanelConfig): ControlPanel;