@naivemap/mapbox-gl-echarts-layer
Version:
A Mapbox GL JS layer to integrate Apache ECharts' Lines and Scatter charts.
48 lines (47 loc) • 1.57 kB
TypeScript
import { ECOption } from '@naivemap/echarts-layer-core';
import { CustomLayerInterface, Map } from 'mapbox-gl';
/**
* A custom Mapbox GL JS layer that renders Apache ECharts visualizations.
*/
export default class EChartsLayer implements CustomLayerInterface {
id: string;
/**
* @ignore
*/
type: 'custom';
/**
* @ignore
*/
renderingMode?: '2d' | '3d' | undefined;
private _core;
private _adaptor;
/**
* @param id - A unique layer id
* @param ecOption - The ECharts option object used to configure the visualization.
* @see https://echarts.apache.org/en/option.html
*/
constructor(id: string, ecOption: ECOption);
/**
* @ignore
*/
onAdd(map: Map, gl: WebGLRenderingContext): void;
/**
* @ignore
*/
onRemove(map: Map, gl: WebGLRenderingContext): void;
/**
* Updates the ECharts visualization with a new configuration.
* This is the primary method for dynamically changing the displayed data or styles.
*
* @param option - The new ECharts option object to apply.
* @param notMerge - If true, the new options will completely replace the existing ones.
* If false or undefined, the new options will be merged with the old ones.
* Defaults to `false`.
* @see https://echarts.apache.org/en/api.html#echartsInstance.setOption
*/
setOption(option: ECOption, notMerge?: boolean): void;
/**
* @ignore
*/
render(gl: WebGLRenderingContext, args: unknown): void;
}