Text modification of default fill change in a tip

I don’t have the exactly proper language but when you create a tooltip there is a nice little element that appears that looks like this:

image

Can that be modified while still retaining that nice little blue box (which helps identify the group)?

I can modify a channel element like so:

Plot.plot({
  marks: [
    Plot.dot(cars, {
      x: "power (hp)",
      y: "economy (mpg)",
      fill: "cylinders",
      r: 5,
      tip: true,
      channels: {
        "cyl": d => `There are ${d["cylinders"]} cylinders in this car`
      }
    })
  ]
})

which produces:

image

But really I’d like to be able to modify the string where the blue box is.

I tried this but that did not modify it:

Plot.plot({
  marks: [
    Plot.dot(cars, {
      x: "power (hp)",
      y: "economy (mpg)",
      fill: "cylinders",
      r: 5,
      tip: d => `There are ${d["cylinders"]} cylinders in this car`
    })
  ]
})

Any idea if that top element (is it called something?) can be modified on the fly? I know I could modify the incoming string but I’d rather not.

You can use use tip: format

1 Like