regression: in d3.bin, values next to a threshold go into the wrong bin
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
d3.bin().domain([0, 1]).thresholds(10)([0.3 * 3]) // 0.3 * 3 is 0.8999999999999999
puts the value in the bin [0.9, 1] instead of [0.8, 0.9]. With the same thresholds passed explicitly, d3.bin().domain([0, 1]).thresholds(d3.ticks(0, 1, 10).slice(1, -1)), it goes into [0.8, 0.9].
The same happens with an integer step: d3.bin().domain([-10, 10]).thresholds(10)([1.9999999999999998]) puts the value in [2, 4] instead of [0, 2].
Since 3.1.3 (#220), when the domain is aligned with the thresholds, bin computes the index of a value's bin as Math.floor((x - x0) / step) (or Math.floor((x0 - x) * step) for a fractional step). This division or multiplication can round across an integer. Only the underestimate is corrected, and only for fractional steps. 3.1.2 put these values in the correct bins.
- 主要语言
- JavaScript
- 星标
- 465
- 派生
- 193
- 平均合并
- 5 小时 46 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
d3/d3-array 的其他 Issue
-
d3.nice(start, stop, 1) returns [-1e308, 1e308] when the interval contains zero, so d3.bin gives NaN bin bounds可能已有人在做 @awais-ur-rehman 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
regression: d3.bin's last bin is twice as wide when the maximum is a threshold可能已有人在做 @Fil 于 2 天前认领。 未关闭
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
groupSort should use ascendingDefined instead of ascending可能已有人在做 @cpruijsen 于 58 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 10/100
维护者通常 1 天内回复
-
Incorrect results for binary search on large arrays due to miscomputation of midpoint可能已有人在做 @maximilliangrand 于 88 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
d3/d3-array#261 · 11 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
mega-yfue/ha-eufy-sdk-bridge#198 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
blamechris/chroxy#9108 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
Content:WebExt needs triage
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
liberation-data/drivine#733 · 1 条评论 ·
维护者通常 1 天内回复