Create a tooltup using the d3.tip Javascript library.
More...
#include <d3_init.h>
|
| ToolTip () |
| Default constructor - displays whatever data is bound on mouseover. More...
|
|
| ToolTip (std::string func) |
|
void | SetHtml (std::string func) |
|
int | GetID () const |
|
void | Log () const |
|
Create a tooltup using the d3.tip Javascript library.
Default constructor - displays whatever data is bound on mouseover.
D3::ToolTip::ToolTip |
( |
std::string |
func | ) |
|
|
inline |
Cosntructor that allows you to specify a function that returns the html for the tooltip. As input, this function should take 3 parameters: the bound data, the index of this item in the selection (int), and a placeholder (int).
Example:
`D3::FormatFunction rounded = D3::FormatFunction(".2f");
std::function<double, int, int)> tooltip_display = [this](double d, int i, int k) {return "Data: " + to_string(rounded(d));}
D3::ToolTip tip = D3::ToolTip(tooltip_display);
D3::Selection example_selection = D3::SelectAll("circle");
example_selection.SetupToolTip(tip);'
Mousing over a circle in the example selection will display "Data: " followed by the value of d, rounded to two decimal points.
int D3::D3_Base::GetID |
( |
| ) |
const |
|
inlineinherited |
void D3::D3_Base::Log |
( |
| ) |
const |
|
inlineinherited |
void D3::ToolTip::SetHtml |
( |
std::string |
func | ) |
|
|
inline |
The documentation for this class was generated from the following file: