Skip to content

Commit d64f484

Browse files
committed
Merge pull request #1858 from palantir/release-v0.53.0
Release v0.53.0 (--> master)
2 parents 8b26951 + 1752e4e commit d64f484

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2863
-960
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "plottable",
33
"description": "A library for creating charts out of D3",
4-
"version": "0.52.0",
4+
"version": "0.53.0",
55
"main": ["plottable.js", "plottable.css"],
66
"license": "MIT",
77
"ignore": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "plottable.js",
33
"description": "A library for creating charts out of D3",
4-
"version": "0.52.0",
4+
"version": "0.53.0",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/palantir/plottable.git"

plottable.d.ts

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,27 @@ declare module Plottable {
130130
function darkenColor(color: string, factor: number, darkenAmount: number): string;
131131
function distanceSquared(p1: Point, p2: Point): number;
132132
function isIE(): boolean;
133+
/**
134+
* Returns true if the supplied coordinates or Extents intersect or are contained by bbox.
135+
*
136+
* @param {number | Extent} xValOrExtent The x coordinate or Extent to test
137+
* @param {number | Extent} yValOrExtent The y coordinate or Extent to test
138+
* @param {SVGRect} bbox The bbox
139+
* @param {number} tolerance Amount by which to expand bbox, in each dimension, before
140+
* testing intersection
141+
*
142+
* @returns {boolean} True if the supplied coordinates or Extents intersect or are
143+
* contained by bbox, false otherwise.
144+
*/
145+
function intersectsBBox(xValOrExtent: number | Extent, yValOrExtent: number | Extent, bbox: SVGRect, tolerance?: number): boolean;
146+
/**
147+
* Create an Extent from a number or an object with "min" and "max" defined.
148+
*
149+
* @param {any} input The object to parse
150+
*
151+
* @returns {Extent} The generated Extent
152+
*/
153+
function parseExtent(input: any): Extent;
133154
}
134155
}
135156
}
@@ -2682,13 +2703,13 @@ declare module Plottable {
26822703
*
26832704
* Here's a common use case:
26842705
* ```typescript
2685-
* plot.attr("r", function(d) { return d.foo; });
2706+
* plot.attr("x", function(d) { return d.foo; }, xScale);
26862707
* ```
2687-
* This will set the radius of each datum `d` to be `d.foo`.
2708+
* This will set the x accessor of each datum `d` to be `d.foo`,
2709+
* scaled in accordance with `xScale`
26882710
*
26892711
* @param {string} attrToSet The attribute to set across each data
2690-
* point. Popular examples include "x", "y", "r". Scales that inherit from
2691-
* Plot define their meaning.
2712+
* point. Popular examples include "x", "y".
26922713
*
26932714
* @param {Function|string|any} accessor Function to apply to each element
26942715
* of the dataSource. If a Function, use `accessor(d, i)`. If a string,
@@ -2801,31 +2822,15 @@ declare module Plottable {
28012822
getAllPlotData(datasetKeys?: string | string[]): PlotData;
28022823
protected _getAllPlotData(datasetKeys: string[]): PlotData;
28032824
/**
2804-
* Retrieves the closest PlotData for the specified dataset(s)
2825+
* Retrieves PlotData with the lowest distance, where distance is defined
2826+
* to be the Euclidiean norm.
28052827
*
2806-
* @param {Point} queryPoint The point to query from
2807-
* @param {number} withinValue Will only return plot data that is of a distance below withinValue
2808-
* (default = Infinity)
2809-
* @param {string | string[]} datasetKeys The dataset(s) to retrieve the plot data from.
2810-
* (default = this.datasetOrder())
2811-
* @returns {PlotData} The retrieved PlotData.
2828+
* @param {Point} queryPoint The point to which plot data should be compared
2829+
*
2830+
* @returns {PlotData} The PlotData closest to queryPoint
28122831
*/
2813-
getClosestPlotData(queryPoint: Point, withinValue?: number, datasetKeys?: string | string[]): {
2814-
data: any[];
2815-
pixelPoints: {
2816-
x: number;
2817-
y: number;
2818-
}[];
2819-
selection: D3.Selection;
2820-
};
2821-
protected _getClosestPlotData(queryPoint: Point, datasetKeys: string[], withinValue?: number): {
2822-
data: any[];
2823-
pixelPoints: {
2824-
x: number;
2825-
y: number;
2826-
}[];
2827-
selection: D3.Selection;
2828-
};
2832+
getClosestPlotData(queryPoint: Point): PlotData;
2833+
protected _isVisibleOnPlot(datum: any, pixelPoint: Point, selection: D3.Selection): boolean;
28292834
}
28302835
}
28312836
}
@@ -2957,6 +2962,7 @@ declare module Plottable {
29572962
};
29582963
protected _generateDrawSteps(): _Drawer.DrawStep[];
29592964
protected _getClosestStruckPoint(p: Point, range: number): Interaction.HoverData;
2965+
protected _isVisibleOnPlot(datum: any, pixelPoint: Point, selection: D3.Selection): boolean;
29602966
_hoverOverComponent(p: Point): void;
29612967
_hoverOutComponent(p: Point): void;
29622968
_doHover(p: Point): Interaction.HoverData;
@@ -3065,6 +3071,19 @@ declare module Plottable {
30653071
* @returns {Bar} The calling plot.
30663072
*/
30673073
barLabelFormatter(formatter: Formatter): Bar<X, Y>;
3074+
/**
3075+
* Retrieves the closest PlotData to queryPoint.
3076+
*
3077+
* Bars containing the queryPoint are considered closest. If queryPoint lies outside
3078+
* of all bars, we return the closest in the dominant axis (x for horizontal
3079+
* charts, y for vertical) and break ties using the secondary axis.
3080+
*
3081+
* @param {Point} queryPoint The point to which plot data should be compared
3082+
*
3083+
* @returns {PlotData} The PlotData closest to queryPoint
3084+
*/
3085+
getClosestPlotData(queryPoint: Point): PlotData;
3086+
protected _isVisibleOnPlot(datum: any, pixelPoint: Point, selection: D3.Selection): boolean;
30683087
/**
30693088
* Gets the bar under the given pixel position (if [xValOrExtent]
30703089
* and [yValOrExtent] are {number}s), under a given line (if only one
@@ -3109,6 +3128,7 @@ declare module Plottable {
31093128
_hoverOverComponent(p: Point): void;
31103129
_hoverOutComponent(p: Point): void;
31113130
_doHover(p: Point): Interaction.HoverData;
3131+
protected _getAllPlotData(datasetKeys: string[]): PlotData;
31123132
}
31133133
}
31143134
}
@@ -3135,14 +3155,6 @@ declare module Plottable {
31353155
[attrToSet: string]: (datum: any, index: number, userMetadata: any, plotMetadata: PlotMetadata) => any;
31363156
};
31373157
protected _wholeDatumAttributes(): string[];
3138-
protected _getClosestPlotData(queryPoint: Point, datasetKeys: string[], withinValue?: number): {
3139-
data: any[];
3140-
pixelPoints: {
3141-
x: number;
3142-
y: number;
3143-
}[];
3144-
selection: D3.Selection;
3145-
};
31463158
protected _getClosestWithinRange(p: Point, range: number): {
31473159
closestValue: any;
31483160
closestPoint: {
@@ -3151,6 +3163,17 @@ declare module Plottable {
31513163
};
31523164
};
31533165
protected _getAllPlotData(datasetKeys: string[]): PlotData;
3166+
/**
3167+
* Retrieves the closest PlotData to queryPoint.
3168+
*
3169+
* Lines implement an x-dominant notion of distance; points closest in x are
3170+
* tie-broken by y distance.
3171+
*
3172+
* @param {Point} queryPoint The point to which plot data should be compared
3173+
*
3174+
* @returns {PlotData} The PlotData closest to queryPoint
3175+
*/
3176+
getClosestPlotData(queryPoint: Point): PlotData;
31543177
_hoverOverComponent(p: Point): void;
31553178
_hoverOutComponent(p: Point): void;
31563179
_doHover(p: Point): Interaction.HoverData;

0 commit comments

Comments
 (0)