plotly / plotly/plotly.js

omitted base property in index.d.ts

Open
#6,810 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.