Mercurial > gemma
view client/src/components/DiagramLegend.vue @ 5586:215e6ba9651b surveysperbottleneckid
Added property "displayName" to bottlenecks.
Before displayed, bottlenecks ordered by country
are now checked for doubles per country.
In case a double is found the displayName is enriched with the
bottleneck_id. Otherwise the displayName is equal to "name" or "objnam".
Example:
const testList = [
{
properties: {
responsible_country: "AT",
name: "Bananas",
bottleneck_id: "BN1"
}
},
{
properties: {
responsible_country: "DE",
name: "Bananas",
bottleneck_id: "BN2"
}
},
{
properties: {
responsible_country: "DE",
name: "Bananas",
bottleneck_id: "BN3"
}
}
];
is rendered to:
AT
Bananas
DE
Bananas / BN2
Bananas / BN3
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 04 Apr 2022 15:12:43 +0200 |
parents | 23ff3f48c0f9 |
children | 84d01a536bec |
line wrap: on
line source
<template> <div :class="['diagram-legend', { collapsed }]"> <span class="box-control toggle" @click="collapsed = !collapsed"> <font-awesome-icon icon="angle-left" fixed-width /> </span> <div class="d-flex align-items-center justify-content-center w-100" style="overflow: hidden" v-if="!collapsed" > <div class="text-left px-3"> <slot /> </div> </div> </div> </template> <style lang="sass"> .diagram-legend position: relative width: 180px font-size: 0.8rem display: flex border-right: solid 1px #dee2e6 .toggle margin-left: 0 position: absolute z-index: 1 top: 0.25rem left: 0.25rem svg transition: transform 0.3s &.collapsed width: 0 border-right: none .toggle left: 0.25rem svg transform: rotateY(180deg) .legend margin: 10px 0 span vertical-align: middle display: inline-block width: 12px height: 12px border-radius: 50% </style> <script> /* This is Free Software under GNU Affero General Public License v >= 3.0 * without warranty, see README.md and license for details. * * SPDX-License-Identifier: AGPL-3.0-or-later * License-Filename: LICENSES/AGPL-3.0.txt * * Copyright (C) 2018 by via donau * – Österreichische Wasserstraßen-Gesellschaft mbH * Software engineering by Intevation GmbH * * Author(s): * Markus Kottländer <markus.kottlaender@intevation.de> */ export default { data() { return { collapsed: false }; }, watch: { collapsed() { this.$nextTick(this.$parent.drawDiagram); } } }; </script>