bytev-charts
Version:
基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;
275 lines (225 loc) • 9.61 kB
JavaScript
import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck";
import _createClass from "@babel/runtime-corejs2/helpers/createClass";
/*
*
* */
/* echarts类 */
import EchartsComponent from './impl/EchartsComponent.class.js';
import BarBasic from './impl/echartsComponent/barComponent/BarBasic.js';
import BarBasicFillet from "./impl/echartsComponent/barComponent/BarBasicFillet.js";
import BarStack from './impl/echartsComponent/barComponent/BarStack.js';
import BarStackFillet from "./impl/echartsComponent/barComponent/BarStackFillet.js";
import BarCone from './impl/echartsComponent/barComponent/BarCone.js';
import BarLabel from './impl/echartsComponent/barComponent/BarLabel.js';
import BarBidirectional from './impl/echartsComponent/barComponent/BarBidirectional.js';
import BarZebra from './impl/echartsComponent/barComponent/BarZebra.js';
import BarLine from './impl/echartsComponent/barLineComponent/BarLine.js';
import BarLineZebra from './impl/echartsComponent/barLineComponent/BarLineZebra.js';
import BarLineStack from './impl/echartsComponent/barLineComponent/BarLineStack.js';
import HorizontalBar from './impl/echartsComponent/horizontalBarComponent/HorizontalBar.js';
import HorizontalBarBasic from './impl/echartsComponent/horizontalBarComponent/HorizontalBarBasic.js';
import HorizontalBarBasicFillet from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarBasicFillet.js";
import HorizontalBarStack from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarStack.js";
import HorizontalBarStackDiamond from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarStackDiamond.js";
import HorizontalBarStackFillet from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarStackFillet.js";
import LineBasic from './impl/echartsComponent/lineComponent/LineBasic.js';
import LineFill from './impl/echartsComponent/lineComponent/LineFill.js';
import LineStack from './impl/echartsComponent/lineComponent/LineStack.js';
import LineDecorateBar from './impl/echartsComponent/lineComponent/LineDecorateBar.js';
import LineDualAxis from "./impl/echartsComponent/lineComponent/LineDualAxis.js";
import RadarBasic from './impl/echartsComponent/radarComponent/RadarBasic.js';
import RadarCircle from './impl/echartsComponent/radarComponent/RadarCircle.js';
import ScatterBasic from './impl/echartsComponent/barComponent/ScatterBasic.js';
import PieBasic from './impl/echartsComponent/pieComponent/PieBasic.js';
import DoughnutBasic from './impl/echartsComponent/pieComponent/DoughnutBasic.js';
import DoughnutThinShadow from './impl/echartsComponent/doughnutLeftRightComponent/DoughnutThinShadow.js';
import DoughnutBeadSight from './impl/echartsComponent/doughnutLeftRightComponent/DoughnutBeadSight.js';
import RoseRadius from './impl/echartsComponent/pieComponent/RoseRadius.js';
import RoseArea from './impl/echartsComponent/pieComponent/RoseArea.js';
import RadialBarGraph from "./impl/echartsComponent/doughnutLeftRightComponent/RadialBarGraph.js";
/* three 类 */
// import ThreeComponent from "./impl/ThreeComponent-oldapp.class.js";
import ThreeComponent from "./impl/ThreeComponent.class.js";
/* other 类 */
//电子屏数字翻牌器、电子屏数字滚动轴
import DigitalRollerElectronic from "./impl/otherComponent/DigitalRoller/DigitalRollerElectronic/DigitalRollerElectronic.js";
import DigitalRollerElectronicGradient from "./impl/otherComponent/DigitalRoller/DigitalRollerElectronic/DigitalRollerElectronicGradient/DigitalRollerElectronicGradient.js";
var ComponentFactory = /*#__PURE__*/function () {
function ComponentFactory() {
_classCallCheck(this, ComponentFactory);
}
_createClass(ComponentFactory, null, [{
key: "getComponent",
value:
/*
* 根据组件类型ID获取对应组件实例
* 参数: element dom对象
* componentId 组件唯一id
* option { //设置参数
* option: 主题皮肤id,
* screenWidth: 屏幕宽度,
* screenHeight: 屏幕高度
* }
* */
function getComponent(element, componentId, option) {
var component = null;
switch (componentId) {
/*three类组件*/
case 'THREE':
case 'three':
case '3D':
case '3d':
component = new ThreeComponent(element, option);
break;
//基本柱状图
//case Symbol.for('BarBasic'):
case 'BarBasic':
component = new BarBasic(element, option);
break;
//基本柱状图
case 'BarBasicFillet':
component = new BarBasicFillet(element, option);
break;
//堆叠柱状图
case 'BarStack':
component = new BarStack(element, option);
break;
//圆角堆叠柱状图
case 'BarStackFillet':
component = new BarStackFillet(element, option);
break;
//标签柱状图
case 'BarLabel':
component = new BarLabel(element, option);
break;
//双向柱状图
case 'BarBidirectional':
component = new BarBidirectional(element, option);
break;
//柱状斑马图
case 'BarZebra':
component = new BarZebra(element, option);
break;
//锥形柱图
case 'BarCone':
component = new BarCone(element, option);
break;
//柱线图
case 'BarLine':
component = new BarLine(element, option);
break;
//柱线斑马图
case 'BarLineZebra':
component = new BarLineZebra(element, option);
break;
//堆叠柱线图
case 'BarLineStack': //v1.0.06版本之前名称
case 'BarStackLine':
component = new BarLineStack(element, option);
break;
//横向柱状图
case 'BarHorizontal':
component = new HorizontalBar(element, option);
break;
//横向基本柱状图
case 'HorizontalBarBasic':
component = new HorizontalBarBasic(element, option);
break;
//横向基本圆角柱状图
case 'HorizontalBarBasicFillet':
component = new HorizontalBarBasicFillet(element, option);
break;
//横向堆叠柱状图
case 'HorizontalBarStack':
component = new HorizontalBarStack(element, option);
break;
//横向菱形堆叠柱状图
case 'HorizontalBarStackDiamond': //1.0.05之前版本的图表id名称
case 'BarHorizontalStackDiamond':
component = new HorizontalBarStackDiamond(element, option);
break;
//横向圆角堆叠柱状图
case 'HorizontalBarStackFillet': //1.0.05之前版本的图表id名称
case 'BarHorizontalStackFillet':
component = new HorizontalBarStackFillet(element, option);
break;
//基本折线图
case 'LineBasic':
component = new LineBasic(element, option);
break;
//填充折线图
case 'LineFill':
component = new LineFill(element, option);
break;
//堆叠折线图
case 'LineStack':
component = new LineStack(element, option);
break;
//柱装饰折线图
case 'LineDecorateBar': //1.0.05版本之前名字 - 折线柱图
case 'LineBar':
component = new LineDecorateBar(element, option);
break;
//双轴折线图
case 'LineDualAxis':
component = new LineDualAxis(element, option);
break;
//基本雷达图
case 'RadarBasic':
component = new RadarBasic(element, option);
break;
//圆形雷达图
case 'RadarCircle':
component = new RadarCircle(element, option);
break;
//基本散点图
case 'ScatterBasic':
component = new ScatterBasic(element, option);
break;
//基本饼状图
case 'PieBasic':
component = new PieBasic(element, option);
break;
//基本环形饼状图
case 'DoughnutBasic':
component = new DoughnutBasic(element, option);
break;
//细阴影环形饼图
case 'DoughnutThinShadow':
component = new DoughnutThinShadow(element, option);
break;
//瞄准星环形饼图
case 'DoughnutBeadSight':
component = new DoughnutBeadSight(element, option);
break;
//半径玫瑰图
case 'RoseRadius':
component = new RoseRadius(element, option);
break;
//面积玫瑰图
case 'RoseArea':
component = new RoseArea(element, option);
break;
//玉珏图/径向条形图
case 'RadialBarGraph':
component = new RadialBarGraph(element, option);
break;
/* other 类 */
//电子屏数字翻牌器、电子屏数字滚动轴
case 'DigitalRollerElectronic':
component = new DigitalRollerElectronic(element, option);
break;
//电子屏数字翻牌器、电子屏数字滚动轴 背景渐变
case 'DigitalRollerElectronicGradient':
component = new DigitalRollerElectronicGradient(element, option);
break;
default:
component = new EchartsComponent(element, option);
break;
}
return component;
}
}]);
return ComponentFactory;
}();
export { ComponentFactory as default };