BigW Consortium Gitlab

path.vue 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<script>
  export default {
    props: {
      generatedLinePath: {
        type: String,
        required: true,
      },
      generatedAreaPath: {
        type: String,
        required: true,
      },
12 13
      lineStyle: {
        type: String,
Mike Greiling committed
14
        required: false,
15
      },
16 17 18 19 20 21 22 23 24
      lineColor: {
        type: String,
        required: true,
      },
      areaColor: {
        type: String,
        required: true,
      },
    },
25 26 27 28 29 30 31
    computed: {
      strokeDashArray() {
        if (this.lineStyle === 'dashed') return '3, 1';
        if (this.lineStyle === 'dotted') return '1, 1';
        return null;
      },
    },
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
  };
</script>
<template>
  <g>
    <path
      class="metric-area"
      :d="generatedAreaPath"
      :fill="areaColor"
      transform="translate(-5, 20)">
    </path>
    <path
      class="metric-line"
      :d="generatedLinePath"
      :stroke="lineColor"
      fill="none"
47
      stroke-width="1"
48
      :stroke-dasharray="strokeDashArray"
49 50 51 52
      transform="translate(-5, 20)">
    </path>
  </g>
</template>