Picking best label positions in a streamgraph along the same lines as this stacked area chart example.
If a label doesn't fit in the top or bottom series, it tries to place it in the adjacent empty space.
forked from veltman's block: Streamgraph label positions
https://d3js.org/d3.v4.min.js