Class: CustomMetric

CustomMetric

CustomMetric is a class to represent custom metrics of the user

Constructor

new CustomMetric(formulaFontSize, domainFontSize, rangeFontSize, formulaFontColor, domainFontColor, rangeFontColor, formulaLinkWidth, domainLinkWidth, rangeLinkWidth)

Parameters:
Name Type Description
formulaFontSize string The formula to calculate the font size of the nodes
domainFontSize array The domain from which to map to the range of font sizes
rangeFontSize array The range of font sizes to map the domain to
formulaFontColor string The formula to calculate the font color of the nodes
domainFontColor array The domain from which to map to the range of font colors
rangeFontColor array The range of font colors to map the domain to
formulaLinkWidth string The formula to calculate the width of the links
domainLinkWidth array The domain from which to map to the range of link widths
rangeLinkWidth array The range of link widths to map the domain to
Source:

Methods

getFontColor(node)

determines the font-color for the given node according to this metric
Parameters:
Name Type Description
node object A single node of a graph
Source:
Returns:
the font-color

getFontSize(node)

determines the font-size for the given node according to this metric
Parameters:
Name Type Description
node object A single node of a graph
Source:
Returns:
the font-size

getLinkWidth(link)

determines the width for the given link according to this metric
Parameters:
Name Type Description
link object A single link of a graph
Source:
Returns:
the link-width

setDomains(nodes, links)

determines the domains of the ranges for the visual link- and node-properties
Parameters:
Name Type Description
nodes array All nodes of a graph
links array All links of a graph
Source: