vega-lite icon indicating copy to clipboard operation
vega-lite copied to clipboard

Bump Scale for bar/rect (marks with "length")

Open kanitw opened this issue 9 years ago • 11 comments

{
  "marktype": "bar",
  "enc": {
    "x": {"type": "Q","name": "*","aggr": "count"},
    "y": {"type": "O","name": "Wildlife__Species"},
    "row": {"bin": true,"type": "Q","name": "Cost__Total_$"}
  },
  "cfg": {"dataUrl": "data/birdstrikes.json","vegaServerTable": "birdstrikes_json"}
}

Can't see bars in most plots. Some groups are missing, which I assume because there are zero tuples in those facets. However, some groups include plots but with no visible data. I can't tell if this is an error or if the values are really so small that nothing is visible. In the latter case, we should do something to ensure visibility of small (e.g., 1px) data amounts?

kanitw avatar Feb 18 '15 22:02 kanitw

The correct fix is labels or tooltips. See https://github.com/uwdata/vegalite/issues/240

domoritz avatar Feb 25 '15 05:02 domoritz

I disagree. You cannot mouseover a point when it's 0 pixel.

kanitw avatar Feb 25 '15 05:02 kanitw

Two solutions. 1. set minimum width to 1px. 2. always add 1px to the width.

domoritz avatar Feb 25 '15 05:02 domoritz

I start wondering if this should be solve in vega level?

For exactly 0 value, it should be 0px. For small number > 0, 1px?

kanitw avatar Feb 25 '15 05:02 kanitw

This seems a vega level issue.

domoritz avatar Feb 25 '15 05:02 domoritz

let’s punt on this for now then. — moved to should have ...

kanitw avatar Feb 25 '15 17:02 kanitw

add our own scale to vg.config.scale, call it bumpscale

domoritz avatar Mar 05 '15 18:03 domoritz

Let's close this.

kanitw avatar Jul 09 '16 19:07 kanitw

Run into a case where this would be useful again in the pilots.

kanitw avatar Sep 03 '16 18:09 kanitw

Closing as we probably won't get to include this special scale.

It might be worth thinking if we want to do special condition like we might do for size.

https://github.com/vega/vega-lite/issues/3488

kanitw avatar May 09 '18 18:05 kanitw

Re-open since

  1. we can do conditional encoding to achieve this.
  2. we can decouple "length" handling from size handling in #3488

kanitw avatar Aug 09 '22 02:08 kanitw