susielu / d3-legend

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

Pr/legend locale #71

Closed existe-deja closed 7 years ago

existe-deja commented 7 years ago

You can see the tests to understand how it works. The basic idea:

  1. Create a locale object in the legend
  2. Adapt labelFormat to use the locale's format. To do it I choose to use a specifier instead of the format function
  3. Be sure to support the two ways to set labelFormat, by string or by d3.format

Let me know what to change. When it will be ok for you, I'll do the implementation for sizeLegend and symbolLegend too.

susielu commented 7 years ago

Looks good, I just had one comment about the default format. Let me know when it's in the other two legend types and I'll take a look locally and update the docs. Thanks!

susielu commented 7 years ago

This looks good to me, tested it out on the docs and it worked well. Did you have any other changes you wanted to make?

existe-deja commented 7 years ago

I think we're good! It's on your hands now to build and update. By the way, it was my first open source contribution and I was very happy to do it.

susielu commented 7 years ago

@Lacroute exciting, congrats! It was great having your help to implement this feature. I'll move it in today and update the docs. Cheers!