Skip to content

Commit b7e8a1b

Browse files
committed
[Frontend] Styling for TOI element
Fixes #933 Fixes #1193 WIP: Table TOI element in progress
1 parent 6042e4a commit b7e8a1b

File tree

5 files changed

+86
-51
lines changed

5 files changed

+86
-51
lines changed

platform/features/conductor-v2/conductor/res/sass/_time-of-interest.scss

+56-26
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
.l-toi-holder {
3131
$blockerFadeW: $toiBlockerFadeW;
32-
$LROffset: $blockerFadeW + $toiPad;
33-
$p: 3px;
3432
@include transform(translateX(-50%));
3533
color: $toiColorBg;
3634
position: absolute;
@@ -68,9 +66,9 @@
6866
align-items: center;
6967
box-sizing: content-box;
7068
height: $toiH;
71-
right: $LROffset * -1;
69+
right: $toiPad * -2;
7270
@include transform(translateY(-50%)); top: 50%;
73-
padding: $toiPad $blockerFadeW $toiPad $LROffset;
71+
padding: $toiPad;
7472
z-index: 1;
7573

7674
.l-toi-buttons {
@@ -80,7 +78,7 @@
8078
font-size: $toiH;
8179
height: 100%;
8280
line-height: $toiH;
83-
padding: $toiPad $toiPad;
81+
padding: $toiPad;
8482
order: 2;
8583
overflow: hidden;
8684
white-space: nowrap;
@@ -91,7 +89,6 @@
9189
// Expand and display controls; clock icon changes to resync
9290
background-color: $toiColorBg;
9391
cursor: pointer;
94-
margin-left: $interiorMarginSm;
9592
width: 30px;
9693

9794
.icon-button {
@@ -142,33 +139,36 @@
142139
.l-toi-val {
143140
display: none; // Hide by default; see .show-val below
144141
}
142+
}
145143

146-
&.show-val {
147-
.l-toi {
148-
.l-toi-val {
149-
$tbP: 1px;
150-
@include trans-prop-nice($props: opacity, $dur: 150ms);
151-
background-color: $toiColorBg;
152-
border-radius: $controlCr;
153-
box-sizing: content-box;
154-
color: $toiColorFg;
155-
display: inline-block;
156-
font-size: 0.7rem;
157-
font-weight: 400;
158-
height: $toiH;
159-
line-height: $toiH;
160-
order: 1;
161-
padding: $tbP $p;
162-
white-space: nowrap;
144+
.show-val .l-toi-holder {
145+
.l-toi {
146+
.l-toi-buttons {
147+
&:hover {
148+
margin-left: $interiorMarginSm;
163149
}
164150
}
151+
.l-toi-val {
152+
@include trans-prop-nice($props: opacity, $dur: 150ms);
153+
background-color: $toiColorBg;
154+
border-radius: $controlCr;
155+
box-sizing: content-box;
156+
color: $toiColorFg;
157+
display: inline-block;
158+
font-size: 0.7rem;
159+
font-weight: 400;
160+
height: $toiH;
161+
line-height: $toiH;
162+
order: 1;
163+
padding: 1px 3px;
164+
white-space: nowrap;
165+
}
165166
}
166167

167168
&.val-to-right {
168169
.l-toi {
169170
right: auto;
170-
left: $LROffset * -1;
171-
padding: $toiPad $LROffset $toiPad $blockerFadeW;
171+
left: $toiPad * -2;
172172

173173
.l-toi-buttons {
174174
order: 1;
@@ -188,6 +188,36 @@
188188

189189
// TOI in tables
190190
.tabular,
191+
table {
192+
tbody, .tbody {
193+
tr, .tr {
194+
&.l-toi-tablerow.pinned {
195+
border-top: 1px dashed $toiColorBg;
196+
z-index: 1;
197+
td, .td {
198+
.l-toi-holder {
199+
//@include test();
200+
//width: 100%;
201+
//z-index: 5;
202+
&:before,
203+
&:after {
204+
display: none;
205+
}
206+
.l-toi {
207+
background: $toiColorBlocker;
208+
padding: $toiPad;
209+
@include transform(translate(-50%, -50%));
210+
left: 50%; right: auto; top: 0;
211+
}
212+
}
213+
}
214+
}
215+
}
216+
}
217+
}
218+
219+
// Old approach
220+
/*.tabular,
191221
table {
192222
tbody, .tbody {
193223
tr, .tr {
@@ -235,7 +265,7 @@ table {
235265
}
236266
}
237267
}
238-
}
268+
}*/
239269

240270
// TOI in plots
241271
.gl-plot {

platform/features/conductor-v2/conductor/res/templates/time-conductor.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
ng-click="toi.click($event)">
101101
<a class="l-page-button s-icon-button icon-pointer-left"></a>
102102
<div class="l-data-visualization">
103-
<mct-include key="'time-of-interest'"></mct-include>
103+
<mct-include key="'time-of-interest'" class="show-val"></mct-include>
104104
</div>
105105
<a class="l-page-button align-right s-icon-button icon-pointer-right"></a>
106106
</div>

platform/features/conductor-v2/conductor/res/templates/time-of-interest.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<!-- Note: - val-to-right should be applied when l-toi-holder left < 150px -->
2-
<div class="l-toi-holder show-val hidden"
3-
ng-class="{ 'pinned': toi.pinned, 'val-to-right': toi.left < 20 }"
1+
<!--
2+
<div class="l-toi-holder"
3+
ng-class="{ 'pinned': toi.pinned, 'val-to-right': toi.left < 80 }"
44
ng-style="{'left': toi.left + '%'}">
55
<div class="l-toi">
66
<a class="t-button-unpin icon-button" title="Unset Time of Interest"
@@ -10,11 +10,11 @@
1010
</div>
1111
<span class="l-toi-val">{{toi.toiText}}</span>
1212
</div>
13+
-->
1314

14-
<!-- Note: - val-to-right should be applied when l-toi-holder left < 150px -->
15-
<div class="l-toi-holder show-val"
16-
ng-class="{ 'pinned': true, 'val-to-right': false }"
17-
ng-style="{'left': 90 + '%'}">
15+
<div class="l-toi-holder"
16+
ng-class="{ 'pinned': true, 'val-to-right': true }"
17+
ng-style="{'left': 50 + '%'}">
1818
<div class="l-flex-row l-toi">
1919
<span class="flex-elem l-flex-row l-toi-buttons">
2020
<a class="flex-elem t-button-resync icon-button" title="Re-sync Time of Interest"

platform/features/plot/res/templates/plot.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</div>
7272

7373
<div class="gl-plot-wrapper-display-area-and-x-axis">
74-
<mct-include key="'time-of-interest'"></mct-include>
74+
<mct-include key="'time-of-interest'" class="show-val"></mct-include>
7575

7676
<div class="gl-plot-coords"
7777
ng-if="subplot.isHovering() && subplot.getHoverCoordinates()">

platform/features/table/res/templates/mct-table.html

+21-16
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,26 @@
5151
<tbody>
5252
<!--ng-class="{ 'l-toi pinned': false }"-->
5353
<!--ng-click="dummyUnpin()" -->
54-
<tr ng-repeat="visibleRow in visibleRows track by visibleRow.rowIndex"
55-
ng-class="{ 'l-toi pinned': visibleRow.rowIndex === toiRowIndex }"
54+
<tr ng-repeat-start="visibleRow in visibleRows track by visibleRow.rowIndex"
55+
ng-if="visibleRow.rowIndex === 10"
56+
ng-style="{ top: visibleRow.offsetY + 'px' }"
57+
class="l-toi-tablerow pinned">
58+
<td colspan="999">
59+
<mct-include key="'time-of-interest'"></mct-include>
60+
</td>
61+
</tr>
62+
<tr ng-repeat-end
5663
ng-click="table.onRowClick($event, visibleRow.rowIndex)"
57-
ng-style="{
58-
top: visibleRow.offsetY + 'px',
59-
}">
60-
<td ng-repeat="header in displayHeaders"
61-
ng-style=" {
62-
width: columnWidths[$index] + 'px',
63-
'max-width': columnWidths[$index] + 'px',
64-
}"
65-
class="{{visibleRow.contents[header].cssClass}}">
66-
{{ visibleRow.contents[header].text }}
67-
</td>
68-
</tr>
69-
</tbody>
70-
</table>
64+
ng-style="{ top: visibleRow.offsetY + 'px' }">
65+
<td ng-repeat="header in displayHeaders"
66+
ng-style=" {
67+
width: columnWidths[$index] + 'px',
68+
'max-width': columnWidths[$index] + 'px',
69+
}"
70+
class="{{visibleRow.contents[header].cssClass}}">
71+
{{ visibleRow.contents[header].text }}
72+
</td>
73+
</tr>
74+
</tbody>
75+
</table>
7176
</div>

0 commit comments

Comments
 (0)