new GroupNode(params)
Creates an HTML marker node used by CIQ.Marker.Group
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | Parameters to describe the marker Properties
|
- Since:
-
- 9.2.0
Methods
-
getDateLabel(marker)
-
Returns the display label for a grouped marker x position. Returns an empty string if marker x parameter is not a valid date object or tick position.
Parameters:
Name Type Description marker
CIQ.Marker The marker within the group with x positioner to display
- Since:
-
9.3.0
Returns:
Formatted date string.
- Type
- string
-
getGroupMarkerBackgroundColor()
-
Returns background color choice for the group marker. Default function returns the most commonly occurring color amongst the grouped markers or, the first color if all colors occur equally. Overload to apply custom group marker color choice.
- Since:
-
9.3.0
Returns:
A valid css color value.
- Type
- string
Example
function () { // Default to a neutral grey. let backgroundColor = "#828382"; // Get the color of the first marker in the group. let firstMarker = this.groupMap.markers.sort(this.markerSortFunction)[0]; let visual = firstMarker.node.querySelector(".stx-visual"); if(visual) backgroundColor = getComputedStyle(visual).backgroundColor; return backgroundColor; };
-
handleClick(e)
-
Toggles "highlight" state of marker
Parameters:
Name Type Description e
Event Marker interaction event handler
- Since:
-
9.2.0
-
handleMenuClick(marker, e)
-
Displays a marker expansion for the group marker. If the expansion is already displayed, it is removed.
Parameters:
Name Type Description marker
CIQ.Marker The marker to display or hide the expansion.
e
Event Marker interaction event handler
- Since:
-
9.3.0
-
markerSortFunction(a, b)
-
Sort function used when sorting the grouped markers array. Default function sorts markers chronologically from newest to oldest. Overload to implement a custom sort in the grouped markers list.
Parameters:
Name Type Description a
CIQ.Marker The first element for comparison.
b
CIQ.Marker The second element for comparison.
- Since:
-
9.3.0
Returns:
A negative value indicates that a should come before b. A positive value indicates that a should come after b. Zero or NaN indicates that a and b are considered equal.
- Type
- number
Example
function (a, b) { if (a.params.x instanceof Date && b.params.x instanceof Date) return b.params.x - a.params.x; }
-
setExpansionHolderVisibility()
-
Set visibility style of the group expansion holder based on whether it is empty or not
- Since:
-
9.2.0
-
updateMarkerList()
-
Updates the listing of grouped markers in the expansion. Called when a group marker is clicked.
- Since:
-
9.2.0
-
updateVisual()
-
Updates the marker label and color. Label represents the number of individual markers in the group. Color represents the the first color, or most frequent color, of markers in the group.
- Since:
-
9.2.0