Implement Plot.Histogram
Requires users to define the size of the buckets for the histogram relative to the axes. Start position for the buckets can be inferred from the scale. Should work with most scales, though primary targets will be CategoryScale (formerly OrdinalScale) and TimeScale to start.
This implementation will not handle auto-bucketing. This is because we don't want to be guessing at what users actually want in terms of buckets. For example, with TimeAxis, it is hard to judge whether a user wants to operate at the day, month, or even year level of granularity. Users are expected to bucket their data prior to adding the data to Plottable.
Was implemented as a consequence of #1711
How is Plot.Histogram implemented?
With a GridPlot. On the x-axis, use x and x2. On the y-Axis, use y = 0 and y2 = value. I suppose the latter could be more explicit...if you feel this warrants a separate plot feel free to reopen.
I think this might warrant further discussion mainly to get the semantics correct and to make usage not confusing. Note this as a workaround though for users that want immediate histogram behavior.
@rcchen How is this different from a bar plot where users specify
plot.x(function(d) { return Math.floor(d.x / bucket_size) * bucket_size }, xScale)
You could do that; it would also have to bucket the yValues of all the bars together (or toss out bars except for the first bar in the range), but there's also an issue of labels on the axis. Histograms are best thought of as having category scales where the categories represent ranges.
So we still want this idea in or we can close it? I believe you can do that with bar plot and category scales as you suggested, so a new type of plot is not really needed.
Doing it with Plots.Bar and Scales.Category is a hack, not an actual solution. Histograms should be spanning Scales.Linear or other Quantitative scales.