Skip to content

1.0.0 Release Candidate 4

Pre-release
Pre-release
Compare
Choose a tag to compare
@jtlan jtlan released this 04 Jun 00:24
· 2733 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 definitions file update

This release candidate uses a new version of d3.d.ts.

This latest version is vastly different from the one that came before. The author of that change describes the changes in detail here.

  • When upgrading, use the version in the Plottable repository, because it contains fixes for the latest version of the D3 definitions file.
  • For those interested, the fixes are in the process of making it to DefinitelyTyped. Follow the pull request here.

API Changes between 1.0.0-rc3 and 1.0.0-rc4

Axes.Category

  • The orientation parameter in the constructor is now required:
constructor(scale: Scales.Category, orientation: string, formatter?: (d: any) => string);

Drawer

  • Plottable.Drawers.AbstractDrawer has been renamed to Plottable.Drawer
  • The setClass() endpoint has been removed.

Drawers.Element

  • The svgElement() endpoint has been removed.

Drawers.Rectangle

  • Drawers.Rect has been renamed to Drawers.Rectangle.

Plots.Bar

  • The barAlignment() endpoint has been removed. The original goal for that API point was to allow for histogram-like visualizations. We will be implementing a Histogram class post 1.0.0.
  • orientation() can be used to get the current orientation of the Plots.Bar ("vertical" or "horizontal").
  • baseline() has been renamed to baselineValue(), which more accurately reflects what the method does.

Scale

addExtentsProvider() and removeExtentsProvider() have been replaced by the following methods:

addIncludedValuesProvider(provider: Scales.IncludedValuesProvider<D>): Scale<D, R>;
removeIncludedValuesProvider(provider: Scales.IncludedValuesProvider<D>): Scale<D, R>;

These methods take an IncludedValuesProvider, which replaces ExtentsProvider:

interface IncludedValuesProvider<D> {
    (scale: Scale<D, any>): D[];
}

An IncludedValuesProvider is a function that returns an array of domain values. Those values will be included in the domain of the Scale when it autoDomain()s.

QuantitativeScale

  • addIncludedValue() and removeIncludedValue() have been replaced by addIncludedValuesProvider() and removeIncludedValuesProvider(), listed above.
  • A similar structure has been adopted for padding exceptions:
addPaddingExceptionsProvider(provider: Scales.PaddingExceptionsProvider<D>): QuantitativeScale<D>;
removePaddingExceptionsProvider(provider: Scales.PaddingExceptionsProvider<D>): QuantitativeScale<D>;

These methods take a PaddingExceptionsProvider:

interface PaddingExceptionsProvider<D> {
  (scale: Scale<D, any>): D[];
}

A PaddingExceptionsProvider is a function that returns an array of domain values. If any of those values are either end of the domain computed when autoDomain()-ing, that end of the domain will not be padded.

XYPlot

  • autorange() now functions as a getter, returning the current autorange mode ("x"/"y"/"none").

Type renames

  • _Projector -> Projector
  • _Projection removed, since is has been superseded by Plots.AccessorScaleBinding<any, any>