comparison client/src/components/fairway/Fairwayprofile.vue @ 2549:9bf6b767a56a

client: refactored and improved splitscreen for diagrams To make different diagrams possible, the splitscreen view needed to be decoupled from the cross profiles. Also the style has changed to make it more consistent with the rest of the app. The standard box header is now used and there are collapse and expand animations.
author Markus Kottlaender <markus@intevation.de>
date Fri, 08 Mar 2019 08:50:47 +0100
parents 3c17d401fbd4
children 83b938bf4da9
comparison
equal deleted inserted replaced
2548:6b34d0fb4498 2549:9bf6b767a56a
1 <template> 1 <template>
2 <div :class="['position-relative', { show: showSplitscreen }]"> 2 <div class="fairwayprofile m-3 mt-0 bg-white flex-grow-1"></div>
3 <div class="profile bg-white position-relative d-flex flex-column">
4 <div
5 class="d-flex flex-row justify-content-between align-items-center border-bottom position-relative"
6 >
7 <div class="flex-row mr-auto ml-auto">
8 <h5
9 class="headline mb-0 py-2"
10 v-if="selectedBottleneck && selectedSurvey"
11 >
12 {{ selectedBottleneck }} ({{ selectedSurvey.date_info }})
13 </h5>
14 </div>
15 <div>
16 <button
17 class="rounded-bottom bg-white border-0 splitscreen-toggle"
18 @click="$store.commit('application/showSplitscreen', false)"
19 v-if="showSplitscreen"
20 >
21 <font-awesome-icon icon="angle-down" />
22 </button>
23 <button
24 class="rounded-bottom bg-white border-0 clear-selection"
25 @click="$store.dispatch('fairwayprofile/clearSelection')"
26 v-if="showSplitscreen"
27 >
28 <font-awesome-icon icon="times" class="pointer" />
29 </button>
30 </div>
31 </div>
32 <div class="d-flex flex-fill">
33 <div
34 class="loading d-flex justify-content-center align-items-center"
35 v-if="surveysLoading || profileLoading"
36 >
37 <font-awesome-icon icon="spinner" spin />
38 </div>
39 <div class="fairwayprofile m-3 mt-0 bg-white flex-grow-1"></div>
40 </div>
41 </div>
42 </div>
43 </template> 3 </template>
44
45 <style lang="scss" scoped>
46 .profile {
47 width: 100vw;
48 height: 0;
49 overflow: hidden;
50 z-index: 2;
51 }
52
53 .splitscreen-toggle,
54 .clear-selection {
55 width: 2rem;
56 height: 2rem;
57 margin-top: 8px;
58 z-index: 3;
59 outline: none;
60 }
61
62 .splitscreen-toggle svg path,
63 .clear-selection svg path {
64 fill: #666;
65 }
66
67 .splitscreen-toggle {
68 right: 2.5rem;
69 }
70
71 .clear-selection {
72 right: 0.5rem;
73 }
74
75 .show .profile {
76 height: 50vh;
77 }
78
79 .loading {
80 background: rgba(255, 255, 255, 0.96);
81 position: absolute;
82 z-index: 99;
83 top: 0;
84 right: 0;
85 bottom: 0;
86 left: 0;
87 }
88 </style>
89 4
90 <script> 5 <script>
91 /* This is Free Software under GNU Affero General Public License v >= 3.0 6 /* This is Free Software under GNU Affero General Public License v >= 3.0
92 * without warranty, see README.md and license for details. 7 * without warranty, see README.md and license for details.
93 * 8 *
98 * – Österreichische Wasserstraßen-Gesellschaft mbH 13 * – Österreichische Wasserstraßen-Gesellschaft mbH
99 * Software engineering by Intevation GmbH 14 * Software engineering by Intevation GmbH
100 * 15 *
101 * Author(s): 16 * Author(s):
102 * Thomas Junk <thomas.junk@intevation.de> 17 * Thomas Junk <thomas.junk@intevation.de>
18 * Markus Kottländer <markus.kottlaender@intevation.de>
103 */ 19 */
104 import * as d3 from "d3"; 20 import * as d3 from "d3";
105 import { mapState, mapGetters } from "vuex"; 21 import { mapState, mapGetters } from "vuex";
106 import debounce from "debounce"; 22 import debounce from "debounce";
107 23
125 } 41 }
126 }; 42 };
127 }, 43 },
128 computed: { 44 computed: {
129 ...mapGetters("fairwayprofile", ["totalLength"]), 45 ...mapGetters("fairwayprofile", ["totalLength"]),
130 ...mapState("application", ["showSplitscreen"]),
131 ...mapState("fairwayprofile", [ 46 ...mapState("fairwayprofile", [
132 "additionalSurvey", 47 "additionalSurvey",
133 "currentProfile", 48 "currentProfile",
134 "endPoint", 49 "endPoint",
135 "fairwayData", 50 "fairwayData",
136 "minAlt", 51 "minAlt",
137 "maxAlt", 52 "maxAlt",
138 "profileLoading",
139 "referenceWaterLevel", 53 "referenceWaterLevel",
140 "selectedWaterLevel", 54 "selectedWaterLevel",
141 "startPoint", 55 "startPoint",
142 "waterLevels" 56 "waterLevels"
143 ]), 57 ]),
144 ...mapState("bottlenecks", [ 58 ...mapState("bottlenecks", ["selectedSurvey"]),
145 "selectedBottleneck",
146 "selectedSurvey",
147 "surveysLoading"
148 ]),
149 relativeWaterLevelDelta() { 59 relativeWaterLevelDelta() {
150 return this.selectedWaterLevel.value - this.referenceWaterLevel; 60 return this.selectedWaterLevel.value - this.referenceWaterLevel;
151 }, 61 },
152 currentData() { 62 currentData() {
153 if ( 63 if (