Skip to content

Commit

Permalink
Merge pull request #1751 from palantir/release-v0.49.0
Browse files Browse the repository at this point in the history
Release v0.49.0 (--> master)
  • Loading branch information
jtlan committed Mar 20, 2015
2 parents 5f40d42 + 92bc791 commit 58fdd0b
Show file tree
Hide file tree
Showing 22 changed files with 1,395 additions and 61 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plottable",
"description": "A library for creating charts out of D3",
"version": "0.48.1",
"version": "0.49.0",
"main": ["plottable.js", "plottable.css"],
"license": "MIT",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plottable.js",
"description": "A library for creating charts out of D3",
"version": "0.48.1",
"version": "0.49.0",
"repository": {
"type": "git",
"url": "https://github.com/palantir/plottable.git"
Expand Down
135 changes: 127 additions & 8 deletions plottable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ declare module Plottable {
function colorTest(colorTester: D3.Selection, className: string): string;
function lightenColor(color: string, factor: number): string;
function darkenColor(color: string, factor: number, darkenAmount: number): string;
function distanceSquared(p1: Point, p2: Point): number;
}
}
}
Expand Down Expand Up @@ -2772,6 +2773,33 @@ declare module Plottable {
* @returns {PlotData} The retrieved PlotData.
*/
getAllPlotData(datasetKeys?: string | string[]): PlotData;
protected _getAllPlotData(datasetKeys: string[]): PlotData;
/**
* Retrieves the closest PlotData for the specified dataset(s)
*
* @param {Point} queryPoint The point to query from
* @param {number} withinValue Will only return plot data that is of a distance below withinValue
* (default = Infinity)
* @param {string | string[]} datasetKeys The dataset(s) to retrieve the plot data from.
* (default = this.datasetOrder())
* @returns {PlotData} The retrieved PlotData.
*/
getClosestPlotData(queryPoint: Point, withinValue?: number, datasetKeys?: string | string[]): {
data: any[];
pixelPoints: {
x: number;
y: number;
}[];
selection: D3.Selection;
};
protected _getClosestPlotData(queryPoint: Point, datasetKeys: string[], withinValue?: number): {
data: any[];
pixelPoints: {
x: number;
y: number;
}[];
selection: D3.Selection;
};
}
}
}
Expand Down Expand Up @@ -2861,6 +2889,31 @@ declare module Plottable {
}


declare module Plottable {
module Plot {
class Rectangle<X, Y> extends AbstractXYPlot<X, Y> {
/**
* Constructs a RectanglePlot.
*
* A RectanglePlot consists of a bunch of rectangles. The user is required to
* project the left and right bounds of the rectangle (x1 and x2 respectively)
* as well as the bottom and top bounds (y1 and y2 respectively)
*
* @constructor
* @param {Scale.AbstractScale} xScale The x scale to use.
* @param {Scale.AbstractScale} yScale The y scale to use.
*/
constructor(xScale: Scale.AbstractScale<X, any>, yScale: Scale.AbstractScale<Y, any>);
protected _getDrawer(key: string): _Drawer.Rect;
protected _generateAttrToProjector(): {
[attrToSet: string]: (datum: any, index: number, userMetadata: any, plotMetadata: PlotMetadata) => any;
};
protected _generateDrawSteps(): _Drawer.DrawStep[];
}
}
}


declare module Plottable {
module Plot {
class Scatter<X, Y> extends AbstractXYPlot<X, Y> implements Interaction.Hoverable {
Expand Down Expand Up @@ -2888,30 +2941,27 @@ declare module Plottable {

declare module Plottable {
module Plot {
class Grid extends AbstractXYPlot<string, string> {
class Grid extends Rectangle<any, any> {
/**
* Constructs a GridPlot.
*
* A GridPlot is used to shade a grid of data. Each datum is a cell on the
* grid, and the datum can control what color it is.
*
* @constructor
* @param {Scale.Category} xScale The x scale to use.
* @param {Scale.Category} yScale The y scale to use.
* @param {Scale.AbstractScale} xScale The x scale to use.
* @param {Scale.AbstractScale} yScale The y scale to use.
* @param {Scale.Color|Scale.InterpolatedColor} colorScale The color scale
* to use for each grid cell.
*/
constructor(xScale: Scale.Category, yScale: Scale.Category, colorScale: Scale.AbstractScale<any, string>);
constructor(xScale: Scale.AbstractScale<any, any>, yScale: Scale.AbstractScale<any, any>, colorScale: Scale.AbstractScale<any, string>);
addDataset(keyOrDataset: any, dataset?: any): Grid;
protected _getDrawer(key: string): _Drawer.Rect;
/**
* @param {string} attrToSet One of ["x", "y", "fill"]. If "fill" is used,
* @param {string} attrToSet One of ["x", "y", "x2", "y2", "fill"]. If "fill" is used,
* the data should return a valid CSS color.
*/
project(attrToSet: string, accessor: any, scale?: Scale.AbstractScale<any, any>): Grid;
protected _generateAttrToProjector(): {
[attrToSet: string]: (datum: any, index: number, userMetadata: any, plotMetadata: PlotMetadata) => any;
};
protected _generateDrawSteps(): _Drawer.DrawStep[];
}
}
Expand Down Expand Up @@ -3059,13 +3109,22 @@ declare module Plottable {
[attrToSet: string]: (datum: any, index: number, userMetadata: any, plotMetadata: PlotMetadata) => any;
};
protected _wholeDatumAttributes(): string[];
protected _getClosestPlotData(queryPoint: Point, datasetKeys: string[], withinValue?: number): {
data: any[];
pixelPoints: {
x: number;
y: number;
}[];
selection: D3.Selection;
};
protected _getClosestWithinRange(p: Point, range: number): {
closestValue: any;
closestPoint: {
x: number;
y: number;
};
};
protected _getAllPlotData(datasetKeys: string[]): PlotData;
_hoverOverComponent(p: Point): void;
_hoverOutComponent(p: Point): void;
_doHover(p: Point): Interaction.HoverData;
Expand Down Expand Up @@ -3521,6 +3580,18 @@ declare module Plottable {
* @return {Dispatcher.Mouse} The calling Dispatcher.Mouse.
*/
onMouseUp(key: any, callback: MouseCallback): Dispatcher.Mouse;
/**
* Registers a callback to be called whenever a wheel occurs,
* or removes the callback if `null` is passed as the callback.
*
* @param {any} key The key associated with the callback.
* Key uniqueness is determined by deep equality.
* @param {WheelCallback} callback A callback that takes the pixel position
* in svg-coordinate-space.
* Pass `null` to remove a callback.
* @return {Dispatcher.Mouse} The calling Dispatcher.Mouse.
*/
onWheel(key: any, callback: MouseCallback): Dispatcher.Mouse;
/**
* Returns the last computed mouse position.
*
Expand Down Expand Up @@ -3710,6 +3781,54 @@ declare module Plottable {
}


declare module Plottable {
module Interaction {
class Pointer extends Interaction.AbstractInteraction {
_anchor(component: Component.AbstractComponent, hitBox: D3.Selection): void;
/**
* Gets the callback called when the pointer enters the Component.
*
* @return {(p: Point) => any} The current callback.
*/
onPointerEnter(): (p: Point) => any;
/**
* Sets the callback called when the pointer enters the Component.
*
* @param {(p: Point) => any} callback The callback to set.
* @return {Interaction.Pointer} The calling Interaction.Pointer.
*/
onPointerEnter(callback: (p: Point) => any): Interaction.Pointer;
/**
* Gets the callback called when the pointer moves.
*
* @return {(p: Point) => any} The current callback.
*/
onPointerMove(): (p: Point) => any;
/**
* Sets the callback called when the pointer moves.
*
* @param {(p: Point) => any} callback The callback to set.
* @return {Interaction.Pointer} The calling Interaction.Pointer.
*/
onPointerMove(callback: (p: Point) => any): Interaction.Pointer;
/**
* Gets the callback called when the pointer exits the Component.
*
* @return {(p: Point) => any} The current callback.
*/
onPointerExit(): (p: Point) => any;
/**
* Sets the callback called when the pointer exits the Component.
*
* @param {(p: Point) => any} callback The callback to set.
* @return {Interaction.Pointer} The calling Interaction.Pointer.
*/
onPointerExit(callback: (p: Point) => any): Interaction.Pointer;
}
}
}


declare module Plottable {
module Interaction {
class PanZoom extends AbstractInteraction {
Expand Down
Loading

0 comments on commit 58fdd0b

Please sign in to comment.