rerun-io / rerun

Visualize streams of multimodal data. Free, fast, easy to use, and simple to integrate. Built in Rust.
https://rerun.io/
Apache License 2.0
7.06k stars 353 forks source link

Allow to specify boundaries for BarChart #4764

Open roym899 opened 10 months ago

roym899 commented 10 months ago

BarChart currently only supports discrete equal size bins starting with 0. It would be nice to support arbitrary x boundaries and hence bars of varying width.

juanma-rm commented 1 week ago

Also interested in that feature (defining the X range to increase flexibility and specifying bar widths). Any progress towards that goal?

I found a (very limited) workaround to map each Y to a specific X value: following the documentation it says "x values will be the indices of the array, and the bar heights will be the provided values"; thus, you can create an empty array with as many positions as needed to encompass maximum positive X (e.g. 100 long array), all elements initialized to zero, and then set those elements (array[50] = 10, array[55] = 20). That way you can map X-Y (only works for positive X and would require very large unused space of memory if X values go too high).

PS: great job with rerun, looks pretty interesting and useful.