echarts-for-react icon indicating copy to clipboard operation
echarts-for-react copied to clipboard

Update Required type Opts ( and add support for SSR)

Open RayaneSlimani opened this issue 11 months ago • 2 comments

Update Required in Opts Between ECharts and ECharts-for-React, and Lack of SSR Support

Description: Currently, there is a discrepancy between the options available for configuring a chart in ECharts and those used in the ECharts-for-React wrapper. Additionally, there is a lack of support for Server-Side Rendering (SSR) in the ECharts-for-React wrapper.

Problem: In ECharts, the options are defined as follows:

opts= {
    devicePixelRatio?: number,
    renderer?: string,
    useDirtyRect?: boolean,
    useCoarsePointer?: boolean,
    pointerSize?: number,
    ssr?: boolean,
    width?: number|string,
    height?: number|string,
    locale?: string
}

However, in the ECharts-for-React wrapper, the options are defined differently:

export type Opts = {
  readonly devicePixelRatio?: number;
  readonly renderer?: 'canvas' | 'svg';
  readonly width?: number | null | undefined | 'auto';
  readonly height?: number | null | undefined | 'auto';
  readonly locale?: string;
};

Moreover, the ECharts-for-React wrapper lacks support for Server-Side Rendering (SSR), which is a crucial feature for many projects aiming to improve performance and SEO.

Proposed Solution: Harmonize the options between ECharts and ECharts-for-React, either by aligning the definitions or providing clear documentation on how to translate between the two sets of options. Implement Server-Side Rendering (SSR) support in the ECharts-for-React wrapper to enable rendering charts on the server side, improving performance and SEO.

image

RayaneSlimani avatar Mar 18 '24 11:03 RayaneSlimani

@hustcc up

RayaneSlimani avatar Apr 09 '24 09:04 RayaneSlimani

Can help me with a pr?

hustcc avatar Apr 09 '24 10:04 hustcc