UNPKG

@dfsj/echarts

Version:

专业的水文曲线组件或构造函数以及通用的echart二次封装图表

307 lines (303 loc) 7.44 kB
/** * * @dfsj/echarts: 专业的水文曲线组件或构造函数以及通用的echart二次封装图表 * 版本: v3.7.0-alpha.5 * 作者:yangbo <1747837358@qq.com> * 日期:2025-11-21 13:30:34 * * */ import _defineProperty from '@babel/runtime/helpers/defineProperty'; import config, { axis, options } from '../../config.js'; import { to } from '../../utils/tools.js'; import img from './images/0.png.js'; import img$1 from './images/1.png.js'; import img$2 from './images/2.png.js'; import img$3 from './images/3.png.js'; import img$4 from './images/4.png.js'; import img$5 from './images/5.png.js'; import img$6 from './images/6.png.js'; import img$7 from './images/7.png.js'; import img$8 from './images/8.png.js'; import img$9 from './images/9.png.js'; import assign from '../../utils/assign.js'; var _TYPES; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var IMAGES = [img, img$1, img$2, img$3, img$4, img$5, img$6, img$7, img$8, img$9]; var TYPES = (_TYPES = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_TYPES, -1, { section: [30, 1000, 50, 1080, 1920], water: [function (y) { return 1080; }, function (y) { return 1080; }], point: function point(y) { return Math.round(y) < 30 ? 1020 : (700700 + 310 * y) / 1000; }, mark: [1000, 900] }), 0, { section: [30, 1000, 50, 1080, 1920], water: [function (y) { return 1200; }, function (y) { return 1200; }], point: function point(y) { return Math.round(y) < 30 ? 1110 : (185060 + 898 * y) / 1000; }, mark: [1100, 900] }), 1, { section: [30, 1000, 50, 1080, 1920], water: [function (y) { return 1200; }, function (y) { return 1200; }], point: function point(y) { return Math.round(y) < 30 ? 1180 : (253000 + 900 * y) / 1000; }, mark: [1200, 900] }), 2, { section: [34, 1000, 50, 1080, 1920], water: [function (y) { return 1200; }, function (y) { return 1200; }], point: function point(y) { return Math.round(y) < 30 ? 1070 : (40000 + 1000 * y) / 1000; }, mark: [1100, 900] }), 3, { section: [34, 962, 88, 1080, 1920], water: [function (y) { return 1223; }, function (y) { return 956; }], point: function point(y) { return Math.round(y) < 30 ? 1440 : y < 316 ? 940 : (555168 + 257 * y) / 677; }, mark: [1250, 800] }), 4, { section: [34, 962, 88, 1080, 1920], water: [function (y) { return 1223; }, function (y) { return 956; }], point: function point(y) { return Math.round(y) < 30 ? 1440 : y < 316 ? 940 : (555168 + 257 * y) / 677; }, mark: [1250, 800] }), 5, { section: [34, 1000, 50, 1080, 1920], water: [function (y) { return 1200; }, function (y) { return 1200; }], point: function point(y) { return Math.round(y) < 30 ? 1070 : (40000 + 1000 * y) / 1000; }, mark: [1100, 900] }), 6, { section: [34, 1000, 50, 1080, 1920], water: [function (y) { return 1200; }, function (y) { return 1200; }], point: function point(y) { return Math.round(y) < 30 ? 1070 : (40000 + 1000 * y) / 1000; }, mark: [1100, 900] }), 7, { section: [34, 1000, 50, 1080, 1920], water: [function (y) { return 1200; }, function (y) { return 1200; }], point: function point(y) { return Math.round(y) < 30 ? 1070 : (40000 + 1000 * y) / 1000; }, mark: [1100, 900] }), 8, { section: [43, 945, 92, 1080, 1920], water: [function (y) { return 1000; }, function (y) { return 1000; }], point: function point(y) { return Math.round(y) < 43 ? 1670 : y > 340 ? 960 : (253500 + 93 * y) / 297; }, mark: [1130, 800] }), _defineProperty(_TYPES, 9, { section: [48, 945, 90, 1080, 1920], water: [function (y) { return 1000; }, function (y) { return 1000; }], point: function point(y) { return Math.round(y) < 43 ? 1670 : y > 340 ? 960 : (253500 + 93 * y) / 297; }, mark: [1130, 800] })); var def = assign({}, options, { $capacity: { symbol: 'circle', symbolSize: 1, label: { fontSize: 18, offset: [110, 0], color: '#fff', textShadowBlur: 5, textShadowColor: config.markColor[1] } }, $stage: { symbol: "path://".concat(config.icon.stage), symbolSize: 160, symbolOffset: [100, -3], label: { fontSize: 15, offset: [33, -5] } }, $current: { z: 3, silent: true, type: 'scatter', symbolKeepAspect: true, hoverAnimation: true, showEffectOn: 'render', rippleEffect: { brushType: 'stroke' }, label: { show: true, color: 'inherit', fontSize: 16, fontWeight: 'bold' }, itemStyle: { color: config.markColor[1], shadowBlur: 5, shadowColor: 'rgba(51,51,51,0.56)', shadowOffsetX: 1, shadowOffsetY: 1 } }, $water: { z: 0, type: 'water', symbolSize: 0, xAxisIndex: 0, tooltip: false, count: 3, itemStyle: { color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0.0, color: 'skyblue' }, { offset: 0.7, color: 'deepskyblue' }], global: false } } }, $area: { history: { title: '历史', symbol: 'circle' }, forecast: { title: '预报', symbol: 'emptyCircle' } }, title: { x: 'center', text: '大坝示意图', top: 10, textStyle: { fontSize: 15 } }, color: config.color, legend: false, tooltip: { formatter: function formatter(e) { return "".concat(e.value[6], "\uFF1A").concat(e.value[1], "\uFF08m\uFF09"); } }, grid: { top: 60, bottom: 30, left: 80, right: 80 }, timeline: { axisType: 'category', autoPlay: false, playInterval: 1000, bottom: 0, left: 80, right: 80, data: null, z: 3, label: { color: '#fff' }, progress: { label: { color: '#4ff8c4' } } }, xAxis: { type: 'value', min: 0, max: 1920, axisTick: false, axisLabel: false, splitLine: false, axisLine: false }, yAxis: _objectSpread(_objectSpread({}, axis), {}, { name: '高程(m)', type: 'value', splitLine: false, axisLabel: { formatter: function formatter(v) { return to(v); } }, nameTextStyle: { align: 'right' } }), graphic: { type: 'image', id: 'background', bounding: 'raw', left: 80, bottom: 30, z: 1, position: [0, 0], style: {} }, series: [] }); export { IMAGES, TYPES, def as default };