d3plus / d3plus-shape

Fancy SVG shapes for visualizations
MIT License
20 stars 2 forks source link

add pass-through hover function to Box and Whisker #85

Closed davelandry closed 6 years ago

davelandry commented 6 years ago

Expected Behavior

The Shape class has hover and active methods that toggle the opacities of the the related shapes. Currently, the Viz component in d3plus-shape uses these methods on mousemove in order to highlight the user's behavior. The new complex Box and Whisker shapes should have pass-through methods where they pass the user's arguments to the deeper shapes. This will have to be a 2-step process:

  1. save the deeper shapes (the median line, main box, and the whiskers in Box, the lines and endpoints in Whisker) to the class internal class object (ie. this._box = new Rect() on line 152 of Box.js)
  2. add methods for active and hover that pass through the arguments to those shapes, for example:
hover(_) {
  this._box.hover(_);
}

Current Behavior

Currently, when hovering over a Box on a Plot, the page gets errors in the console.