UNPKG

bytev-charts-beta1.0

Version:

测试版-1.0,版本号为小版本; 基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;

416 lines (342 loc) 15.4 kB
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 BarBasicGradient from './impl/echartsComponent/barComponent/BarBasicGradient.js'; import BarFilletGradient from './impl/echartsComponent/barComponent/BarFilletGradient.js'; import BarBasicFillet from "./impl/echartsComponent/barComponent/BarBasicFillet.js"; import BarBasicStack from './impl/echartsComponent/barComponent/BarBasicStack.js'; import BarFilletStack from "./impl/echartsComponent/barComponent/BarFilletStack.js"; import BarCone from './impl/echartsComponent/barComponent/BarCone.js'; import BarBasicLabel from './impl/echartsComponent/barComponent/BarBasicLabel.js'; import BarFilletLabel from './impl/echartsComponent/barComponent/BarFilletLabel.js'; import BarBidirectional from './impl/echartsComponent/barComponent/BarBidirectional.js'; import BarZebra from './impl/echartsComponent/barComponent/BarZebra.js'; import BarCube from './impl/echartsComponent/barComponent/BarCube.js'; import BarLineBasic from './impl/echartsComponent/barLineComponent/BarLineBasic.js'; import BarLineBasicGradient from './impl/echartsComponent/barLineComponent/BarLineBasicGradient.js'; import BarLineFillet from './impl/echartsComponent/barLineComponent/BarLineFillet.js'; import BarLineFilletGradient from './impl/echartsComponent/barLineComponent/BarLineFilletGradient.js'; import BarLineZebra from './impl/echartsComponent/barLineComponent/BarLineZebra.js'; import BarLineStack from './impl/echartsComponent/barLineComponent/BarLineStack.js'; import HorizontalBarBasicLabel from './impl/echartsComponent/horizontalBarComponent/HorizontalBarBasicLabel.js'; import HorizontalBarFilletLabel from './impl/echartsComponent/horizontalBarComponent/HorizontalBarFilletLabel.js'; import HorizontalBarBasic from './impl/echartsComponent/horizontalBarComponent/HorizontalBarBasic.js'; import HorizontalBarBasicFillet from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarBasicFillet.js"; import HorizontalBarBasicStack from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarBasicStack.js"; import HorizontalBarFilletStack from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarFilletStack.js"; import HorizontalBarDiamond from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarDiamond.js"; import HorizontalBarDiamondStack from "./impl/echartsComponent/horizontalBarComponent/HorizontalBarDiamondStack.js"; /*仪表盘*/ import GaugeBasic from "./impl/echartsComponent/gaugeComponent/GaugeBasic.js"; import GaugeBasicSemicircle from "./impl/echartsComponent/gaugeComponent/GaugeBasicSemicircle.js"; import GaugeProgressBasic from "./impl/echartsComponent/gaugeComponent/GaugeProgressBasic.js"; import GaugeProgressSemicircle from "./impl/echartsComponent/gaugeComponent/GaugeProgressSemicircle.js"; /*仪表盘时钟*/ import GaugeClockBasic from "./impl/echartsComponent/gaugeClockComponent/GaugeClockBasic.js"; import GaugeClockLaserPointer from "./impl/echartsComponent/gaugeClockComponent/GaugeClockLaserPointer.js"; // /*基本进度条*/ // import ProgressBarBasic from "./impl/echartsComponent/ProgressBarComponent/ProgressBarBasic.js"; // /*基本圆角进度条*/ // import ProgressBarBasicFillet from "./impl/echartsComponent/ProgressBarComponent/ProgressBarBasicFillet.js"; /*圆形斑马进度条*/ import ProgressCircleZebra from "./impl/echartsComponent/progressCircleComponent/ProgressCircleZebra.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 PieCapsuleBasic from './impl/echartsComponent/pieComponent/PieCapsuleBasic.js'; import DoughnutThinShadow from './impl/echartsComponent/doughnutLeftRightComponent/DoughnutThinShadow.js'; import DoughnutBeadSight from './impl/echartsComponent/doughnutLeftRightComponent/DoughnutBeadSight.js'; import DoughnutCapsuleBasic from './impl/echartsComponent/doughnutLeftRightComponent/DoughnutCapsuleBasic.js'; import DoughnutCapsuleShine from './impl/echartsComponent/doughnutLeftRightComponent/DoughnutCapsuleShine.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"; import RadialPieGraph from "./impl/echartsComponent/doughnutLeftRightComponent/RadialPieGraph.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) { //基本柱状图 //case Symbol.for('BarBasic'): case 'BarBasic': component = new BarBasic(element, option); break; //基本渐变柱状图 case 'BarBasicGradient': component = new BarBasicGradient(element, option); break; //圆角渐变柱状图 case 'BarFilletGradient': component = new BarFilletGradient(element, option); break; //基本圆角柱状图 case 'BarBasicFillet': component = new BarBasicFillet(element, option); break; //基本堆叠柱状图 case 'BarBasicStack': component = new BarBasicStack(element, option); break; //圆角堆叠柱状图 case 'BarStackFillet': case 'BarFilletStack': component = new BarFilletStack(element, option); break; //标签基本柱状图 case 'BarLabel': case 'BarBasicLabel': component = new BarBasicLabel(element, option); break; //标签圆角柱状图 case 'BarFilletLabel': component = new BarFilletLabel(element, option); break; //双向柱状图 case 'BarBidirectional': //正负柱状图 case 'BarPlusMinus': component = new BarBidirectional(element, option); break; //柱状斑马图 case 'BarZebra': component = new BarZebra(element, option); break; //立方体柱状图 case 'BarCube': //3D柱状图 case 'Bar3DRect': component = new BarCube(element, option); break; //锥形柱图 case 'BarCone': component = new BarCone(element, option); break; //基本柱线图 case 'BarLine': case 'BarLineBasic': component = new BarLineBasic(element, option); break; //基本渐变柱线图 case 'BarLineBasicGradient': component = new BarLineBasicGradient(element, option); break; //圆角柱线图 case 'BarLineFillet': component = new BarLineFillet(element, option); break; //圆角渐变柱线图 case 'BarLineFilletGradient': component = new BarLineFilletGradient(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 'HorizontalBar': //v1.0.9版本之前名称 case 'BarHorizontal': case 'HorizontalBarBasicLabel': component = new HorizontalBarBasicLabel(element, option); break; //横向圆角标签柱状图 case 'HorizontalBarFilletLabel': component = new HorizontalBarFilletLabel(element, option); break; //横向基本柱状图 case 'HorizontalBarBasic': component = new HorizontalBarBasic(element, option); break; //横向基本圆角柱状图 case 'HorizontalBarBasicFillet': component = new HorizontalBarBasicFillet(element, option); break; //横向基本堆叠柱状图 case 'HorizontalBarStack': case 'HorizontalBarBasicStack': component = new HorizontalBarBasicStack(element, option); break; //横向圆角堆叠柱状图 case 'HorizontalBarStackFillet': //1.0.05之前版本的图表id名称 case 'BarHorizontalStackFillet': case 'HorizontalBarFilletStack': component = new HorizontalBarFilletStack(element, option); break; //横向菱形柱状图 case 'HorizontalBarDiamond': component = new HorizontalBarDiamond(element, option); break; //横向菱形堆叠柱状图 case 'HorizontalBarStackDiamond': //1.0.05之前版本的图表id名称 case 'BarHorizontalStackDiamond': case 'HorizontalBarDiamondStack': component = new HorizontalBarDiamondStack(element, option); break; //基本仪表盘 case 'GaugeBasic': component = new GaugeBasic(element, option); break; //基础半圆仪表盘 case 'GaugeBasicSemicircle': component = new GaugeBasicSemicircle(element, option); break; //基本进度仪表盘 case 'GaugeProgressBasic': component = new GaugeProgressBasic(element, option); break; //半圆进度仪表盘 case 'GaugeProgressSemicircle': component = new GaugeProgressSemicircle(element, option); break; //基础仪表盘时钟 case 'GaugeClockBasic': component = new GaugeClockBasic(element, option); break; //仪表盘时钟直线指针/激光指针 case 'GaugeClockLaserPointer': component = new GaugeClockLaserPointer(element, option); break; // //基本进度条 // case 'ProgressBarBasic': // case 'PmgressBarBasic': // component = new ProgressBarBasic(element, option); // break; // // //基本圆角进度条 // case 'ProgressBarBasicFillet': // case 'PmgressBarBasicFillet': // component = new ProgressBarBasicFillet(element, option); // break; //圆形斑马进度条 case 'ProgressCircleZebra': component = new ProgressCircleZebra(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 'PieCapsuleBasic': component = new PieCapsuleBasic(element, option); break; //细阴影环形饼图 case 'DoughnutThinShadow': component = new DoughnutThinShadow(element, option); break; //瞄准星环形饼图 case 'DoughnutBeadSight': component = new DoughnutBeadSight(element, option); break; //基本胶囊环形图 case 'DoughnutCapsuleBasic': component = new DoughnutCapsuleBasic(element, option); break; //发光胶囊环形图 case 'DoughnutCapsuleShine': component = new DoughnutCapsuleShine(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; //玉珏图/径向占比图 case 'RadialPieGraph': component = new RadialPieGraph(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 };