UNPKG

@alicloud/cloud-charts

Version:

![](https://img.shields.io/npm/v/@alicloud/cloud-charts?color=%23ff8200)

133 lines (121 loc) 3.48 kB
"use strict"; exports.__esModule = true; exports.MapCustom = exports.CUSTOM_NAME = exports.MapShoot = exports.SHOOT_NAME = exports.MapHeatMap = exports.HEAT_MAP_NAME = exports.MapPoint = exports.POINT_NAME = exports.MapArea = exports.AREA_NAME = void 0; // import Wmap, { WmapConfig } from "./index"; // import { provinceName } from "./mapData/chinaGeoInfo"; // import * as React from "react"; // class ChildBase { // parent: Wmap = null; // // init (ctx: Wmap, config: WmapConfig, data: ChartData) { // this.parent = ctx; // } // // changeData(data: ChartData) {} // } var AREA_NAME = 'MapArea'; exports.AREA_NAME = AREA_NAME; var MapArea = function MapArea() { return null; }; exports.MapArea = MapArea; MapArea.displayName = AREA_NAME; // class Area extends ChildBase { // init (ctx: Wmap, config: WmapConfig, data: ChartData) { // super.init(ctx, config, data); // // const { chart, ds } = ctx; // // const areaMapDataView = ds // .createView() // .source(data) // .transform({ // type: 'map', // callback(obj) { // const { name, type, ...others } = obj; // return { // // @ts-ignore 将省份全称转化为简称 // name: provinceName[name] ? provinceName[name] : name, // type: String(type), // ...others, // }; // }, // }) // .transform({ // geoDataView: ctx.bgMapDataView, // field: 'name', // type: 'geo.region', // as: ['x', 'y'], // }); // // const areaMapView = chart.createView({ // padding: 0, // }); // areaMapView.data(areaMapDataView.rows); // /*const areaGeom = */areaMapView // .polygon() // .position('x*y') // // 如果用连续型颜色,需要对数组倒序,否则颜色对应的数值会从小开始 // .color('type', config.areaColors.join('-')) // // .opacity('value') // .tooltip('name*value', (name, value) => ({ // name, // value, // })); // // if (config.geomStyle) { // // areaGeom.style('name*value', config.geomStyle); // } // // ctx.areaMapDataView = areaMapDataView; // ctx.areaMapView = areaMapView; // } // // // changeConfig(config) { // // // // } // // changeData(data: ChartData) { // const { areaMapDataView } = this.parent; // if (areaMapDataView.origin !== data) { // areaMapDataView.source(data); // } // } // } var POINT_NAME = 'MapPoint'; exports.POINT_NAME = POINT_NAME; var MapPoint = function MapPoint() { return null; }; exports.MapPoint = MapPoint; MapPoint.displayName = POINT_NAME; var HEAT_MAP_NAME = 'MapHeatMap'; exports.HEAT_MAP_NAME = HEAT_MAP_NAME; var MapHeatMap = function MapHeatMap() { return null; }; exports.MapHeatMap = MapHeatMap; MapHeatMap.displayName = HEAT_MAP_NAME; var SHOOT_NAME = 'MapShoot'; exports.SHOOT_NAME = SHOOT_NAME; var MapShoot = function MapShoot() { return null; }; exports.MapShoot = MapShoot; MapShoot.displayName = SHOOT_NAME; var CUSTOM_NAME = 'MapCustom'; exports.CUSTOM_NAME = CUSTOM_NAME; var MapCustom = function MapCustom() { return null; }; exports.MapCustom = MapCustom; MapCustom.displayName = CUSTOM_NAME; // function reactMapChild(child: Area) { // return class ReactMapChild extends React.Component<MapChildProps> { // static displayName = ''; // // // // render(): null { // return null; // } // } // }