UNPKG

psychart

Version:

View air conditions on a psychrometric chart

102 lines (101 loc) 2.9 kB
import { Chart } from '../chart'; import { Flow, Head, Power, DataOptions, Options, State, Speed } from './types'; /** * Show a pump's relationship between flow rate and pressure at different operating conditions. */ export declare class Pumpchart extends Chart<Options> { /** * Layers of the SVG as groups. */ private readonly g; /** * 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; /** * Get the list of all available units for flow. * @returns A list of units */ static getFlowUnits(): Flow[]; /** * Get the list of all available units for head. * @returns A list of units */ static getHeadUnits(): Head[]; /** * Get the list of all available units for speed. * @returns A list of units */ static getSpeedUnits(): Speed[]; /** * Get the list of all available units for power. * @returns A list of units */ static getPowerUnits(): Power[]; /** * Create a new Pumpchart with custom options. * @param options Customization options for the new Pumpchart. */ constructor(options?: Partial<Options>); /** * 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; /** * Represents the pump curve `h = p(q)` * @param q Flow rate * @param speed Pump speed * @returns Head gained by the fluid by the pump */ private p; /** * Represents the system curve `h = s(q)` * @param q Flow rate * @returns Head loss from the fluid by the system */ private s; /** * Plot a single data point. * @param state The current state of the system * @param config Display options for plotting data */ plot(state: State, config?: Partial<DataOptions>): void; /** * Clear all the data from this chart. */ clearData(): void; }