Tooltip helpers
markLabelSet(tooltip, labelName)
Records that a tooltip's label was set through its setter, so a chart never replaces it with the one it would choose. The tooltip's label setters call this.
Kind: global function
| Param | Type | Description |
|---|---|---|
| tooltip | Object | The tooltip module |
| labelName | String | The label's setter name, such as 'topicLabel' |
applyChartLabels(tooltip, labels)
Sets the labels a chart needs on a tooltip, leaving the ones its user set
Kind: global function
| Param | Type | Description |
|---|---|---|
| tooltip | Object | The tooltip module |
| labels | Object | The labels the chart needs, by setter name |
registerTooltipGroup(tooltip, group)
Records the group a tooltip drew itself in. The tooltip calls this each time it builds one.
Kind: global function
| Param | Type | Description |
|---|---|---|
| tooltip | Object | The tooltip module |
| group | Element | The tooltip's group |
claimTooltip(chart, tooltip)
Makes a chart the tooltip's only chart. Throws when another chart has it: a tooltip draws into one chart, and a second chart would move it between them on every draw.
Kind: global function
| Param | Type | Description |
|---|---|---|
| chart | Object | The chart module |
| tooltip | Object | The tooltip module |
releaseTooltip(chart, tooltip)
Takes a tooltip off a chart: stops the chart's events from reaching it, removes the group it drew, and frees it for another chart
Kind: global function
| Param | Type | Description |
|---|---|---|
| chart | Object | The chart module |
| tooltip | Object | The tooltip module |
connectTooltip(chart, tooltip, svg, labels, [toDataPoint])
Connects a tooltip to a chart that has drawn: sets the labels the chart needs, follows the chart's pointer and keyboard events, and draws the tooltip into the chart's vertical marker, or its metadata group when it has no marker. The handlers go under their own namespace, so the user's handlers on the same events keep running.
Kind: global function
| Param | Type | Description |
|---|---|---|
| chart | Object | The chart module |
| tooltip | Object | The tooltip module |
| svg | D3Selection | The chart's svg |
| labels | Object | The labels the chart needs |
| [toDataPoint] | function | Turns what the chart sends into the data point the tooltip shows |