Home > composition-plot > BasePlot
A class in charge of drawing a composition plot into an SVG element.
This class is fairly general, and relies on the following in order to customize the layout and appearance of the plot: - a color function - an opacity function - a vertices function - a sample position function - etc.
Signature:
declare class BasePlot
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(svg, dp, id) | The constructor of the BasePlot |
| Property | Modifiers | Type | Description |
|---|---|---|---|
| _polygonFn | (nPoints: number, phase?: number) => (sample: ISample) => [number, number][] | ||
| borderColorFn | (sample: ISample, dp: DataProvider) => RGBColor | ||
| borderWidthFn | (sample: ISample, dp: DataProvider) => number | ||
| colorFn | (sample: ISample, dp: DataProvider) => RGBColor | ||
| compositionSpace | string[] | undefined | ||
| dataGroup | Selection<BaseType, {}, null, undefined> | ||
| dataTooltip | Selection<BaseType, unknown, HTMLElement, unknown> | ||
| dp | DataProvider | ||
| enableTooltip | boolean | ||
| gridGroup | Selection<BaseType, {}, null, undefined> | ||
| id | string | ||
| labelColorFn | (element: string) => RGBColor | ||
| mouseDown | boolean | ||
| onSelect | (sample: ISample) => void | ||
| opacityFn | (sample: ISample, dp: DataProvider) => number | ||
| range | number[][] | ||
| rootGroup | Selection<BaseType, {}, null, undefined> | ||
| samplePositionFn | SamplePositionFn | ||
| sampleRadius | number | ||
| sampleShape | SampleShape | ||
| spacing | number[] | ||
| svg | HTMLElement | ||
| verticesFn | VerticesFn |
| Method | Modifiers | Description |
|---|---|---|
| dataUpdated() | ||
| drawData() | Draw the graphical elements associated to the samples and figures of merit | |
| drawGrid() | Draw the graphical elements associated to the plot grid | |
| release() | Remove all the graphical elements associated with this plot from the SVG element | |
| render() | Redraw all the graphical elements in the SVG | |
| setBorderColorFn(fn) | Set the border color function | |
| setBorderWidthFn(fn) | Set the border width function | |
| setColorFn(fn) | Set the color function | |
| setCompositionSpace(compositionSpace) | Set the composition space of this plotThe composition space is the list of elements that a sample can be expected to have in its composition | |
| setEnableTooltip(enable) | Enable/disable the tooltip that is displayed when hovering a sample | |
| setLabelColorFn(fn) | Set the label color function | |
| setOpacityFn(fn) | Set the opacity function | |
| setSampleRadius(radius) | Set the radius of a sample circle/hexagon/square | |
| setSampleShape(shape) | Set the shape that will be used to draw samples | |
| setSelectCallback(fn) | Set a callback function that will be invoked when a sample is clicked |