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

Typing does not support charts v5.4.3 #553

Open
bkhouri opened this issue Oct 3, 2023 · 0 comments
Open

Typing does not support charts v5.4.3 #553

bkhouri opened this issue Oct 3, 2023 · 0 comments

Comments

@bkhouri
Copy link

bkhouri commented Oct 3, 2023

There are TypeScript errors when using echarts v5.4.3 and eachrts-for-react v3.0.2,

The following is in package.json

{
  "dependencies": {
    ...
    "echarts": "^5.4.3",
    "echarts-for-react": "^3.0.2",
    ...
  },
  ...
}

Here is a simple reproduction case:

import ReactECharts from 'echarts-for-react';

export const MyComponent: React.FC = () => {

    return (
        <ReactECharts
            option={
                {
                    xAxis: {
                        type: 'category',
                        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [
                        {
                            data: [150, 230, 224, 218, 135, 147, 260],
                            type: 'line'
                        }
                    ]
                }
            }
            opts={{
                renderer: "canvas",
                width: "auto",
                height: "auto",
                useCoarsePointer: true,
                pointerSize: 100,
                useDirtyRect: true,
            }}
        />
    )
}

Executing the npm run build which calls react-scripts build causes the following error

TS2322: Type '{ renderer: "canvas"; width: "auto"; height: "auto"; useCoarsePointer: true; pointerSize: number; useDirtyRect: true; }' is not assignable to type 'Opts'.
  Object literal may only specify known properties, and 'useCoarsePointer' does not exist in type 'Opts'.
    28 |                 width: "auto",
    29 |                 height: "auto",
  > 30 |                 useCoarsePointer: true,
       |                 ^^^^^^^^^^^^^^^^^^^^^^
    31 |                 pointerSize: 100,
    32 |                 useDirtyRect: true,
    33 |             }}

A similar error occurs on the pointerSize: 100, and useDirtyRect: true options.

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

1 participant