Configurable legends for viewer-charts - #3221
Merged
Merged
Conversation
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New legends
Legends are now a fully configurable chart element across all charts:
legend_mode—"sidebar"(default, the existing right-gutter legend),"none", or"floating": a movable panel overlaying the plot.plugin_config.legend_x/legend_yare normalized offsets measured fromlegend_anchor, so a corner-glued legend stays glued across panel resizes and off-canvas placement is inexpressible.Signed numeric color domains now pivot symmetrically around zero (
colorRangePivot): a column spanning e.g.[-3, 17]colors and labels as[-17, 17], so hue encodes sign consistently in the glyphs (line/scatter) and the gradient legend agrees with them.Map tile sources
map/tile-sources.json; the code is a generic registry (TileSourceRegistry) overTileSourceSpecentries (id,label,template,subdomains?,attribution,tile_size?,max_zoom?). Bundled providers: OpenStreetMap (osm) and VersaTiles satellite (versatiles-satellite). JSON order is the one knob: it defines the settings-panel enum order, the unknown-id fallback, and the default provider (first entry).registerTileSource(spec)/tileSources()(module exports and statics on the plugin element class) add providers at runtime — they join the settings enum and resolve on every current and future map chart. API keys are embedded in the registered template and never enterplugin_config/save(). The resolved spec rides the existingsetPluginConfig/inittransport messages alongside the config that names it — no separate sync channel, no ordering hazards. Tile-cache identity is content-derived, so re-registering an id with a new URL invalidates cached tiles automatically.docs/md/how_to/javascript/map_tile_sources.md).Map numeric axes:
numeric_axes122.4°W/37.77°N), not Mercator meters.New
plugin_configkeyslegend_mode"sidebar" | "none" | "floating""sidebar"legend_width_px0(auto)legend_height_px160legend_anchor"top-left" | "top-right" | "bottom-left" | "bottom-right""top-right"legend_x0legend_y0legend_opacity1numeric_axestrueFixes #3189