plotly / plotly/plotly.js

omitted base property in index.d.ts

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

还没有人认领这个 Issue。

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

描述

#  "plotly.js-dist-min": "^2.27.1",
# "@types/plotly.js-dist-min": "^2.3.4",
const minutes = Array.from({ length: 24 * 6 }, (_, i) => {
    const hour = Math.floor(i / 6)
    const minute = (i % 6) * 10
    return `2023-01-01 ${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}:00`
  })

  const traceDeath: Partial<Plotly.PlotData> = {
    x: minutes,
    base: minutes.map(() => Math.random() * 5),
    y: minutes.map(() => Math.random() * 5 + 3),
    type: 'bar',
    marker: { color: 'red' },
  }

In this code, please check base property.
I followed Plotly.PlotData
image
Whenever i omit base property, plotly graph changed.
But there is not base property in index.d.ts.

so I added interface

  interface extendPlotData extends Partial<Plotly.PlotData> {
    base?: number[]
  }
    const traceDeath: extendPlotData = {
    x: minutes,
    base: minutes.map(() => Math.random() * 5),
    y: minutes.map(() => Math.random() * 5 + 3),
    type: 'bar',
    marker: { color: 'red' },
  }

I know you have document
https://plotly.com/javascript/reference/bar/#bar-base

but please add missing properties.

贡献指南

打开贡献指南

从这里开始

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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