plotly / plotly/plotly.js

Constraint-type contour plot cannot shade entire area

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

还没有人认领这个 Issue。

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

描述

Steps to reproduce

Create plotly.js data object with the following:

var data = [ {
  z: [[10, 10.625, 12.5, 15.625, 20],
       [5.625, 6.25, 8.125, 11.25, 15.625],
       [2.5, 3.125, 5., 8.125, 12.5],
       [0.625, 1.25, 3.125, 6.25, 10.625],
       [0, 0.625, 2.5, 5.625, 10]],
  type: 'contour',
  colorscale: 'Jet',
    "contours": {
        "coloring": "lines",
        "operation": "][",
        "showlabels": true,
        "type": "constraint",
        "value": [0,20]
    },
}];

Here is a link to a CodePen that shows the problem. https://codepen.io/kfd182/pen/yLKvNLJ

Current behaviour (bug)

Empty plot

Expected behaviour (correct)

Plot that is entirely shaded in

Other comment

When making a contour plot that uses type=‘constraint’ and operation = ‘][’ , setting value = [data-min, data-max] creates an empty plot, instead of a completed shaded plot. If you adjust data-min to be slightly larger or adjust data-max to be slightly smaller, then you get a nearly completely shaded plot.

I think one workaround could be using {operation: '<', and value: data-min}. This will shade the entire plot area.

Reported by

kdaquila-questek

贡献指南

打开贡献指南

从这里开始

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

调研方向

从提供的 CodePen 复现开始,跟踪操作 ][ 在值 [data-min, data-max] 下的轮廓处理。完成的标准是整个数据范围都渲染为带阴影的图,而不是空图,同时相邻的边界情况继续正常运行。

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

评估

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

把新 issue 发到你的邮箱

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