Welcome to mirror list, hosted at ThFree Co, Russian Federation.

path.vue « graph « components « monitoring « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b6a257a34b8c7cbcd81f576e38f586dfc409eff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<script>
export default {
  props: {
    generatedLinePath: {
      type: String,
      required: true,
    },
    generatedLinePaths: {
      type: Array,
      required: true,
    },
    generatedAreaPath: {
      type: String,
      required: true,
    },
    generatedAreaPaths: {
      type: Array,
      required: true,
    },
    lineStyle: {
      type: String,
      required: false,
      default: '',
    },
    lineColor: {
      type: String,
      required: true,
    },
    areaColor: {
      type: String,
      required: true,
    },
    currentCoordinates: {
      type: Object,
      required: false,
      default: () => ({ currentX: 0, currentY: 0 }),
    },
    showDot: {
      type: Boolean,
      required: true,
    },
  },
  computed: {
    strokeDashArray() {
      if (this.lineStyle === 'dashed') return '3, 1';
      if (this.lineStyle === 'dotted') return '1, 1';
      return null;
    },
  },
};
</script>
<template>
  <g transform="translate(-5, 20)">
    <circle
      v-if="showDot"
      :cx="currentCoordinates.currentX"
      :cy="currentCoordinates.currentY"
      :fill="lineColor"
      :stroke="lineColor"
      class="circle-path"
      r="3"
    />
    <path
      v-for="generatedAreaPath in generatedAreaPaths"
      :d="generatedAreaPath"
      :fill="areaColor"
      class="metric-area"
    />
    <path
      v-for="(generatedLinePath, index) in generatedLinePaths"
      :d="generatedLinePath"
      :key="index"
      :stroke="lineColor"
      :stroke-dasharray="strokeDashArray"
      class="metric-line"
      fill="none"
      stroke-width="1"
    />
  </g>
</template>