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

LimitLabel.vue « chart « plot « plugins « src - github.com/nasa/openmct.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2bb2c2f248e47d5ddb24f48144370c9df1f23bbc (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
<template>
<div
    class="c-plot-limit"
    :style="styleObj"
    :class="limitClass"
>
    <div class="c-plot-limit__label">
        <span class="c-plot-limit__direction-icon"></span>
        <span class="c-plot-limit__severity-icon"></span>
        <span class="c-plot-limit__limit-value">{{ limit.value }}</span>
        <span
            class="c-plot-limit__series-color-swatch"
            :style="{ 'background-color': limit.seriesColor }"
        ></span>
        <span class="c-plot-limit__series-name">{{ limit.name }}</span>
    </div>
</div>
</template>

<script>
import { getLimitClass } from "./limitUtil";

export default {
    props: {
        limit: {
            type: Object,
            required: true,
            default() {
                return {};
            }
        },
        point: {
            type: Object,
            required: true,
            default() {
                return {};
            }
        }
    },
    computed: {
        styleObj() {
            const top = `${this.point.top}px`;

            return {
                'top': top
            };
        },
        limitClass() {
            return getLimitClass(this.limit, 'c-plot-limit--');
        }
    }
};
</script>