plotly / plotly/plotly.R

Mapbox "fitBounds" handling

未关闭
#2,255 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

As per https://github.com/plotly/plotly.R/blob/9ee548023bba6d68dd953f46485b2e611026766b/inst/htmlwidgets/plotly.js#L206-L220

I believe the if(!args) check should be changed (or the parameter for args should default to null or some other calculated default, not {}) as it currently causes an "e is undefined" error in mapbox (where e is the 2nd parameter).

I've got around it by explicitly providing a mapbox = list(_fitBounds = list(c(xmin, ymin), c(xmax, ymax)), options = list()) entry in my plotly::layout call.

This also serves as a reminder that the fitBounds doesn't seem to work for restyle either.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 inst/htmlwidgets/plotly.js 的第 206–220 行开始,重点关注 fitBounds 参数的默认值,以及产生第二个参数为 undefined 错误的 Mapbox 调用。分别在有和没有显式 mapbox 选项列表的情况下复现该问题,然后验证 fitBounds 在 restyle 期间也能正常工作。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, r
领域
data-visualization, frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。