Philipp_Kats
Philipp_Kats

Reputation: 4212

Vega: compute tooltip key from a signal

Apparently, tooltip object accepts (computes) signals in the values, but not the objects, and does not work well with {[signal]: value} notation.

Is there any alternative way to set the tooltip keys dynamically, based on the vega signal?

Upvotes: 2

Views: 233

Answers (1)

Philipp_Kats
Philipp_Kats

Reputation: 4212

for now “hacked” it through custom sanitize function for the vegaTooltip:

function mySanitize(value){
    return String(value).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace('METRIC', VIEW.signal('metric'))
};

Upvotes: 1

Related Questions