Lots of typing changes
Pre-releaseGood Evening,
This release consists mostly of changes that will be breaking to Typescript consumers. Changes not specific to Typescript:
Plottable.Animator.Defaulthas been renamed toPlottable.Animator.Base.Plottable.DataSourcehas been renamed toPlottable.Dataset. Accordingly, the getter/setter onPlothas been renamed todataset().- The
Utilmodule is now _underscore-proected as_Util, as the fields it contains are not meant to be public facing. Other functions / instance variables / interfaces that are not meant to be public facing are now _underscore-protected as well.
Typescript-only API Breaks
Typing Refactor: Many Plottable classes, including Scales and Plots, now use paramaterized types. For example:
Abstract.Scale -> Abstract.Scale<D,R> where D indicates the type of the domain and R indicates the type of the range. Some examples follow:
Scale.InterpolatedColorhas typeScale<number,string>Scale.Quantitive<D>has typeScale<D,number>. You might think it should beScale<number,number>, but it is actually parameterized because aScale.Timeis aQuantitiveScaleScale.Ordinalhas typeScale<string,number>.
There were according changes for Plots, e.g. XYPlot now has types X,Y (XYPlot<X,Y>). The X attribute is the type being projected on the X dimension, likewise for Y.
Typescript consumers will need to specify the types their scales and plots take. This will improve the ability of the compiler to detect type errors. As always, you can opt out by using anys. Here is an example of the new usage.
var plot: Plottable.Plot.Line<number, number>;
plot = new Plottable.Plot.Line<number, number>(data, xScale, yScale);
- Plottable.Plot.StackedBar no longer extends from Plottable.Plot.NewStyleBarPlot