Home > composition-plot > QuaternaryShellPlot
A class in charge of drawing a quaternary composition plot into an SVG element.
This class relies on multiple instances of the BasePlot class to perform the actual drawing. For each shell in the quaternary plot, 4 BasePlots will be created. The QuaternaryShellPlot will be in charge of placing the plots appropriately on the same SVG element, as well as broadcasting events to/from each plot.
Signature:
declare class QuaternaryShellPlot
Constructor | Modifiers | Description |
---|---|---|
(constructor)(svg, dp, id) | The constructor of the QuaternaryShellPlot |
Property | Modifiers | Type | Description |
---|---|---|---|
avoidDuplicates | boolean | ||
borderColorFn | (sample: ISample, dp: DataProvider) => RGBColor | ||
borderWidthFn | (sample: ISample, dp: DataProvider) => number | ||
colorFn | (sample: ISample, dp: DataProvider) => RGBColor | ||
dp | DataProvider | ||
edgeUnit | number | ||
enableTooltip | boolean | ||
finalShell | number | ||
id | string | ||
initialShell | number | ||
labelColorFn | (element: string) => RGBColor | ||
margin | number | ||
maxWidth | number | ||
onSelect | (sample: ISample) => void | ||
opacityFn | (sample: ISample, dp: DataProvider) => number | ||
origin | Vec2 | ||
plots | BasePlot[] | ||
sampleRadius | number | ||
sampleShape | SampleShape | ||
spacing | number | ||
svg | HTMLElement |
Method | Modifiers | Description |
---|---|---|
_setShellData(plots, constValue) | Private method | |
broadCast(fn) | Broadcast a function call on each BasePlot held by this Quaternary plot | |
dataUpdated() | The data in the DataProvider have changed, redraw the entire plot | |
initialize() | Allocates and places the various BasePlots. | |
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 | |
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 | |
setPlacement(initialShell, finalShell, spacing, edgeUnit, origin, maxWidth, margin) | Initialize the placement of the quaternary plot | |
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 | |
setShellsData() | Private method |