import _defineProperty from '@babel/runtime/helpers/defineProperty';
import assign from '../../utils/assign.js';
import config, { axis, options } from '../../config.js';
import { to } from '../../utils/tools.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, {
  $mark: {
    z: 10,
    name: '标注',
    type: 'custom',
    xAxisIndex: 1
  },
  color: config.color,
  title: {
    show: false,
    text: '水位流量图'
  },
  grid: {
    top: 60,
    bottom: 50,
    left: 80,
    right: 20
  },
  tooltip: false,
  dataset: {
    source: []
  },
  legend: {
    top: 10
  },
  xAxis: [_objectSpread(_objectSpread({}, axis), {}, {
    name: '流量（m³/s）',
    type: 'value',
    boundaryGap: false,
    axisLine: {
      onZero: false
    },
    nameLocation: 'middle',
    nameGap: 25,
    splitNumber: 10,
    min: 0,
    max: function max(v) {
      return Math.ceil(v.max + v.max * 0.05);
    }
  }), {
    show: false,
    min: 0,
    max: function max(v) {
      return v.max;
    }
  }],
  yAxis: [_objectSpread(_objectSpread({}, axis), {}, {
    name: '水位（m）',
    type: 'value',
    nameLocation: 'middle',
    splitNumber: 10,
    nameGap: 50,
    axisPointer: {
      show: true,
      label: {
        formatter: function formatter(p) {
          return to(p.value);
        }
      }
    },
    min: function min(v) {
      return to(v.min - (v.max - v.min) * 0.1);
    },
    max: function max(v) {
      return to(v.max + (v.max - v.min) * 0.1);
    }
  }), _objectSpread({}, axis)],
  series: [{
    type: 'line',
    name: '流量（m³/s）',
    smooth: true,
    encode: {
      x: 1,
      y: 0
    },
    lineStyle: {
      color: '#43CBFF',
      width: 2
    },
    itemStyle: {
      opacity: 0
    },
    emphasis: {
      itemStyle: {
        opacity: 1,
        borderColor: '#43CBFF'
      }
    }
  }]
});

export { def as default };
