plot icon indicating copy to clipboard operation
plot copied to clipboard

Waffle mark tooltips are always on axis line

Open ericvdtoorn opened this issue 1 year ago • 1 comments

image

Ideally, the tooltip should show up if and only if you're hovering on the 2seater group

Basic Repro

// mpg can be downloaded from https://gist.github.com/omarish/5687264/raw/7e5c814ce6ef33e25d5259c1fe79463c190800d9/mpg.csv
const mpg = FileAttachment("data/mpg.csv").csv({typed:true});
const sql = await DuckDBClient.sql({mpg: mpg}) 

Tr

select class, round(100 * count(*) / (select count(*) from mpg) ) as n from mpg group by class order by count(*);
Plot.plot({
    axis: null,
    title: "Waffle Chart",
    subtitle: "'Class of vehicles",
    marks: [
        Plot.waffleX(perc, {
                    x: "n",
                    fill: "class",
                    multiple: 10,
                    tip: true
                    })
    ],
    color: {legend: true},
    height: 400

ericvdtoorn avatar Aug 08 '24 22:08 ericvdtoorn

Yes, we’re aware it works like this. Not sure it’s fixable given how the underlying coordinate system is defined (band scale), but we might be able to do something.

mbostock avatar Aug 08 '24 23:08 mbostock