plotly / plotly/plotly.js

omitted base property in index.d.ts

Đang mở
#6,810 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug P2
Ngôn ngữ chính
JavaScript
Star
18.3k
Fork
2k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
28

Mô tả

#  "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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.