psychart
Version:
View air conditions on a psychrometric chart
105 lines (104 loc) • 2.78 kB
TypeScript
import { DataOptions, Options, Region, State } from './types.js';
import { Chart } from '../chart.js';
/**
* Generates an interactive psychrometric chart with plotting capabilities.
*/
export declare class Psychart extends Chart<Options> {
/**
* Defines the string representations of the current unit system.
*/
private readonly units;
/**
* Defines a scaling factor for humidity ratio.
*/
private readonly scaleFactor;
/**
* Represents the legend for Psychart.
*/
private readonly legend;
/**
* Legend definitions, which contains linear gradients.
*/
private readonly legendDefs;
/**
* The base element for adding lines in the legend.
*/
private readonly legendg;
/**
* Defines all the groups in the SVG ordered by layer.
*/
private readonly g;
/**
* The data series plotted on Psychart with each of their last states and visibility toggles.
*/
private series;
/**
* The serial number for identified points.
*/
private pointId;
/**
* Helper function to return an array of region names and their corresponding tooltips.
*/
static getRegionNamesAndTips(): [Region, string][];
/**
* Convert from Celsius to Fahrenheit.
*/
private static CtoF;
/**
* Get a range of numbers used for an axis.
*/
private static getRange;
/**
* Construct a new instance of `Psychart` given various configuration properties.
*/
constructor(options?: Partial<Options>);
/**
* Interpolate between "corner" psychrometric states.
*/
private interpolate;
/**
* Generate SVG path data from an array of psychrometric states.
*/
private setPathData;
/**
* Create an SVG circle element.
*/
private createCircle;
/**
* Draw an axis line given an array of psychrometric states.
*/
private drawAxis;
/**
* Create a line to append onto a parent element.
*/
private createLine;
/**
* Draw an axis label.
*/
private drawLabel;
/**
* Add a line to the legend.
*/
private addToLegend;
/**
* Compute the height of the legend, in pixels.
*/
private getLegendHeight;
/**
* Plot one psychrometric state onto the psychrometric chart.
*/
plot(state: State, config?: Partial<DataOptions>): void;
/**
* Draw a shaded region on Psychart.
*/
private drawRegion;
/**
* Clear all plotted data from Psychart.
*/
clearData(): void;
/**
* Calculate the (x,y) coordinates for any state.
* Note: Relative humidity must be in range [0.0-1.0]
*/
getXY(state: State): import("./types.js").Point;
}