NetworkLayer
Description
The network layer visualizes connected data as nodes and links. See the Network Layer docs for details.
NetworkLayer
Constructors
new NetworkLayer(def)
Creates a new instance of the layer.
Parameters
Initial data to load into this layer. Data can be changed after instantiation via layer.data()
.
Initial options to set on this layer. Options can be changed after instantiation via layer.options()
or layer.resetOptions()
.
Returns
Properties
A unique id of the layer.
Methods
data(data)
Gets or sets the current data for this layer.
Parameters
The layer data to be displayed.
Returns
getTrackerNodePositions()
Get the tracker nodes and their geographic positions.
Returns
An object containing the tracker nodes, their geographic positions and whether they coincide with any trajectories.
options(options)
Gets or sets the layer options while preserving any previously set options.
Parameters
The layer options to be set.
Returns
An object containing all layer options and their current values.
pin(newPins)
Pins the specified nodes on the map.
When you drag a pinned node and release it, the pin is removed.
To keep the pin in place, call pin()
in the handler of the drag-end
event.
Parameters
The nodes to be pinned.
Returns
An object containing all the pinned nodes and their coordinates.
resetOptions(options)
Sets the provided layer options while resetting any other previously set options to default values.
Parameters
The layer options to be set.
Returns
ComboLinkDefinition
A definition of a combo link returned by the onCombineLinks function. See the Proximity combining docs for details.
Properties
The unique identifier.
The identity of the node at one end of the combo link.
The identity of the node at the other end of the combo link.
A dictionary of links included in the combo link, indexed by link id.
A function to style the combo.
Parameters
The styling to be used.
Returns
ComboNodeDefinition
A definition of a combo link returned by the onCombineNodes function. See the Proximity combining docs for details.
Properties
The unique identifier.
A dictionary of nodes included in the combo node, indexed by node id.
A function to style the combo.
Parameters
The styling to be used.
Returns
NetworkGraphEngine
The graph engine returned by getGraphEngine or createGraphEngine functions.
Methods
betweenness(options)
Measures the number of times a node lies on the shortest path between other nodes. Shows important nodes that would have the greatest impact on the network connectivity if removed.
Parameters
Defines how the results should be normalized. Normalization divides the results to ensure that values are between 0 and 1. This avoids extremes and creates a more proportional range e.g. for styling.
- 'chart' - Divides the scores of all nodes in the graph by a single value.
- 'component' - Divides the scores of each unconnected part of a graph separately and by a different value.
- 'unnormalized' - No normalization is used.
The key of the custom data value on the node's data property that defines each link's length.
Returns
A dictionary of items where the keys are the node ids and the values are their betweenness values.
components()
Calculates the separate 'connected components' of the graph.
Returns
An array of objects in the format:
[
{ nodeIds: [...], linkIds: [...] },
{ nodeIds: [...], linkIds: [...] },
...
]
degrees(options)
Measures the number of direct, 'one hop' connections each node has to other nodes within the network. Shows very connected nodes which can quickly connect with the wider network.
Parameters
The key of the custom data value on the node's data property that defines each link's value.
Returns
A dictionary of items where the keys are the node ids and the values are their degrees values.
NetworkItem
A node or link that can appear in a NetworkLayer.
NetworkItemLabel
Specifies the style of a link label.
Properties
The color of the label background.
The label border.
The border color.
The outer radius for label border corners. Specified in pixels as a single number or an array of four numbers. If an array is used, the corners are defined in the order of top left, top right, bottom right and bottom left.
The border width in pixels.
The color of the label text.
The font family to use for the label text.
The font size to use for the label text.
The text to display on the label.
NetworkLayerData
A dictionary of items to be displayed in a NetworkLayer, where the keys are item ids and the values are NetworkItem
objects.
NetworkLayerOptions
Options related to the network layer.
Properties
Options related to adaptive opacity, which changes the opacity of nodes and links to highlight the most important items. Nodes are assigned an opacity based on their internally calculated betweenness score which can be adjusted for zoom level. Links match the highest opacity of their associated nodes.
Whether adaptive opacity is enabled.
The zoom level at which the item opacity level will be at 100% and all items will be fully visible. Must be in the range 0 to 22 where 0 is fully zoomed out and 22 is fully zoomed in.
The minimum opacity applied when adaptive opacity is enabled. Must be in the range 0 to 1 where 0 is transparent and 1 is fully visible.
The number of visible nodes over which opacity fades to minimumOpacity
.
Options related to foregrounding and backgrounding of nodes and links, which emphasizes foregrounded items by fading the rest into the background.
The opacity level to apply to backgrounded items.
The id(s) of item(s) to be foregrounded. If specified, the items not included in the array are backgrounded. If empty, all items are foregrounded.
Options related to node and link labels.
Options related to label collision, which hides labels that overlap with other labels.
Whether hiding labels on collision is enabled.
Minimum height of a label required to draw it, in pixels.
Minimum length of a link required to draw its label, in pixels.
If view
has a pitch
or bearing
set manually or if viewRotation
is enabled, defines how the labels are oriented in relation to the user's screen.
If true, the labels face the user's screen. If false, the labels lie flat on the surface of the map.
Options related to links.
Options related to link bundling, which adjusts the paths of links by grouping the neigboring links together into bundles.
Whether link bundling is enabled.
The maximum number of links for which link bundling is applied.
If true, links are drawn as arcs along great circle paths to represent the shortest distance in 3D space.
Options related to nodes.
Options related to adaptive scaling of nodes, which sizes nodes based on their internally calculated betweenness scores.
Whether adaptive scaling is enabled.
Minimum scale for a unique (i.e. all pairwise similarities = 0) fixed (geolocated) node.
Minimum scale for a unique (i.e. all pairwise similarities = 0) free (non-geolocated) node.
Minimum size for a node image to be displayed, in pixels.
Options related to combining nodes and links based on their proximity to each other at a given zoom level.
Whether combining of fixed (geo-located) nodes and their links is enabled.
A function called by the NetworkLayer when a combo link is created. Use it to style the combo link.
Parameters
An object containing the information about the created combo link and a setStyle
styling function.
Returns
A function called by the NetworkLayer when a combo node is created. Use it to style the combo node.
Parameters
An object containing the information about the created combo node and a setStyle
styling function.
Returns
The distance threshold that determines which nodes are grouped together, in pixels.
NetworkLink
Defines a link connecting two nodes in the NetworkLayer.
Properties
A multiplier of link height. The default value of 0 creates flat links. If set to a higher value, the link is shown as a 3D arc raised above the map surface. The height multiplier is based on the distance between the two ends.
If used with a combo link, lists the child links contained within this combo link. This property is only used when accessing combo links created via proximityCombine.
The line color of the link.
Used to store custom data for the link.
The identity of the node at one end of the link.
The identity of the node at the other end of the link.
Properties for the link's label.
The type of the item.
The line width of the link in pixels.
NetworkNode
Defines a node in the NetworkLayer that can be connected to other nodes using links.
Properties
The altitude of the node in meters above sea level.
If used with a combo node, lists the child nodes contained within this combo node. This property is only used when accessing combo nodes created via proximityCombine.
The fill color of the node.
Used to store custom data for the node.
The image on the node.
The horizontal offset for the image in pixels.
The vertical offset for the image in pixels.
The scale factor for the image.
The URL of the node image. Unavailable images are shown as a blue X. If requesting images directly from external domains, consider restrictions on Cross-Origin Resource Sharing.
The label or labels on the node.
The latitude of a fixed (geolocated) node in degrees. Should be in the range -90 to 90.
The longitude of a fixed (geolocated) node in degrees. Should be in the range -180 to 180.
Scales the node size by an enlargement factor.
The radius of the node in pixels.
The type of the item.
NetworkNodeLabel
Specifies the style of a node label.
Properties
The color of the label background.
The label border.
The border color.
The outer radius for label border corners. Specified in pixels as a single number or an array of four numbers. If an array is used, the corners are defined in the order of top left, top right, bottom right and bottom left.
The border width in pixels.
The color of the label text.
The font family to use for the label text.
The font size to use for the label text.
The label position:
- number - an integer number of degrees clockwise from the top
- CompassPoint - e.g. 'n', 'ne' or 'se'
- "center" - positions the label at the center of the node
The distance between the node and the label. Measured from the node center to the closest point of the label to the node center. If not specified, the label is placed at the edge of the node. Ignored if position
is "center".
The text to display on the label.
NodePositions
A dictionary of nodes, where the keys are node ids and the values are LngLatAlt
objects.
TrackerNodePosition
Defines the geographic position of a tracker node and whether it coincides with any trajectories.
Properties
Altitude of a geographic position in meters.
Whether a tracker node has a geographic position that coincides with any trajectories. If true, the tracker node is visible.
Longitude of a geographic position in degrees [-180°, 180°].
Latitude of a geographic position in degrees [-90°, 90°].
TrackerNodePositions
A dictionary of nodes, where the keys are node ids and the values are TrackerNodePosition
objects.
A reference to the
data
object it was most recently passed.