/**
 * 
 *     @dfsj/echarts： 专业的水文曲线组件或构造函数以及通用的echart二次封装图表
 *     版本: v3.7.0
 *     作者：yangbo <1747837358@qq.com>
 *     日期：2025-05-27 15:53:33
 *     
 *     
 */

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import * as echarts from 'echarts';
import config, { axis, options } from '../../config.js';
import { to } from '../../utils/tools.js';
import assign from '../../utils/assign.js';

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 def = assign({}, options, {
  $current: {
    z: 100,
    silent: true,
    type: 'scatter',
    symbol: "path://".concat(config.icon.stageMirror),
    symbolSize: 160,
    symbolKeepAspect: true,
    symbolOffset: [-50, -3],
    showEffectOn: 'render',
    rippleEffect: {
      brushType: 'stroke'
    },
    label: {
      show: true,
      color: '#fff',
      textBorderColor: config.markColor[1],
      textBorderWidth: 3,
      offset: [-20, 4],
      align: 'right',
      lineHeight: 20,
      fontSize: 13,
      fontWeight: 'bold',
      position: 'right',
      formatter: function formatter(p) {
        return "".concat(p.name, " (").concat(p.data.value[2]).concat(p.data.value[3], ")");
      }
    },
    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,
    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'
    }
  },
  color: config.color,
  grid: {
    top: 60,
    bottom: 20,
    left: 80,
    right: 80
  },
  title: {
    x: 'center',
    text: '横断面示意图',
    top: 10,
    textStyle: {
      fontSize: 15
    }
  },
  legend: {
    show: false
  },
  dataset: {
    source: []
  },
  tooltip: {
    formatter: function formatter(e) {
      return "".concat(e.value[2], "\uFF1A").concat(e.value[1], "\uFF08m\uFF09");
    }
  },
  timeline: {
    z: 20,
    axisType: 'category',
    autoPlay: false,
    playInterval: 1000,
    bottom: 0,
    left: 100,
    right: 100,
    xAxisIndex: 0,
    symbol: 'circle',
    data: null
  },
  xAxis: {
    type: 'value',
    axisTick: false,
    axisLabel: false,
    splitLine: false,
    axisLine: false,
    min: function min(v) {
      return v.min;
    },
    max: function max(v) {
      return v.max;
    }
  },
  yAxis: _objectSpread(_objectSpread({}, axis), {}, {
    name: '高程(m)',
    splitLine: false,
    axisLabel: {
      formatter: function formatter(v) {
        return to(v, '0.0');
      }
    },
    nameTextStyle: {
      align: 'right'
    },
    min: function min(v) {
      return Math.max(v.min - 1, 0);
    }
  }),
  series: [{
    z: 1,
    name: 'layout',
    type: 'line',
    lineStyle: {
      opacity: 0
    },
    itemStyle: {
      opacity: 0
    },
    areaStyle: {
      opacity: 1,
      color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
        offset: 0,
        color: '#ffcba8'
      }, {
        offset: 1,
        color: '#a87f67'
      }], false)
    }
  }]
});

export { def as default };
