hustcc / hustcc/echarts-for-react

Update Required type Opts ( and add support for SSR)

Open
#567 2 comments 7 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5k
Forks
650
PR merge metrics
No merged PRs in 30d

Description

**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](https://github.com/hustcc/echarts-for-react/assets/37119820/34a73d9f-744a-4f49-bafc-f5e5425d8010)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.