Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeScript] Missing property in Partial<PlotData> #308

Open
chaojian-zhang opened this issue Jan 19, 2023 · 2 comments
Open

[TypeScript] Missing property in Partial<PlotData> #308

chaojian-zhang opened this issue Jan 19, 2023 · 2 comments

Comments

@chaojian-zhang
Copy link

chaojian-zhang commented Jan 19, 2023

Hi, thanks very much for this handy component!

I tried to look at all examples and API docs available but can't figure out how to make use of connector among other properties (e.g. measure) for a Waterfall chart. I wonder whether there is a generic way to pass those parameters or it's just not possible at the moment?

This is the code I have:

<Plot
  data={[
    {
      type: 'waterfall', 
      x: ['Name 1', 'Name 2'], 
      y: [15, 20],
      connector: {line: {color: 'red'}} // Cause error: Object literal may only specify known properties, and 'connector' does not exist in type 'Partial<PlotData>'
    },
  ]}
  layout={{
    width: 300 
    height: 150
  }}
/>

The root of the problem seems that only limited number of properties are implemented on Partial<PlotData> - including for instance (as shown in example) the marker: {color: 'red'} property - which is NOT relevant to a waterfall chart at all.

Actually, due to my limited knowledge with React/TypeScript, I don't even know how to look at the definition of PlotData (it looks not available on this repo?) in order to inspect what properties are actually implemented there - would be helpful if anyone can provide some pointers.

This might be related to this: #247

@chaojian-zhang
Copy link
Author

As a reference, as to "how to use with TypeScript", I find those links provide useful insights:

@chaojian-zhang chaojian-zhang changed the title [TypeScript] Missing property in Partial<PlotData> [TypeScript] Missing property in Partial<PlotData> Jan 19, 2023
@BenXel
Copy link

BenXel commented Feb 8, 2023

I fund an other missing property in Partial.
The property value:number[] is required for isosurface type (https://plotly.com/javascript/reference/isosurface/). So value should be value: number | number[] | undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants