Hi,
I’m making my first steps in vega-lite, inside observarble-
I have forked a choropleth map, I have changed the source data and the tooltips.
Formerly the tooltip was one (delta
) field and I have added one (name
):
vl.tooltip([vl.fieldN('name'),vl.fieldQ('delta')])
Now I would like to reach a simple goal, to render the tooltip in this way: the name value + ', ' + delta value
, something like “Clark, 0.022”.
How to do it?
Thank you
--
You received this message because you are subscribed to the Google Groups "vega-js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vega-js+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vega-js/29cb74d6-694c-4fd5-bd28-efce54db1aban%40googlegroups.com.
Hi Grant and thank you.
On Sat, 6 Feb 2021 at 21:28, Grant Pezeshki grantp...@gmail.com wrote:
Hi, I forked your example to show a method to customize tooltips using a calculate transform.
It works!
This is hinted at in the docs but took me a minute to figure out how to implement in the vega-lite api.
It’s “only” hinted. There is no “hello world” example and I have not been able to figure out how to do it by myself. For this I asked here.
Hope it gives you an option!
It gives me an option, yes, thank you again.
But I want to add a sub question? Is it possible to use some HTML, to have in example a word in bold?
If I use in example vl.calculate("'<b>'+datum.name+'</b>, '+datum.delta").as('calctt')
, it’s not rendered as bold, but I have the string <b>
.
Best regards