@antv/g2
Version:
the Grammar of Graphics in Javascript
48 lines (44 loc) • 845 B
text/typescript
import { CompositionComponent as CC } from '../runtime';
import { GeoPathComposition } from '../spec';
export type GeoPathOptions = Omit<GeoPathComposition, 'type'>;
/**
* Wrap GeoPath by a GeoView.
*/
export const GeoPath: CC<GeoPathOptions> = () => {
return (options) => {
const {
type,
data,
scale,
encode,
style,
animate,
key,
state,
tooltip,
...rest
} = options;
return [
{
type: 'geoView',
...rest,
children: [
{
type: 'geoPath',
key: `${key}-0`,
data: {
value: data,
},
scale,
encode,
style,
animate,
state,
tooltip,
},
],
},
];
};
};
GeoPath.props = {};