susielu / d3-legend

A reusable d3 legend component.
http://d3-legend.susielu.com/
Apache License 2.0
727 stars 104 forks source link

The property functions don't return the current value when called with no arguments #23

Closed chrisprice closed 8 years ago

chrisprice commented 8 years ago

E.g. -

var legend = d3.legend.color()
  .shapeWidth(70)
  .orient('horizontal');

console.log(legend.shapeWidth() === 70); // false
console.log(legend.orient() === 'horizontal'); // false

console.log(legend.shapeWidth() === legend); // true
console.log(legend.orient() === legend); // true
susielu commented 8 years ago

Thanks for providing examples. Hopefully I will have time to take a look this weekend.

Thanks, Susie

On Wed, Jan 20, 2016 at 4:21 AM, Chris Price notifications@github.com wrote:

E.g. -

var legend = d3.legend.color() .shapeWidth(70) .orient('horizontal'); console.log(legend.shapeWidth() === 70); // falseconsole.log(legend.orient() === 'horizontal'); // false console.log(legend.shapeWidth() === legend); // trueconsole.log(legend.orient() === legend); // true

— Reply to this email directly or view it on GitHub https://github.com/susielu/d3-legend/issues/23.

susielu commented 8 years ago

Thanks for reporting this. This has now been resolved in the latest version of the code.