Bokeh: [FEATURE] Add a DOM-based legend

Created on 20 Jun 2020  路  3Comments  路  Source: bokeh/bokeh

This is a follow on to replace #4213. Rather than trying to automagically resize and place the existing on-canvas legend, I propose to create a new supplemental DOM-based legend that can be placed in a layout or template, separate from the plot canvas. This legend would render a div for each legend item, that each contains a canvas (to render the legend representative) and a span (for the legend label). By default these would be styled to display in a vertical columnar arrangement, but users should be able to target the CSS to obtain different responsive arrangements (e.g. horizontal, multiple rows, etc).

cc @bokeh/dev

discussion

Most helpful comment

Additional "nice-to-have"s that should be possible with a DOM-based legend:

  • A vertical scrollbar
  • Automatic wrapping or elision of long labels
  • Turning an always visible list to a drop-down to save space
  • Allowing adding custom HTML to the labels (links, checkboxes, and whatnot)

All 3 comments

Additional "nice-to-have"s that should be possible with a DOM-based legend:

  • A vertical scrollbar
  • Automatic wrapping or elision of long labels
  • Turning an always visible list to a drop-down to save space
  • Allowing adding custom HTML to the labels (links, checkboxes, and whatnot)

This would be a very nice feature.

+1 For this!

(Old Request #10149 )

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darribas picture darribas  路  3Comments

cyrusmaher picture cyrusmaher  路  3Comments

rornor picture rornor  路  3Comments

dhirschfeld picture dhirschfeld  路  4Comments

canavandl picture canavandl  路  3Comments