v2.0.0 Release Candidate 1
Pre-releaseGood evening,
This marks the first release candidate for v2.0.0 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 Component
s. 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).
Removed Classes and Fields
Plots.Wheel
has been removed, since it was an incomplete implementation and its use case is better covered byPlots.Rectangle
.- Removed the following deprecated methods and fields:
Axis._computedHeight
Axis._computedWidth
Axis.tickLength()
Formatters.relativeDate()
Plot._visibleOnPlot()
Plots.Bar._visibleOnPlot()
Plots.Scatter._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 CallbackSet
s:
// 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
CallbackSet
s removed and replaced with registration-strings.