Skip to content

1.0.0 Release Candidate 6

Pre-release
Pre-release
Compare
Choose a tag to compare
@jtlan jtlan released this 10 Jun 01:39
· 2570 commits to master since this release

Overview

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 to PlotEntity, since currently only Plots have Datasets.
  • index was intended to work with dataset, and so has also been moved to PlotEntity.

Plot calls that previously returned Entity or Entity[] now return PlotEntity and PlotEntity[].

Legend

  • scale() --> colorScale()
  • entitiesAt() replaces getEntry() and returns Entity<Legend>[].

Scales.ModifiedLog

  • The showIntermediateTicks() endpoint has been removed. To exercise more control over which ticks are displayed, assign a custom TickGenerator to the Scale.

Animators.Rect / Animators.MovingRect

  • Animators.Rect and Animators.MovingRect have been removed. Their logic was very specific towards the use case in Plots.Bar, which now uses a properly configured Animators.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 made private (previously protected). Operating directly on this Selection is an error -- use foreground(), content(), or background() instead, as appropriate.
  • The _content instance variable has been made private (previously protected). The content-Selection can still be accessed with content().

Plot

  • The _datasetToDrawer instance variable has been made private (previously protected).
  • The _attrBindings instance variable has been made private (previously protected). Use attr() to retrive the AccessorScaleBinding instead.
  • The _attrExtents instance variable has been made private (previously protected).

Plots.Bar

  • The protected static _DEFAULT_WIDTH variable has been removed, since it no longer served a purpose inside Plots.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 to Infinity. The maximum total duration of animations on Plots 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

Drawers

  • added totalTime(), which returns the total time that would be spent drawing (in milliseconds).
  • draw() now returns the calling Drawer, 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.