1.0.0 Release Candidate 6
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.
d3.d.ts update
DefinitelyTyped has accepted our corrections to the d3.d.ts file, so tsd
can again be used to update definitions. It is no longer necessary to use the copy of d3.d.ts from the Plottable repository.
API Changes between 1.0.0-rc5 and 1.0.0-rc6
Generalized Entity
Entity
is now generic on the Component
type:
export interface Entity<C extends Component> {
datum: any;
position: Point;
selection: d3.Selection<any>;
component: C;
}
And Plots.PlotEntity
extends Entity
:
interface PlotEntity extends Entity<Plot> {
dataset: Dataset;
index: number;
component: Plot;
}
Changes:
dataset
moved toPlotEntity
, since currently onlyPlot
s haveDataset
s.index
was intended to work withdataset
, and so has also been moved toPlotEntity
.
Plot
calls that previously returned Entity
or Entity[]
now return PlotEntity
and PlotEntity[]
.
Legend
scale()
-->colorScale()
entitiesAt()
replacesgetEntry()
and returnsEntity<Legend>[]
.
Scales.ModifiedLog
- The
showIntermediateTicks()
endpoint has been removed. To exercise more control over which ticks are displayed, assign a customTickGenerator
to theScale
.
Animators.Rect
/ Animators.MovingRect
Animators.Rect
andAnimators.MovingRect
have been removed. Their logic was very specific towards the use case inPlots.Bar
, which now uses a properly configuredAnimators.Base
instead. If you are interested in the animation logic used in those animators, please contact us.
SymbolFactories
- The type
StringAccessor
has been removed, as there are no Plottable API points that use it.
Component
- The
_element
instance variable has been madeprivate
(previouslyprotected
). Operating directly on thisSelection
is an error -- useforeground()
,content()
, orbackground()
instead, as appropriate. - The
_content
instance variable has been madeprivate
(previouslyprotected
). The content-Selection
can still be accessed withcontent()
.
Plot
- The
_datasetToDrawer
instance variable has been madeprivate
(previouslyprotected
). - The
_attrBindings
instance variable has been madeprivate
(previouslyprotected
). Useattr()
to retrive theAccessorScaleBinding
instead. - The
_attrExtents
instance variable has been madeprivate
(previouslyprotected
).
Plots.Bar
- The
protected static
_DEFAULT_WIDTH
variable has been removed, since it no longer served a purpose insidePlots.Bar
or its subclasses. labelFormatter()
-->labelsFormatter()
Plots.StackedArea
- The
protected
method_wholeDatumAttributes()
has been removed. Previously this was the list of attributes:
["x", "y", "defined", "d"]
Animators.Base
A number of renames for clarity:
delay()
->startDelay()
duration()
->stepDuration()
maxIterativeDelay
->iterativeDelay()
maxTotalDuration()
now defaults toInfinity
. The maximum total duration of animations onPlot
s remains at the old default of 600ms.DEFAULT_DELAY_MILLISECONDS
->DEFAULT_START_DELAY_MILLISECONDS
DEFAULT_DURATION_MILLISECONDS
->DEFAULT_STEP_DURATION_MILLISECONDS
DEFAULT_MAX_ITERATIVE_DELAY_MILLISECONDS
->DEFAULT_ITERATIVE_DELAY_MILLISECONDS
Drawer
s
- added
totalTime()
, which returns the total time that would be spent drawing (in milliseconds). draw()
now returns the callingDrawer
, instead of the total time that would be spent drawing.
UMD
Plottable now uses the Universal Module Definition API, so it should work with AMD and CommonJS.