apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.66k stars 19.61k forks source link

[Bug] Missing Documentation for `renderItem()` #19241

Open xge opened 1 year ago

xge commented 1 year ago

Version

5.4.3

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=custom-profile

Steps to Reproduce

Trying to reproduce this example in TypeScript: https://echarts.apache.org/examples/en/editor.html?c=custom-profile I get deprecation warnings for these lines:

{
  x: params.coordSys.x,
  y: params.coordSys.y,
  width: params.coordSys.width,
  height: params.coordSys.height
}

Current Behavior

The actual output from tsc:

error TS2339: Property 'x' does not exist on type 'CustomSeriesRenderItemParamsCoordSys'

This happens for all variables x, y, width, and height.

Expected Behavior

No TS errors.

Environment

- OS: Windows 11
- Browser: Electron@27
- Framework: Vue@3

Any additional comments?

I suspect the API of renderItem has changed, but when I compare this to the official documentation of renderItem, it is unclear to me what needs to be changed on my end.

17LingShan commented 11 months ago

I just add a patchy interface for this type:

interface EChartsPatchCustomSeriesRenderItemParams extends Omit<echarts.CustomSeriesRenderItemParams, 'coordSys'> {
  coordSys: {
    type: string
    x: number
    y: number
    width: number
    height: number
  }
}

It's a patch type. :snowflake: