Skip to content

Component.Group improvements, refactored Interaction.Click

Pre-release
Pre-release
Compare
Choose a tag to compare
@jtlan jtlan released this 10 Apr 22:27
· 4383 commits to master since this release

Good afternoon,

Today's release features improvements to Component.Group, as well as a refactoring of Interaction.Click.

Features

Adding Components to filled cells in Table

Adding a Component to a Table cell that is already occupied will now merge it above the Component that is already there, creating a Group. If the Component being added or the Component already there is a Group, they will be combined using above().

See it in action: http://jsfiddle.net/3h567a36/1/

Interaction.Click Restructured

Interaction.Click now uses the new Interaction architecture -- this means it will now return the correct position even when CSS transforms have been applied to the page. The callback registration method has been renamed to onClick().

Example Usage:

var clickInteraction = new Plottable.Interaction.Click();
clickInteraction.onClick(function(point){
  // do something with the resultant Point -- maybe select an element?
  ...
});
plot.registerInteraction(clickInteraction);

See it in action: http://jsfiddle.net/uztbyhnz/1/

Bugfixes

  • Component.Group no longer produces extra whitespace. Essentially, Group will behave with the combined effect of each of its constituent Components added to a Table cell individually (#1791).
  • An Axis.Time with only single-tier configurations no longer occupies extra space where the extra tier would have been (#1800).

API-Breaking Changes

  • Interaction.Click's callback setter has been replaced with an onClick getter/setter API.

Upgrade Instructions

  • In places where you are using clickInteraction.callback(callback), this should be replaced with clickInteraction.onClick(callback).

Release Song

Jason Mraz - Geek in the Pink