nteract / semiotic

A data visualization framework combining React & D3
https://semioticv1.nteract.io/
Other
2.43k stars 132 forks source link

More position options for the legend #618

Closed dgwyer closed 1 year ago

dgwyer commented 2 years ago

At the moment we have two options to position the legend to the left or right of the chart area. There are plenty of times that I need the legend to be displayed (centered) above or below the chart too, such as when one of the data series labels is too long.

image 8

It would be nice to be able to do something like this (mockup):

Frame 1

While I think of it, adding the legend inside the chart area looks good too (obviously this depends on the number of series and the specific data):

image 14

Also, it would be very useful to have other settings to:

emeeks commented 2 years ago

This definitely needs to happen. I think we can offer the interior options as well, though I doubt we can do anything smart (like avoiding regions with datapoints) for a while, despite the fact that we have the capability to do it.

dgwyer commented 2 years ago

Manual placement of the legend inside the chart would be fine for now I think. And dynamic positioning could be looked into in the future perhaps?

emeeks commented 1 year ago

I've evolved my thinking on legends. I think any kind of more exhaustive legend should be built 3rd party rather than built into Semiotic because of the different kinds of legends and the functionality they include (interactivity for instance).