meteoJS/thermodynamicDiagram/plotDataArea
Source: thermodynamicDiagram/
Child class
Abstract types
Class
PlotDataArea
Abstract types
filterDataPoint(pointData, lastPointData)
Filter data point before drawing.
Parameters
Name | Type | Optional | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pointData |
Object |
|
Point data. Values in
|
||||||||||||||||
lastPointData |
Object |
|
Data of the last point. Values in
|
getCoordinatesByLevelData(dataGroupId, sounding, levelData, plotArea) → Object
Returns x and y coordinates in the Plot-Area for the passed levelData.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataGroupId |
string |
|
Data group id. |
sounding |
module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding |
|
Corresponding sounding. |
levelData |
|
Level data of the sounding. |
|
plotArea |
module:meteoJS/thermodynamicDiagram/plotDataArea.PlotDataArea |
|
Plot-Area. |
- Returns
-
Object
- Containing x and y.
getHoverSounding(soundings) → (undefined or module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding)
For the returned sounding, the hover labels are shown. As input all currently visible soundings are passed.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
soundings |
Array of module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding |
|
Currently visible soundings. Array length is always at least 1. |
- Returns
-
(undefined or module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding)
For this returned sounding, the hover labels are shown. No hover labes are shown, if undefined is returned.
getLevelData(options) → module:meteoJS/sounding~levelData
Getter for the levelData of a certain DiagramSounding according to an event.
Parameters
Name | Type | Optional | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
|
Options. Values in
|
- Returns
-
module:meteoJS/sounding~levelData
The data to show in the label. This data is passed tomodule:meteoJS/thermodynamicDiagram/plotDataArea~insertLabelsFunc
.
getSoundingVisibility(sounding) → boolean
Visibility of the sounding in an area.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
sounding |
module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding |
|
Sounding to determine its visibility. |
- Returns
-
boolean
Visibility.
hoverLabelsOptions Object
Options for labels on hovering the plot area.
Properties
Name | Type | Optional | Description |
---|---|---|---|
visible |
boolean |
Yes |
Visibility. Defaults to |
type |
string |
Yes |
Event type. Defaults to |
maxDistance |
number |
Yes |
Maximum distance to a data point to show a hover label in pixels. If undefined, always a hover label to the nearest point is shown. |
remote |
boolean |
Yes |
Show labels relative to the mouse position on the diagram, even when the pointer isn't directly on the plot area. Defaults to |
insertLabelsFunc |
module:meteoJS/thermodynamicDiagram/plotDataArea~insertLabelsFunc |
Yes |
Called to insert labels into a SVG group. |
getLevelData |
module:meteoJS/thermodynamicDiagram/plotDataArea~getLevelData |
Yes |
. |
getHoverSounding |
module:meteoJS/thermodynamicDiagram/plotDataArea~getHoverSounding |
Yes |
Default: Return the first sounding of the passed input array. |
insertDataGroupInto(svgNode, dataGroupId, sounding, data, plotArea)
Draws data into a SVG node.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
svgNode |
|
Insert sounding data into this SVG node. |
|
dataGroupId |
string |
|
Data group id. |
sounding |
module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding |
|
Corresponding sounding. |
data |
Array of Object |
|
Data of the sounding, containing x and y coordinates and levelData. |
plotArea |
module:meteoJS/thermodynamicDiagram/plotDataArea.PlotDataArea |
|
Plot-Area. |
insertLabelsFunc(sounding, levelData, group)
Function to insert labels.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
sounding |
module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding |
|
Diagram sounding to label. |
levelData |
|
Data to label. |
|
group |
|
SVG group to insert labels. |
insertSoundingEvent module:meteoJS/thermodynamicDiagram/plotDataArea~soundingEvent
Event with a sounding object and its SVG node.
Property
Name | Type | Optional | Description |
---|---|---|---|
node |
|
SVG node, SVG.G. |
options module:meteoJS/thermodynamicDiagram/plotArea~options
Options for the constructor.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
getSoundingVisibility |
module:meteoJS/thermodynamicDiagram/plotDataArea~getSoundingVisibility |
Yes |
Takes a sounding object and returns the visibility for the area. |
dataGroupIds |
Array of string |
Yes |
IDs of several grouped datas. Defaults to |
getCoordinatesByLevelData |
module:meteoJS/thermodynamicDiagram/plotDataArea~getCoordinatesByLevelData |
Yes |
Coordinate function. |
insertDataGroupInto |
module:meteoJS/thermodynamicDiagram/plotDataArea~insertDataGroupInto |
Yes |
SVG drawing function. |
filterDataPoint |
(undefined or module:meteoJS/thermodynamicDiagram/plotDataArea~filterDataPoint) |
Yes |
Function to filter data points, that shouldn't be plotted. If undefined, no data point is filtered (expect minDataPointsDistance is set). |
minDataPointsDistance |
number |
Yes |
Minimum distance between data points in pixels. If filterDataPoint is set, minDataPointsDistance is ignored. Defaults to |
Property
Name | Type | Optional | Description |
---|---|---|---|
hoverLabels |
module:meteoJS/thermodynamicDiagram/plotDataArea~hoverLabelsOptions |
Yes |
Hover labels options. |
soundingEvent Object
Event with a sounding object.
Property
Name | Type | Optional | Description |
---|---|---|---|
sounding |
module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding |
|
Sounding. |
Events
add:sounding module:meteoJS/thermodynamicDiagram/plotDataArea~soundingEvent
Fired on adding a sounding.
postinsert:sounding module:meteoJS/thermodynamicDiagram/plotDataArea~insertSoundingEvent
Fired after inserting the sounding data into the svg.
preinsert:sounding module:meteoJS/thermodynamicDiagram/plotDataArea~insertSoundingEvent
Fired before inserting the sounding data into the svg.
remove:sounding module:meteoJS/thermodynamicDiagram/plotDataArea~soundingEvent
Fired on removing a sounding.