UNPKG

psychart

Version:

View air conditions on a psychrometric chart

77 lines (76 loc) 2.12 kB
import { Chart } from '../chart'; import { PumpchartDataOptions, PumpchartOptions, PumpchartState } from './types'; /** * Show a pump's relationship between flow rate and pressure at different operating conditions. */ export declare class Pumpchart extends Chart<PumpchartOptions> { /** * Layers of the SVG as groups. */ private readonly g; /** * The pump curve `h = p(q)` */ private readonly p; /** * The system curve `h = s(q)` */ private readonly s; /** * The maximum flow rate shown on the x-axis */ private readonly maxFlow; /** * The maximum head pressure shown on the y-axis */ private readonly maxHead; /** * Get the ideal axis interval */ private static getStep; constructor(options?: Partial<PumpchartOptions>); /** * Convert a state to an (x,y) coordinate. * @param state Any state in this system * @returns An (x,y) coordinate on the screen */ private state2xy; /** * Create a SVG path element from an array of states. * @param data An array of states * @param closePath Whether or not to close the path * @returns A `<path>` element containing the array of states */ private createPath; /** * Draw an axis label * @param content Label text content * @param location Label location (state) * @param color Label font color * @param anchor Label text anchor * @param tooltip Optional tooltip text on mouse hover */ private drawLabel; /** * Draw a curve `h = f(q)` on the curves layer. */ private drawCurve; /** * Draw a custom circle onto any layer. */ private drawCircle; /** * Scale a function. */ private scale; /** * Plot a single data point. * @param state The current state of the system * @param config Display options for plotting data */ plot(state: PumpchartState, config?: Partial<PumpchartDataOptions>): void; /** * Clear all the data from this chart. */ clearData(): void; }