A library for placing labels in areas.
BSD-3-CLAUSE License
Bot releases are visible (Hide)
Full Changelog: https://github.com/curran/d3-area-label/compare/v1.5.0...v1.6.0
Published by curran over 5 years ago
Thanks to @Legion4444 for this contribution that makes all methods chainable! Details in https://github.com/curran/d3-area-label/pull/24
Also upgraded dependencies to the latest versions.
Enjoy!
Published by curran about 7 years ago
Published by curran about 7 years ago
Published by curran about 7 years ago
Guarantee Labels are Inside Areas #14.
There was an issue where when the gaps between data points was large, the labels were not always ending up inside the area.
Before:
After:
Published by curran about 7 years ago
toString
method that generates an SVG transform.Published by curran about 7 years ago
Break out of the inner test loop as soon as we know the rectangle will not fit.
Published by curran about 7 years ago
This version uses the Bisection Method to search for the largest size label, using fewer iterations than before, and achieving more accurate results.
Now the algorithm uses a tolerance for accuracy of the height of the label bounding box in pixels, which is by default 0.01. Using this tolerance, the bisection method takes around 18 iterations on average to find a solution, as compared to on average around 100 with the previous linear search method, which was only accurate to a tolerance of 1.
Published by curran about 7 years ago
The algorithm is not efficient (linear scan of possible sizes), and the results are not precise (integer height increments are searched only), but it's basically working.