Style mappers

Permission: Settings management

Style mapper is a simple configuration object which defines mappings of node or relationship attribute values to style values, e.g. color, width or shape. These style values are used for visualization styling/rendering. Defined style mapper objects are listed in "Style" tab in visualization where user can choose and apply them to style the visualization.

Style mappers setting is a collection of these style mapper objects.

Configuration

  1. Left menu - settings

  2. In panel "Settings list" use icon "Update" for setting "STYLE_MAPPERS".

  3. Enter JSON configuration and confirm by pressing "Save" button.

Default configuration

Default configuration contains no mappers.

  1. Left menu - settings

  2. In panel "Settings list" use icon "Update" for setting "STYLE_MAPPERS".

  3. Press button "Default" and store by pressing button "Save".

Automatic configuration

Automatic configuration contains no mappers. You can create appropriate mappers for users during administration process.

  1. Left menu - settings

  2. In panel "Settings list" use icon "Update" for setting "STYLE_MAPPERS".

  3. Press button "Automatic", wait for generator to generate JSON and store by pressing button "Save".

Description of configuration

Configuration is entered as JSON. Example of JSON:

[
{
"id" : "1",
"dataAttr" : "TYPE",
"label" : "Color by type",
"group" : "nodes",
"styleGroup" : "nodeColor",
"mapperType" : "discrete",
"style" : {
"background_color" : {
"TYPE_1" : "rgb(200,100,100)",
"TYPE_2" : {"dataAttr" : "another_attribure"},
"_notMapped_" : "rgb(0,0,0)",
"_undefined_" : "rgb(0,0,0)"
},
"border_width" : 0
}
},
{
"id" : "2",
"dataAttr" : "NUM_OF_INCIDDENTS",
"label" : "Num of Incidents",
"group" : "nodes",
"styleGroup" : "nodeColor",
"mapperType" : "linear",
"style" : {
"background_color" : {
"minData" : 0,
"minValue" : "#ccc",
"maxData" : 0,
"maxValue" : "#f00",
"_undefined_" : "#000"
},
"border_width" : 0,
"shape" : "roundrectangle"
}
}
]

Explanation of attributes:

  • "id" - mapper identification. Id can't start with space " " or exclamation mark "!". It's used for referencing purposes, e.g. in Style views setting. mandatory

  • "dataAttr" - data attribute which is mapped to style value. Should be one of the "dataAttr" values from "nodeAttributes" in Data schema. mandatory

  • "label" - label used in GUI. mandatory

  • "group" - "nodes" or "edges" - determines if this mapper is used to style nodes or relationships. mandatory

  • "styleGroup" - determines the styling group in GUI where this mapper will be available (tab Style in visualization). mandatory Possible values:

    • if "group" is set to "nodes" then possible values are "nodeIcon", "nodeColor", "nodeShape" and "nodeSize"

    • if "group" is set to "edges" then possible values are "edgeColor", "edgeType" and "edgeWidth"

  • "mapperType" - "discrete" or "linear". Discrete mapper is best used with data attributes which have "dataRole" set to "dimension" in Data schema. Linear mapper is best used with data attributes which have "dataRole" set to "metric" in Data schema. mandatory

  • "style" - mandatory - mapping from "dataAttr" values to style values. Mapping is defined as a set of style attributes which can be mapped to data attributes values in a few ways:

    • single value - when you want a style property to be equal for all elements (e.g. "border_width":0)

    • multiple values - "mapperType" has to be set to "discrete". This mapper is used when you want specific style value for specific data attribute value. In this case you have to define all data attribute values and their mapped style values. In case you want use a value of another attribute as the mapped style value, just put {"dataAttr":"<attr_name>"} as the mapped value (put the name of the other attribute in place of <attr_name>). There are also two special values:

      • "_notMapped_" - can be used to style all elements that have some value in "dataAttr" but the value is not mapped.

      • "_undefined_" - can be used to style all elements that do not have "dataAttr" defined.

    • range of values - "mapperType" has to be set to "linear". This mapper can be used only when you want a color or size transition according to numerical data attribute values. Transition is defined with 2 data points which have associated 2 style values and the mapper calculates style values for elements according to these 2 points. Definition of these points is as follows:

      • "minData" - "dataAttr" value which is associated with lower transition definition point. If not defined or set to null then the minimal value from all elements in visualization is used.

      • "maxData" - "dataAttr" value which is associated with higher transition definition point. If not defined or set to null then the maximal value from all elements in visualization is used.

      • "minValue" - styling value associated with lower transition definition point. mandatory

      • "maxValue" - styling value associated with higher transition definition point. mandatory

      • "_undefined_" - styling value used for elements with "dataAttr" not defined or set to null.