Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import echarts from 'echarts/lib/echarts';
import createGraphFromNodeEdge from './createGraphFromNodeEdge';
import formatUtil from '../../util/format';
var GraphSeries = echarts.extendSeriesModel({
type: 'series.graphGL',
visualColorAccessPath: 'itemStyle.color',
init: function (option) {
GraphSeries.superApply(this, 'init', arguments);
// Provide data for legend select
this.legendDataProvider = function () {
return this._categoriesData;
};
this._updateCategoriesData();
},
import echarts from 'echarts/lib/echarts';
import componentShadingMixin from '../../component/common/componentShadingMixin';
function transformPolygon(coordSys, poly) {
var ret = [];
for (var i = 0; i < poly.length; i++) {
ret.push(coordSys.dataToPoint(poly[i]));
}
return ret;
}
var Polygons3DSeries = echarts.extendSeriesModel({
type: 'series.polygons3D',
getRegionModel: function (idx) {
return this.getData().getItemModel(idx);
},
getRegionPolygonCoords: function (idx) {
var coordSys = this.coordinateSystem;
var itemModel = this.getData().getItemModel(idx);
var coords = itemModel.option instanceof Array
? itemModel.option : itemModel.getShallow('coords');
if (!itemModel.get('multiPolygon')) {
coords = [coords];
}
// TODO Validate
import echarts from 'echarts/lib/echarts';
echarts.extendSeriesModel({
type: 'series.lines3D',
dependencies: ['globe'],
visualColorAccessPath: 'lineStyle.color',
getInitialData: function (option, ecModel) {
var lineData = new echarts.List(['value'], this);
lineData.hasItemOption = false;
lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {
// dataItem is simply coords
if (dataItem instanceof Array) {
return NaN;
}
else {
import echarts from 'echarts/lib/echarts';
import componentShadingMixin from '../../component/common/componentShadingMixin';
import formatTooltip from '../common/formatTooltip';
import createList from '../common/createList';
var SurfaceSeries = echarts.extendSeriesModel({
type: 'series.surface',
dependencies: ['globe', 'grid3D', 'geo3D'],
visualColorAccessPath: 'itemStyle.color',
formatTooltip: function (dataIndex) {
return formatTooltip(this, dataIndex);
},
getInitialData: function (option, ecModel) {
var data = option.data;
function validateDimension(dimOpts) {
return !(isNaN(dimOpts.min) || isNaN(dimOpts.max) || isNaN(dimOpts.step));
import echarts from 'echarts/lib/echarts';
import formatUtil from '../../util/format';
import formatTooltip from '../common/formatTooltip';
echarts.extendSeriesModel({
type: 'series.scatter3D',
dependencies: ['globe', 'grid3D', 'geo3D'],
visualColorAccessPath: 'itemStyle.color',
getInitialData: function (option, ecModel) {
var coordSysDimensions = echarts.getCoordinateSystemDimensions(this.get('coordinateSystem')) || ['x', 'y', 'z'];
var dimensions = echarts.helper.completeDimensions(coordSysDimensions, option.data, {
encodeDef: this.get('encode'),
dimsDef: this.get('dimensions')
});
var data = new echarts.List(dimensions, this);
data.initData(option.data);
return data;
import echarts from 'echarts/lib/echarts';
import formatTooltip from '../common/formatTooltip';
import createList from '../common/createList';
var Line3DSeries = echarts.extendSeriesModel({
type: 'series.line3D',
dependencies: ['grid3D'],
visualColorAccessPath: 'lineStyle.color',
getInitialData: function (option, ecModel) {
return createList(this);
},
formatTooltip: function (dataIndex) {
return formatTooltip(this, dataIndex);
},
defaultOption: {
import componentLightMixin from '../../component/common/componentLightMixin';
import componentShadingMixin from '../../component/common/componentShadingMixin';
import geo3DModelMixin from '../../coord/geo3D/geo3DModelMixin';
import formatUtil from '../../util/format';
import formatTooltip from '../common/formatTooltip';
import geo3DCreator from '../../coord/geo3DCreator';
function transformPolygon(mapbox3DCoordSys, poly) {
var newPoly = [];
for (var k = 0; k < poly.length; k++) {
newPoly.push(mapbox3DCoordSys.dataToPoint(poly[k]));
}
return newPoly;
}
var Map3DSeries = echarts.extendSeriesModel({
type: 'series.map3D',
layoutMode: 'box',
coordinateSystem: null,
visualColorAccessPath: 'itemStyle.color',
optionUpdated: function (newOpt) {
newOpt = newOpt || {};
var coordSysType = this.get('coordinateSystem');
if (coordSysType == null || coordSysType === 'geo3D') {
return;
}
import echarts from 'echarts/lib/echarts';
import { concatArray } from 'zrender/lib/core/util';
var LinesSeries = echarts.extendSeriesModel({
type: 'series.linesGL',
dependencies: ['grid', 'geo'],
visualColorAccessPath: 'lineStyle.color',
streamEnabled: true,
init: function (option) {
var result = this._processFlatCoordsArray(option.data);
this._flatCoords = result.flatCoords;
this._flatCoordsOffset = result.flatCoordsOffset;
if (result.flatCoords) {
option.data = new Float32Array(result.count);
}
var completeDimensions = require('echarts/lib/data/helper/completeDimensions');
var echarts = require('echarts/lib/echarts');
echarts.extendSeriesModel({
type: 'series.wordCloud',
visualColorAccessPath: 'textStyle.normal.color',
optionUpdated: function () {
var option = this.option;
option.gridSize = Math.max(Math.floor(option.gridSize), 4);
},
getInitialData: function (option, ecModel) {
var dimensions = completeDimensions(['value'], option.data);
var list = new echarts.List(dimensions, this);
list.initData(option.data);
return list;
},
import echarts from 'echarts/lib/echarts';
import componentShadingMixin from '../../component/common/componentShadingMixin';
import formatUtil from '../../util/format';
import formatTooltip from '../common/formatTooltip';
import createList from '../common/createList';
var Bar3DSeries = echarts.extendSeriesModel({
type: 'series.bar3D',
dependencies: ['globe'],
visualColorAccessPath: 'itemStyle.color',
getInitialData: function (option, ecModel) {
return createList(this);
},
getFormattedLabel: function (dataIndex, status, dataType, dimIndex) {
var text = formatUtil.getFormattedLabel(this, dataIndex, status, dataType, dimIndex);
if (text == null) {
text = this.getData().get('z', dataIndex);
}