Skip to content

1.0.0 Release Candidate 3

Pre-release
Pre-release
Compare
Choose a tag to compare
@jtlan jtlan released this 29 May 20:42
· 2874 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

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() on StackedAreaPlot is now protected (inline with all the classes in the inheritance tree)
  • _timeoutMsec on RendererPolicies.Timeout is now private
  • _autoDomainIfAutomaticMode() on the QuantitativeScale is now protected

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 into Plots.Rectangle
  • Plots.Rectangle has four property setters: .x(), .x2(), .y(), .y2(). The x()/x2() properties use the same Scale, as do the y()/y2() properties.

Utils.Stacked

The class has been simplified:

  • Renamed Plottable.StackedPlotUtils -> Plottable.Utils.Stacked
  • Documentation added
  • keyAccessor() method removed as it was implementing Plot logic
  • valueAccessor() method removed as it was implementing Plot logic
  • checkSameDomainForStacks() moved to Plots.StackedArea as it was only used there
  • domainKeys() now public

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 a string key
  • _getPixelPoint() has been removed.

Drawers.Rect

  • drawText() has been removed
  • removeLabels() 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 internal Drag Interaction from DragBoxLayer. One possible use of this feature is to disable drag functionality temporarily:
dragBoxLayer.dragInteraction().detachFrom(dragBoxLayer); // disable
dragBoxLayer.dragInteraction().attachTo(dragBoxLayer); // enable

Plots

  • getAllSelections() no longer takes in a boolean exclude parameter as an the second parameter.
    To get Selections for a certain subset of Datasets:
var datasetsToExclude = [...];
var datasetExclusionFilter = function(dataset) { return datasetsToExclude.indexOf(dataset) === -1; }
var unexcludedDatasets = plot.datasets().filter(datasetExclusionFilter);
plot.getAllSelections(unexcludedDatasets);

Plots no longer take Scales in the constructor

The X and Y Scales 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() <- unchanged
  • new 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 containing datum, as well as datum's index in that Dataset, have been included.
  • The originating Plot for the Entity is also included, which may be helpful if the Entity is saved off somewhere after it has been created.

RenderPolicy

  • .setRenderPolicy() no longer takes a RenderPolicy. 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 Animators now have keys of "main" and "reset" for the Animator.Baseline() and Animator.Null() states, respectively.