plotly / plotly/plotly.js

boxplots with q1/median/q3 signature always show fences as min/max on hover

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

还没有人认领这个 Issue。

bug P3
主要语言
JavaScript
星标
18.3k
派生
2k
平均合并
2 天 12 小时
30 天内合并 PR
28

描述

Like many who requested the boxplot with q1/median/q3 signature, I have a situation where I am pre-computing these statistics (along with lower and upper fence) from a very large database and then feeding these values to plotly.

I am also pre-computing outliers and adding those as a separate trace.

When using the boxplot with q1/median/q3 signature, we do not have the flexibility to label the fences correctly in the case of outliers.

See the example below (codepen):

image

Here there are no low outliers, so the lower fence is correctly labeled as "min" in the hover. However, the upper fence is labeled as "max" even though there are outliers.

This is confusing to users who wonder why something is labeled as the max when there are points outside of the fence. If I chose not to add the outliers trace, which is probably what most people do who are using this boxplot signature, it would be even more misleading because there would be no hint about whether the underlying data these fences were computed from really have min and max values at the fences, which could lead to some incorrect and bad conclusions about the data.

Fences are not necessarily the min and max, and when using the q1/median/q3 signature, the boxplot has no way of knowing which is the case.

This could be addressed with any of the following:

  1. Allow the ability to override the hover text for this signature
  2. Add an outliers argument to this signature as some have proposed here
  3. Add min/max to the signature – these wouldn't be plotted, but if min < lowerfence, then the hover text for lowerfence would be "lowerfence" (otherwise "min") and similar logic for upperfence/max
  4. Always make the hover text for the lower and upper fences as "lowerfence" and "upperfence" regardless of whether they represent the min/max
  5. Remove the boxplot with q1/median/q3 signature option because it produces a plot that currently by default has statistically incorrect hover info

Personally I lean toward (3).

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 boxplot q1/median/q3 签名开始,并使用链接的 CodePen 示例重现悬停标签。检查签名如何表示 fences 和 outliers,然后确定哪个提议的 API 行为是合适的;完成标准是:在无法得知的情况下,fence 标签不再暗示 min/max,并且示例行为已由测试覆盖。

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

评估

技术栈
javascript
领域
data-visualization
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

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