[v1.7.0] GuideLineLayer, Selection on Rectangle and Segment Plots
This release introduces GuideLineLayer. GuideLineLayers span the entire plot vertically or horizontally, and can be used to indicate values of interest. EntitiesIn() for Plots.Rectangle and Plots.Segment has also been implemented for this release.
onKeyPress() has been fixed to only fire once when pressed, instead of continuously while a key is held down. Plots.Bar width calculations are now more stable in the case when a bar is off the edge of the screen. Formatters will throw errors when passed non-Integers. DragBoxLayer no longer shows move or resize cursors when disabled.
Features
GuideLineLayer
A GuideLineLayer draws a vertical or horizontal line at a specified value or pixel position. The GuideLineLayer fully occupies the Table cell it is placed in, much like SelectionBoxLayer. Multiple GuideLineLayers can be layered on Plots. It has the following API points:
class GuideLineLayer<D> extends Component {
constructor(orientation: string);
scale(): QuantitativeScale<D>;
scale(scale: QuantitativeScale<D>): GuideLineLayer<D>;
value(): D;
value(value: D): GuideLineLayer<D>;
pixelPosition(): number;
pixelPosition(pixelPosition: number): GuideLineLayer<D>;
}Try it out: http://jsfiddle.net/y8s1yaza/
entitiesIn() on Plots.Segment and Plots.Rectangle
Users can now query for Entities within a certain range or bounds on Plots.Segment and Plots.Rectangle:
/**
* Gets the Entities that intersect the Bounds.
*/
entitiesIn(bounds: Bounds): PlotEntity[];
/**
* Gets the Entities that intersect the area defined by the ranges.
*/
entitiesIn(xRange: Range, yRange: Range): PlotEntity[];
Try it out:
- Rectangle: http://jsfiddle.net/njt6en92/1/
- Segment: http://jsfiddle.net/njt6en92/2/
Miscellaneous
- AutoDomaining on a
Plots.Barnow extends the domain to account for the width of bars, instead of shrinking the bars on the edge. This eliminates the scenario where all bars are rendered with a very small width, because one is close to an edge.
Bugfixes
Formatters given a non-integer precision now throw an error. Previously the values were silently coerced, which caused unpredictable behavior. (#2527).- Bar width calculations for
Plots.Barno longer are affected by a bar being off the edge ofPlots. This means that when PanZooming on aPlots.Bar, the bars no longer shrink / flicker when the first and last bar cross the edges (#2545). DragBoxLayerwill no longer show move/resize cursors if it is notenabled()(#2542).Interactions.key.onKeyPress()only fires once, when the key is first pressed. Previously,onKeyPress()would fire continuously while the key was held down (#2499)


