perf: Implement Echarts treeshaking (#29874)

This commit is contained in:
Kamil Gabryjelski
2024-08-07 06:53:52 +02:00
committed by GitHub
parent db1d77cba2
commit c220245414
36 changed files with 149 additions and 66 deletions

View File

@@ -16,8 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
import { BarSeriesOption, EChartsOption } from 'echarts';
import { CallbackDataParams } from 'echarts/types/src/util/types';
import type { ComposeOption } from 'echarts/core';
import type { BarSeriesOption } from 'echarts/charts';
import type { GridComponentOption } from 'echarts/components';
import type { CallbackDataParams } from 'echarts/types/src/util/types';
import { isEmpty } from 'lodash';
import {
CategoricalColorNamespace,
@@ -133,6 +135,8 @@ export default function transformProps(
focusedSeries = index;
};
type EChartsOption = ComposeOption<GridComponentOption | BarSeriesOption>;
const echartOptions: EChartsOption = {
grid: {
...defaultGrid,