Skip to content

Upgrading to 2.0.0

Xiaohan Zhang edited this page Apr 17, 2017 · 4 revisions

Hey there! We recommend using Plottable 3.0.0 to get the latest and greatest changes. See Upgrading to 3.0.0.

This is a list of all changes between v2.0.0 and v1.16.2 of Plottable.

Why 2.0.0?

We are fixing a bug on Interaction.Pointer in a way that changes the way it behaves when Plottable charts are blocked by other DOM elements. We had previously fixed the behavior in v1.14.0, but wound up up rolling back the change in v1.16.1 to avoid surprising users who were depending on the old behavior. To clearly indicate the change in behavior, we are releasing this change as v2.0.0 instead of v1.17.0.

v2.0.0 is also built with Typescript 1.7 and includes some improvements to the type definitions.

Changes

Change in Behavior for Pointer Interaction

Interactions.Pointer callbacks will no longer trigger under modals or other overlays that overlap Components. Most tooltip libraries draw tooltips as an overlaying element. Add the following CSS to tooltips to avoid having them block pointer events:

.tooltip {
  pointer-events: none;
}

See https://jsfiddle.net/aytdd8ub/ for an example using Bootstrap.

Typescript 1.7 Changes: polymorphic this

Plottable now uses Typescript 1.7. Consequently, methods that return the calling object now return this instead of the class-type:

class Label {
  public text(text: string): Label; // OLD
  public text(text: string): this; // NEW
}

This change fixes problems caused by attempting to chain methods defined on a parent class (#2504). Please upgrade to Typescript 1.7 for development.

croppedRenderingEnabled() on Plots.StackedArea

The "cropped rendering" performance option on Plots.StackedArea has been temporarily disabled as it does not work as intended (see #3032).

Removed Classes and Fields

  • Plots.Wheel has been removed, since it was an incomplete implementation and its use case is better covered by Plots.Rectangle.
  • Removed the following deprecated methods and fields:
    • Axis._computedHeight
    • Axis._computedWidth
    • Axis.tickLength()
    • Formatters.relativeDate()
    • Plot._visibleOnPlot()
    • Plots.Bar._visibleOnPlot()
    • Plots.ScatterPlot._visibleOnPlot()

Dispatcher architecture changes

These changes only affect users who are subclassing Dispatcher:

The internal architecture of Dispatcher has been redone. The main change is that subclasses now register callbacks by event name, rather than having to manage CallbackSets:

// NEW DESIGN
protected _addCallbackForEvent(eventName: string, callback: Function): void;
protected _removeCallbackForEvent(eventName: string, callback: Function): void;
protected _callCallbacksForEvent(eventName: string, ...args: any[]): void;

In addition, some internal fields have been renamed for clarity.

Summary of changes:

  • protected _eventToCallback --> _eventToProcessingFunction
  • _setCallback() and _unsetCallback() replaced by _addCallbackForEvent() and _removeCallbackForEvent().
  • _callCallbacksForEvent() added.
  • protected _callbacks array removed.
  • private CallbackSets removed and replaced with registration-strings.

Bugfixes

  • A QuantitativeScale with padding no longer locks up if both ends of its domain are set to the same value (#3019).