const scale = {
  field: '',
  type: 'linear'
}

const shape = {
  label: 'text',
  heatmap: 'heatmap',
  line: 'line',
  polygon: 'fill',
  default: 'circle'
}

const action = {
  active: true,
  select: false
}

const style = {
  scatter: {
    color: '#ff0000',
    size: 5,
    opacity: 1,
    stroke: '#ffffff',
    strokeWidth: 0
  },
  label: {
    color: '#ff0000',
    size: 14,
    opacity: 1,
    textAnchor: 'center',
    spacing: 0,
    padding: [5, 5],
    stroke: undefined,
    strokeWidth: 1,
    strokeOpacity: 0.5,
    fontWeight: 'normal',
    fontFamily: 'Microsoft YaHei',
    textOffset: [0, 0],
    textAllowOverlap: true
  },
  heatmap: {
    field: '',
    intensity: 3,
    radius: 20,
    colors: [
      'rgba(33,102,172,0.0)',
      'rgb(103,169,207)',
      'rgb(209,229,240)',
      'rgb(253,219,199)',
      'rgb(239,138,98)',
      'rgb(178,24,43,1.0)'
    ]
  },
  bar: {
    dataItems: [],
    barWidth: 15,
    height: 100,
    barGap: 0.1,
    offset: [0, 0],
    showLabel: true,
    labelSize: 14,
    labelColor: undefined
  },
  pie: {
    dataItems: [],
    type: 'pie',
    size: 100,
    offset: [0, 0],
    showLabel: true,
    labelSize: 14,
    labelColor: undefined
  },
  line: {
    color: '#4CC8A3',
    lineWidth: 2,
    lineType: 'solid',
    dashArray: [4, 4],
    animate: false
  },
  polygon: {
    color: '#8534B3',
    lineColor: '#ffffff',
    lineWidth: 1,
    lineType: 'solid',
    dashArray: [4, 4]
  },
  admin: {
    line: {
      stroke: '#ffffff',
      strokeWidth: 1
    },
    label: {
      enable: false,
      color: '#ff0000',
      size: 14,
      opacity: 1,
      spacing: 0,
      stroke: undefined,
      strokeWidth: 1,
      strokeOpacity: 0.5,
      textOffset: [0, 0],
      textAllowOverlap: true
    },
    fill: {
      color: '#cccccc',
      activeColor: '#fff000'
    },
    bubble: {
      enable: false,
      color: '#0099ff',
      size: 10,
      shape: 'circle',
      stroke: '#ffffff',
      strokeWidth: 0
    }
  }
}

export default function getDefaultProperties(type) {
  return {
    scale,
    shape: shape[type] || shape.default,
    style: style[type],
    action
  }
}
