[FEATURE]: Allow fitbounds to use only a subset of traces
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
Start by tracing how scattergeo handles layout.geo.fitbounds and gathers locations, then read the linked discussion in issue #8046. Define how a trace-selection option should work while keeping unselected routes visible, and verify the selected-route extent, including antimeridian-crossing routes, without changing the broader view.
由索引模型根据 Issue 内容生成。
描述
Summary
I would like to request a way to control which traces participate in the fitbounds calculation.
The current behavior is correct in the sense that fitbounds considers all relevant traces in the graph. However, for interactive maps with multiple routes, it would be useful to fit the view to a selected trace (or subset of traces) while keeping the other traces visible.
Related issue
This feature request follows from the discussion in the closed issue:
More specifically, this follows from camdecoster's comment on #8046.
Use case
I am building an interactive flight-route map using scattergeo.
The map contains many flight routes. When the user selects one route, I would like to:
- Keep all routes visible.
- Fit/zoom the map to the selected route only.
- Keep the other routes visible, but exclude them from the calculation used to determine the fitted view.
This is particularly important for routes crossing the antimeridian.
For example, a route from Vancouver (YVR) to Seoul (ICN) crosses the antimeridian. If this is the only trace in the graph, fitbounds: 'locations' correctly fits the route and rotates the map to the Pacific.
However, when all the other routes are present, fitbounds considers their locations as well, resulting in a much wider/global view.
Current workaround
I tried temporarily removing the other routes, fitting the map to the selected route, and then adding the other routes back.
The first two steps work correctly:
- Remove/disable the other routes.
- Fit the view to the selected route.
However, as soon as the other routes are added back, fitbounds recalculates using all traces and the view immediately returns to the wider extent.
I also tried making the other routes transparent, but opacity does not exclude their locations from the fitbounds calculation.
I therefore currently have to choose between fitting the map correctly to the selected route and keeping all routes in the graph.
Proposed feature
It would be useful to have a way to specify which traces should participate in the fitbounds calculation.
For example, conceptually something like:
layout: {
geo: {
fitbounds: 'locations',
fitbounds_traces: [3, 7]
}
}
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 21
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/plotly.js 的其他 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
chore P3 plotly-internal size: 3 task
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
chore P1 plotly-internal size: 1 task
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
chore P3 plotly-internal size: 1 task
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
plotly/plotly.js#7648 · 3 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
bug CI breakage triage needed
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
draftomen enhancement size: S
难度 2/5 1-3 小时 新手友好度 75/100
andreagrandi/draftomen#761 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
HarperFast/harper#2866 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
HarperFast/harper-pro#927 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
anthropics/skills#1897 · 1 条评论 ·
维护者通常 1 天内回复