var markAreaTransform = function (seriesModel, coordSys, maModel, item) { var lt = markerHelper.dataTransform(seriesModel, item[0]); var rb = markerHelper.dataTransform(seriesModel, item[1]); var retrieve = zrUtil.retrieve; // FIXME make sure lt is less than rb var ltCoord = lt.coord; var rbCoord = rb.coord; ltCoord[0] = retrieve(ltCoord[0], -Infinity); ltCoord[1] = retrieve(ltCoord[1], -Infinity); rbCoord[0] = retrieve(rbCoord[0], Infinity); rbCoord[1] = retrieve(rbCoord[1], Infinity); // Merge option into one var result = zrUtil.mergeAll([{}, lt, rb]); result.coord = [ lt.coord, rb.coord ]; result.x0 = lt.x; result.y0 = lt.y; result.x1 = rb.x; result.y1 = rb.y; return result; };
zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) { var mapData = echarts.getMap(mapType); if (__DEV__) { if (!mapData) { mapNotExistsError(mapSeries[0].get('map')); } } var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) { return singleMapSeries.get('nameMap'); }); var geo = new Geo( mapType, mapType, mapData && mapData.geoJson, mapData && mapData.specialAreas, zrUtil.mergeAll(nameMapList) ); geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) { return singleMapSeries.get('scaleLimit'); })); geoList.push(geo); // Inject resize method geo.resize = resizeGeo; geo.resize(mapSeries[0], api); zrUtil.each(mapSeries, function (singleMapSeries) { singleMapSeries.coordinateSystem = geo; setGeoCoords(geo, singleMapSeries); }); });
seriesOpt.data = map(data, function (itemOpt) { var coords = [ itemOpt[0].coord, itemOpt[1].coord ]; var target = { coords: coords }; if (itemOpt[0].name) { target.fromName = itemOpt[0].name; } if (itemOpt[1].name) { target.toName = itemOpt[1].name; } return mergeAll([target, itemOpt[0], itemOpt[1]]); });
zrUtil.each(AXIS_TYPES, function (axisType) { BaseAxisModelClass.extend({ /** * @readOnly */ type: axisName + 'Axis.' + axisType, /** * @readOnly */ ordinalMeta: null, mergeDefaultAndTheme: function (option, ecModel) { var layoutMode = this.layoutMode; var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; var themeModel = ecModel.getTheme(); zrUtil.merge(option, themeModel.get(axisType + 'Axis')); zrUtil.merge(option, this.getDefaultOption()); option.type = axisTypeDefaulter(axisName, option); if (layoutMode) { mergeLayoutParam(option, inputPositionParams, layoutMode); } }, /** * @override */ optionUpdated: function () { var thisOption = this.option; if (thisOption.type === 'category') { this.ordinalMeta = new OrdinalMeta(this); } }, /** * Should not be called before all of 'getInitailData' finished. * Because categories are collected during initializing data. */ getCategories: function () { // FIXME // warning if called before all of 'getInitailData' finished. if (this.option.type === 'category') { return this.ordinalMeta.categories; } }, defaultOption: zrUtil.mergeAll( [ {}, axisDefault[axisType + 'Axis'], extraDefaultOption ], true ) }); });