See the 'TODOs' in legend.js file.
Use SVG getBBox to compute automatically the dimensions of the legend in the end, and apply this dimension to the legend box. Then, get rid of 'computeWidth' and 'computeHeight' methods. It would then no longer be necessary to indicate the legend width/height in their config.
See:
See the 'TODOs' in legend.js file. Use SVG getBBox to compute automatically the dimensions of the legend in the end, and apply this dimension to the legend box. Then, get rid of 'computeWidth' and 'computeHeight' methods. It would then no longer be necessary to indicate the legend width/height in their config. See: