1.0.0 Release Candidate 3
Pre-releaseOverview
Why 1.0.0?
There are a number of known issues in the Plottable API that require breaking backwards compatibility to fix. That means there are a number of backwards-incompatible changes in this release. We are working hard to remedy these problems, and get the API in a state that will allow us to maintain backwards compatibility for all releases after v1.0.0.
To provide the best experience to our users, we are rolling out incremental release candidate releases to allow for pre-integration testing. These release candidates are not meant for production, but are meant as testing resources.
Theme of the 1.0.0-rc series
Because of the breaking changes between v0.54.0 and v1.0.0, our goal is that these release candidates will help make the upgrade as smooth as possible for you all, by allowing you to test early, and often.
Please test with these release candidates and make sure you're able to migrate to the new feature set without losing functionality. If you encounter any issues, please file issues here.
A description of the major changes is below. Full instructions on migrating from v0.54.0 to v1.0.0 will be kept updated in our Upgrading to 1.0.0 Guide
API Changes between 1.0.0-rc2 and 1.0.0-rc3
The changes below outline updates to the API that were not included in the 1.0.0-rc2 release.
public _methodNameHere
methods
The following methods are no longer public
:
getAnimator()
onStackedAreaPlot
is nowprotected
(inline with all the classes in the inheritance tree)_timeoutMsec
onRendererPolicies.Timeout
is nowprivate
_autoDomainIfAutomaticMode()
on theQuantitativeScale
is nowprotected
Label
constructor takes angle
The Label
angle can now be set in the constructor:
var label = new Plottable.Components.Label("My Label", 0);
Valid angles are -90, 0 (horizontal), and 90.
Plots.Rectangle
Plots.Grid
has been removed. Its functionality has been folded intoPlots.Rectangle
Plots.Rectangle
has four property setters:.x()
,.x2()
,.y()
,.y2()
. Thex()
/x2()
properties use the sameScale
, as do they()
/y2()
properties.
Utils.Stacked
The class has been simplified:
- Renamed
Plottable.StackedPlotUtils
->Plottable.Utils.Stacked
- Documentation added
keyAccessor()
method removed as it was implementingPlot
logicvalueAccessor()
method removed as it was implementingPlot
logiccheckSameDomainForStacks()
moved toPlots.StackedArea
as it was only used theredomainKeys()
nowpublic
Axes.Numeric
showEndTickLabel()
has been removed. The function in its current state did not do anything and it did not seem to be tested at all, meaning that it looks like dead functionality.
Drawer
- Constructor takes in a
Dataset
instead of astring
key _getPixelPoint()
has been removed.
Drawers.Rect
drawText()
has been removedremoveLabels()
has been removed_getIfLabelsTooWide()
has been removed
Cleaning up CSS files
Some unused CSS classes have been removed from plottable.css. Changes can be seen here.
Retrieve internal Drag
Interaction
from DragBoxLayer
dragInteraction()
can be used to retrieve the internalDrag
Interaction
fromDragBoxLayer
. One possible use of this feature is to disable drag functionality temporarily:
dragBoxLayer.dragInteraction().detachFrom(dragBoxLayer); // disable
dragBoxLayer.dragInteraction().attachTo(dragBoxLayer); // enable
Plot
s
getAllSelections()
no longer takes in a booleanexclude
parameter as an the second parameter.
To getSelection
s for a certain subset ofDataset
s:
var datasetsToExclude = [...];
var datasetExclusionFilter = function(dataset) { return datasetsToExclude.indexOf(dataset) === -1; }
var unexcludedDatasets = plot.datasets().filter(datasetExclusionFilter);
plot.getAllSelections(unexcludedDatasets);
Plot
s no longer take Scale
s in the constructor
The X and Y Scale
s were already being passed in through .x()
, .y()
, so their inclusion in the constructor was redundant.
Previously:
var plot = new Plottable.Plots.Bar(xScale, yScale);
Now:
var plot = new Plottable.Plots.Bar();
The new constructor
signatures are:
new Plottable.Plot()
new Plottable.XYPlot<type, type>()
new Plottable.Plots.Pie()
<- unchangednew Plottable.Plots.Bar<type, type>(orientation?)
new Plottable.Plots.StackedBar<type, type>(orientation?)
new Plottable.Plots.ClusteredBar<type, type>(orientation?)
new Plottable.Plots.Line<type>()
new Plottable.Plots.Area<type>()
new Plottable.Plots.StackedArea<type>()
new Plottable.Plots.Rectangle<type, type>()
new Plottable.Plots.Scatter<type, type>()
Upgrade Regex
- FIND:
(\.Plots\.[^\(]*\()[^,\)]*(, )?[^\),]*(, )*
- REPLACE:
$1
In addition to this, the following method signatures have been changed to not require a Scale
anymore. The Scale
was redundant because it was already specified on the respective .x()
, .y()
Plots.Area.y0(y0?: number | Accessor<number>): any
Plots.Rectangle.x2(x2?: number | Accessor<number> | X | Accessor<X>): any
Plots.Rectangle.y2(y2?: number | Accessor<number> | Y | Accessor<Y>): any
PlotData
--> Entity
The PlotData
type has been removed. Methods that previously returned PlotData
now use the Entity
type:
export type Entity = {
datum: any;
index: number;
dataset: Dataset;
position: Point;
selection: D3.Selection;
plot: Plot;
}
The names of corresponding methods have been changed:
getAllPlotData()
-->entities()
:
public entities(datasets = this.datasets()): Plots.Entity[];
getClosestPlotData()
-->entityNearest()
:
public entityNearest(queryPoint: Point): Plots.Entity;
On Plots.Bar
, getBars()
has been split into:
public entitiesAt(p: Point): Entity[];
and
public entitiesIn(bounds: Bounds): Entity[];
public entitiesIn(xRange: Range, yRange: Range): Entity[];
Key differences:
Entity
corresponds to exactly one datum and its visual representation on the screen.- The
Dataset
containingdatum
, as well asdatum
's index in thatDataset
, have been included. - The originating
Plot
for theEntity
is also included, which may be helpful if theEntity
is saved off somewhere after it has been created.
RenderPolicy
.setRenderPolicy()
no longer takes aRenderPolicy
. The following stringy enums are available.
export module Policy {
export var IMMEDIATE = "immediate";
export var ANIMATION_FRAME = "animationframe";
export var TIMEOUT = "timeout";
}
Animator
- All plot
Animator
s now have keys of "main" and "reset" for theAnimator.Baseline()
andAnimator.Null()
states, respectively.