ia.PlotLayer Class
The base class for scatter plot layers.
Constructor
ia.PlotLayer
()
Item Index
Methods
- _addToSelection
- _clearCanvas
- _clearHighlightGraphics
- _clearLabelGraphics
- _clearLayerGraphics
- _clearSelectionGraphics
- _dispatchItemEvent
- _drawItem
- _getCorrelation
- _hitTest
- _itemEventHandler
- _mapEventHandler
- _removeFromSelection
- _renderItem
- _setItemShape
- _setLabelStyle
- _triggerRenderSelection
- addCanvases
- addEventListener
- clear
- clearHighlight
- clearItems
- clearSelection
- createCanvas
- dispatchEvent
- getColorData
- getData
- getItem
- getSizeData
- getVisible
- getXData
- getYData
- hideTip
- highlight
- highlightItem
- hitItem
- isSelected
- loadSource
- removeCanvases
- removeListener
- render
- renderSelection
- select
- selectAll
- selectItem
- setColorData
- setData
- setMap
- setSizeData
- setVisible
- setXData
- setYData
- showTip
- tipFunction
- unselect
- update
Properties
- animationMode
- bBox
- canvas
- context
- correlationInfo
- dataChanged
- dataField
- doHitTest
- highlightCanvas
- highlightColor
- highlightContext
- id
- interactive
- isLoaded
- itemArray
- items
- labelContext
- map
- name
- pointSize
- selectionCanvas
- selectionColor
- selectionContext
- selectionIds
- showCorrelationLine
- showDataTips
- showInLayerList
- showLabels
- style
- symbol
- tip
- xDataField
- xMaxValue
- xMinValue
- yDataField
- yMaxValue
- yMinValue
Methods
_addToSelection
-
id
Adds an id to the selection.
Parameters:
-
idStringThe id of the item.
_clearCanvas
-
c -
ctx
Clears a canvas.
Parameters:
-
cHTML CanvasThe canvas to clear.
-
ctxHTML Canvas ContextIts context.
_clearHighlightGraphics
()
private
Clears the highlight canvas.
_clearLabelGraphics
()
private
Clears the label canvas.
_clearLayerGraphics
()
private
Clears the layer canvases.
_clearSelectionGraphics
()
private
Clears the selection canvas.
_dispatchItemEvent
-
event -
isHit -
item
The hit logic for items in the layer.
Parameters:
-
eventia.MapMouseEventA
ia.MapMouseEvent. -
isHitBooleanIndicates if the item was hit.
-
itemObjectThe item that was hit.
_drawItem
-
item -
ctx
Does the actual drawing.
Parameters:
-
itemObjectThe item.
-
ctxHTML Canvas ContextThe context to render to.
_getCorrelation
()
Object
private
Get correlation information.
Returns:
_hitTest
-
event
Runs a hit test on the layer.
Parameters:
-
eventia.MapMouseEventA
ia.MapMouseEvent.
_itemEventHandler
-
event
Handles default selection / highlight functionality.
Parameters:
-
eventia.ItemEventAn
ia.ItemEventdispatched by this layer.
_mapEventHandler
-
event
Handles when to carry out hit tests.
Parameters:
-
eventia.MapMouseEventA
ia.MapMouseEvent.
_removeFromSelection
-
id
Removes an id from the selection.
Parameters:
-
idStringThe id of the item.
_renderItem
-
item
Renders the item to the given context.
Parameters:
-
itemObjectThe item.
_setItemShape
-
item
Sets an items dimensions.
Parameters:
-
itemObjectThe item.
_setLabelStyle
()
private
Sets the label style.
_triggerRenderSelection
()
private
Triggers a selection render. Prevents over rendering which results in a frozen browser.
addCanvases
()
Adds drawing canvases for the layer when the layer is shown. This method was introduced to fix a bug a chrome when multiple canvases were affecting rendering. It basically reduces the number of unused canvases which are taking up memory.
addEventListener
-
eventType -
fnc -
obj
Add an event listener.
Parameters:
-
eventTypeStringThe type of event to listen for.
-
fncFunctionThe function to call when the event occurs.
-
objObjectAn optional parent object.
clear
()
Clears all canvases in the layer.
clearHighlight
()
Clears all highlights.
clearItems
()
Clears the item list.
clearSelection
()
Clears all selections.
createCanvas
()
HTML Canvas
Creates a new canvas.
Returns:
dispatchEvent
-
event
Dispatch an event to the listeners.
Parameters:
-
eventObjectThe event object.
getColorData
()
Id:"eh11", name:"polwarth", value:2345, associate1:25
Gets a data object for the color.
Returns:
getData
()
Id:"eh11", name:"polwarth", value:2345, associate1:25
Gets a data object for the layer.
Returns:
getItem
-
id
Gets an item with the given id.
Parameters:
-
idStringThe id of the item to get.
getSizeData
()
Id:"eh11", name:"polwarth", value:2345, associate1:25
Gets a data object for the size.
Returns:
getVisible
()
Boolean
Gets the visibility of the layer.
Returns:
getXData
()
Id:"eh11", name:"polwarth", value:2345, associate1:25
Gets a data object for the x-axis.
Returns:
getYData
()
Id:"eh11", name:"polwarth", value:2345, associate1:25
Gets a data object for the y-axis.
Returns:
hideTip
()
Hides the tip.
highlight
-
id
Hightlights an item.
Parameters:
-
idStringThe id of the item to highlight.
highlightItem
-
item
Highlights the item.
Parameters:
-
itemObjectThe item.
hitItem
-
item -
event
Runs a hit test on an item.
Parameters:
-
itemObjectThe item to hit test.
-
eventia.MapMouseEventAn
ia.MapMouseEvent.
isSelected
-
id
Checks if an id is selected
Parameters:
-
idStringThe id of the item.
loadSource
()
Loads the source data.
removeCanvases
()
Removes drawing canvases for the layer when the layer is hidden. This method was introduced to fix a bug a chrome when multiple canvases were affecting rendering. It basically reduces the number of unused canvases which are taking up memory.
removeListener
-
obj
Removes all event listeners for the given object.
Parameters:
-
objObjectThe object.
render
()
Renders the data.
renderSelection
()
Renders the selection canvas.
select
-
id
Selects an item.
Parameters:
-
idStringThe id of the item.
selectAll
()
Selects all the items in the layer.
selectItem
-
item
Selects the item.
Parameters:
-
itemObjectThe item.
setColorData
()
Id:"eh11", name:"polwarth", value:2345, associate1:25
Sets a data object for the color.
Returns:
setData
-
value
Sets a data object for the layer.
Parameters:
-
valueId:"eh11", name:"polwarth", value:2345, associate1:25["eh11"]
["eh12"]{id:"eh12", name:"morningside", value:4347, associate1:45}
["eh13"]{id:"eh13", name:"merchiston", value:2496, associate1:25}
setMap
-
map -
map
Sets the map and canvas for the layer.
Parameters:
-
mapia.MapThe map.
-
mapHTML ElementThe container.
setSizeData
()
Id:"eh11", name:"polwarth", value:2345, associate1:25
Sets a data object for the size.
Returns:
setVisible
-
value
Sets the visibility of the layer.
Parameters:
-
valueBooleantrue/false.
setXData
-
value
Sets a data object for the x-axis.
Parameters:
-
valueId:"eh11", name:"polwarth", value:2345, associate1:25["eh11"]
["eh12"]{id:"eh12", name:"morningside", value:4347, associate1:45}
["eh13"]{id:"eh13", name:"merchiston", value:2496, associate1:25}
setYData
-
value
Sets a data object for the y-axis.
Parameters:
-
valueId:"eh11", name:"polwarth", value:2345, associate1:25["eh11"]
["eh12"]{id:"eh12", name:"morningside", value:4347, associate1:45}
["eh13"]{id:"eh13", name:"merchiston", value:2496, associate1:25}
showTip
-
item -
event
Displays the tip for the passed item
Parameters:
-
itemObjectThe map item.
-
eventia.ItemEventAn
ia.ItemEvent.
tipFunction
-
item
Supplies the default text for the layer. This can be replaced with a custom function
Parameters:
-
itemObjectThe map item.
unselect
-
id
Unselects an item.
Parameters:
-
idStringThe id of the item.
update
()
Updates the data.
Properties
animationMode
Boolean
Animation mode.
Default: false
canvas
HTML Canvas
The canvas associated with this layer.
context
HTML Canvas Context
The canvas context associated with this layer.
correlationInfo
Object
Correlation info.
An object with the properties o.correlationCoeff, o.rSquare, o.gradient, o.intercept or null.
dataChanged
Boolean
Indicates the data has changed.
Default: false
dataField
String
Specifies the field of the data provider that provides the values.
Default: "value"
doHitTest
Boolean
Indicates whether to carry out a hit test.
Default: true
highlightCanvas
HTML Canvas
The highlight canvas associated with this layer.
highlightColor
String
The item highlight color.
Default: "#00ff00"
highlightContext
HTML Canvas Context
The highlight canvas context associated with this layer.
id
String
The id of the layer.
Default: ""
interactive
Boolean
Is selection and highlighting switched on.
Default: false
isLoaded
Boolean
Indicates whether the layer is loaded.
Default: false
itemArray
Object
An array containing the layer items.
items
Associative Array
An associate array containing the layer items.
labelContext
HTML Canvas Context
The label canvas context associated with this layer.
name
String
The name of the layer.
Default: ""
pointSize
Number
The point size.
Default: 6
selectionCanvas
HTML Canvas
The selection canvas associated with this layer.
selectionColor
String
The item selection color.
Default: "#ff0000"E
selectionContext
HTML Canvas Context
The selection canvas context associated with this layer.
selectionIds
String
An array of selected ids.
showCorrelationLine
Boolean
Should the correlation line be displayed.
Default: false
showDataTips
Boolean
Are data tips displayed.
Default: trueE
showInLayerList
Boolean
Should the layer be displayed ina layer list.
Default: false
showLabels
Boolean
Show labels.
Default: false
style
Object
The layer style.
Default: {fillStyle:'#ffffff', strokeStyle:'#888888', lineWidth:'2', lineJoin:'round'}
symbol
String
The label canvas associated with this layer.
Default: ia.Shape.SQUARE
tip
String
The data tip - used by charts that have fixed tip templates.
Default: ""
xDataField
String
Specifies the field of the data provider that provides the x values.
Default: "value"
xMaxValue
Number
The max x value.
xMinValue
Number
The min x value.
yDataField
String
Specifies the field of the data provider that provides the y values.
Default: "value"
yMaxValue
Number
The max y value.
yMinValue
Number
The min y value.