Add attribute-based legends (colorlegend, sizelegend, symbollegend) by Rhoahndur · Pull Request #7656 · plotly/plotly.js
Implementation for Issue plotly#5099 adds three new legend components that show unique values from marker attributes (color, size, symbol) rather than trace-based legends. New components: - colorlegend: displays unique color values as swatches - sizelegend: displays size ranges as graduated circles - symbollegend: displays unique marker symbols Features: - Click to toggle visibility of points with that attribute value - Support for multiple legends (colorlegend, colorlegend2, etc.) - Configurable positioning, styling, and orientation - Works with scatter and scatter-variant traces