Skip to content

Commit

Permalink
Prepare release 3.5.4 (#3405)
Browse files Browse the repository at this point in the history
* Prepare release 3.5.4

* Deprecate entitiesIn. Use names entitiesInBounds, entitiesInXBound, entitiesInYBounds.
  • Loading branch information
themadcreator authored Sep 12, 2017
1 parent fc8311d commit 18f27df
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plottable",
"description": "A modular charting library built on D3",
"version": "3.5.3",
"version": "3.5.4",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/core/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export type Bounds = {
};

/**
* Client bounds
* Client bounds in pixel-space.
*/
export interface IEntityBounds {
x: number;
Expand Down
26 changes: 18 additions & 8 deletions src/plots/plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -869,13 +869,17 @@ export class Plot extends Component {
}

/**
* @deprecated Use `entitiesInBounds` instead
*
* Gets the Entities that intersect the Bounds.
*
* @param {Bounds} bounds
* @returns {PlotEntity[]}
*/
public entitiesIn(bounds: Bounds): Plots.IPlotEntity[];
/**
* @deprecated Use `entitiesInBounds` instead
*
* Gets the Entities that intersect the area defined by the ranges.
*
* @param {Range} xRange
Expand Down Expand Up @@ -907,6 +911,8 @@ export class Plot extends Component {

/**
* Returns the entites whose bounding boxes overlap the parameter.
*
* `queryBounds` are in pixel space, measured from the origin of this plot.
*/
public entitiesInBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[] {
const found = this._getEntityStore().entitiesInBounds(queryBounds);
Expand All @@ -917,23 +923,27 @@ export class Plot extends Component {
}

/**
* Returns the entites whose bounding boxes overlap the parameter on the
* x-axis.
* Returns the entites whose bounding boxes overlap the `queryBounds`
* parameter on the x-axis.
*
* `queryBounds` are in pixel space, measured from the origin of this plot.
*/
public entitiesInXRange(queryBounds: IEntityBounds): Plots.IPlotEntity[] {
const found = this._getEntityStore().entitiesInXRange(queryBounds);
public entitiesInXBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[] {
const found = this._getEntityStore().entitiesInXBounds(queryBounds);
if (!found) {
return undefined;
}
return found.map((entity) => this._lightweightPlotEntityToPlotEntity(entity));
}

/**
* Returns the entites whose bounding boxes overlap the parameter on the
* y-axis.
* Returns the entites whose bounding boxes overlap the `queryBounds`
* parameter on the y-axis.
*
* `queryBounds` are in pixel space, measured from the origin of this plot.
*/
public entitiesInYRange(queryBounds: IEntityBounds): Plots.IPlotEntity[] {
const found = this._getEntityStore().entitiesInYRange(queryBounds);
public entitiesInYBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[] {
const found = this._getEntityStore().entitiesInYBounds(queryBounds);
if (!found) {
return undefined;
}
Expand Down
8 changes: 4 additions & 4 deletions src/utils/entityStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ export interface IEntityStore<T extends IPositionedEntity> {
*
* @param {IEntityBounds} [bounds] The query bounding box.
*/
entitiesInXRange(bounds: IEntityBounds): T[];
entitiesInXBounds(bounds: IEntityBounds): T[];

/**
* Returns the entites whose bounding boxes overlap the parameter on the
* y-axis.
*
* @param {IEntityBounds} [bounds] The query bounding box.
*/
entitiesInYRange(bounds: IEntityBounds): T[];
entitiesInYBounds(bounds: IEntityBounds): T[];

/**
* Returns the current internal array of all entities.
Expand Down Expand Up @@ -129,11 +129,11 @@ export class EntityStore<T extends IPositionedEntity> implements IEntityStore<T>
return this._rtree.intersect(RTreeBounds.entityBounds(bounds));
}

public entitiesInXRange(bounds: IEntityBounds) {
public entitiesInXBounds(bounds: IEntityBounds) {
return this._rtree.intersectX(RTreeBounds.entityBounds(bounds));
}

public entitiesInYRange(bounds: IEntityBounds) {
public entitiesInYBounds(bounds: IEntityBounds) {
return this._rtree.intersectY(RTreeBounds.entityBounds(bounds));
}

Expand Down

1 comment on commit 18f27df

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prepare release 3.5.4 (#3405)

Demo: quicktests | fiddle

Please sign in to comment.