Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit e82480b

Browse files
authored
Prettify detector columns and icons (#79)
* Add center_of_mass_energy filtering type * Style the center of mass energy column * Style detector fields * Prettify detector icons * Apply the eslint formatting convention * Cleanup 🧹 * Pointer when hovering the Quality Control
1 parent 77ac222 commit e82480b

6 files changed

Lines changed: 41 additions & 56 deletions

File tree

app/config/public.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const runsViewsFilteringTypes = {
3131
fill_number: fromToType,
3232
run_type: matchExcludeType,
3333
mu: matchExcludeType,
34+
center_of_mass_energy: fromToType,
3435
};
3536

3637
const dataPassesViews = {

app/public/components/userView/data/table/header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function tableHeader(visibleFields, data, model) {
2222
}
2323

2424
const columnsHeadersArray = (visibleFields, data, model) =>
25-
visibleFields.map((f) => h(`th.${model.getCurrentDataPointer().page}-${f.name}-header`, {
25+
visibleFields.map((f) => h(`th.${model.getCurrentDataPointer().page}-${f.name.includes('detector') ? 'detector' : f.name}-header`, {
2626
scope: 'col',
2727
}, h('.relative', [
2828
headerSpecPresent(model, f) !== nonDisplayable ? [

app/public/components/userView/data/table/row.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@ import { reduceSerialIf } from '../../../../utils/utils.js';
1717

1818
// eslint-disable-next-line no-unused-vars
1919
const detectorIcon = (model, item, n) =>
20-
h('.tooltip',
20+
h('.tooltip.noBorderBottom.pointer',
2121
h('svg', { width: '50px', height: '50px' },
2222
h('circle',
2323
{
2424
cx: '50%',
2525
cy: '50%',
2626
r: '15px',
27-
stroke: 'black',
28-
'stroke-width': '3',
29-
fill: 'green',
27+
28+
/*
29+
*Stroke: '#F7B538', strokes for the limited acceptance flags only
30+
*'stroke-width': '3',
31+
*/
32+
fill: '#8CB369',
3033
})),
31-
h('span.tooltiptext', `run_det_id: ${item[n]}`));
34+
h('span.detector-tooltip-field', `run_det_id: ${item[n]}`));
3235

3336
export default function row(
3437
model, visibleFields, data, item, cellsSpecials,
@@ -39,7 +42,7 @@ export default function row(
3942
);
4043

4144
const dataCells = visibleFields.map((field) =>
42-
h(`td.${model.getCurrentDataPointer().page}-${field.name}-cell`,
45+
h(`td.${model.getCurrentDataPointer().page}-${field.name.includes('detector') ? 'detector' : field.name}-cell`,
4346
item[field.name]
4447
? cellsSpecials[field.name]
4548
? cellsSpecials[field.name](model, item)

app/public/styles/custom.css

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -48,48 +48,6 @@
4848
background-color: var(--active-color) !important;
4949
}
5050

51-
.tooltip:hover .tooltiptext {
52-
right: 5% !important;
53-
bottom: -50% !important;
54-
}
55-
56-
.tooltip .tooltiptext2 {
57-
visibility: hidden;
58-
right: auto;
59-
}
60-
61-
.tooltip:hover .tooltiptext2 {
62-
visibility: visible;
63-
right: auto;
64-
}
65-
66-
.tooltip .tooltiptext2 {
67-
visibility: hidden;
68-
right: auto;
69-
}
70-
71-
.tooltip:hover .tooltiptext2 {
72-
visibility: visible;
73-
right: auto;
74-
}
75-
76-
.my-tooltip:hover .tooltiptext {
77-
visibility: visible;
78-
}
79-
80-
.my-tooltip .tooltiptext {
81-
visibility: hidden;
82-
width: 118px;
83-
background-color: #555;
84-
color: #fff;
85-
text-align: center;
86-
padding: 3px;
87-
border-radius: 6px;
88-
position: absolute;
89-
z-index: 1 !important;
90-
bottom: -100%;
91-
}
92-
9351
.vertical-center {
9452
margin: 0;
9553
position: absolute;

app/public/styles/custom/tables/runs.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
text-align: right;
6161
}
6262

63-
/* Energy per beam */
64-
.runs-table .runsPerPeriod-energy_per_beam-cell, .runs-table .runsPerPeriod-energy_per_beam-header,
65-
.runs-table .runsPerDataPass-energy_per_beam-cell, .runs-table .runsPerDataPass-energy_per_beam-header {
63+
/* Center of mass energy */
64+
.runs-table .runsPerPeriod-center_of_mass_energy-cell, .runs-table .runsPerPeriod-center_of_mass_energy-header,
65+
.runs-table .runsPerDataPass-center_of_mass_energy-cell, .runs-table .runsPerDataPass-center_of_mass_energy-header {
6666
min-width: 100px;
6767
text-align: right;
6868
}
@@ -88,11 +88,13 @@
8888
text-align: right;
8989
}
9090

91-
/* Tof detector
92-
.runsPerPeriod-tof_detector-header {
93-
min-width: 100px;
91+
/* Detectors */
92+
.runs-table .runsPerPeriod-detector-header, .runs-table .runsPerPeriod-detector-cell,
93+
.runs-table .runsPerDataPass-detector-header, .runs-table .runsPerDataPass-detector-cell {
94+
min-width: 50px;
95+
text-align: center;
96+
border: none !important;
9497
}
95-
*/
9698

9799
.runs-table td:last-child, .runs-table th:last-child {
98100
padding-right: 2em;

app/public/styles/custom/tooltip.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
--y: 0.5;
1818
}
1919

20+
.tooltip:hover .tooltiptext {
21+
right: 5% !important;
22+
bottom: -10% !important;
23+
}
24+
2025
.my-tooltip-bg .tooltiptext2 {
2126
visibility: hidden;
2227
}
@@ -31,6 +36,22 @@
3136
flex-direction: column;
3237
align-items: center;
3338
}
39+
/* Detector tooltip field */
40+
.tooltip .detector-tooltip-field {
41+
visibility: hidden;
42+
padding: 3px;
43+
border-radius: 6px;
44+
position: absolute;
45+
z-index: 1;
46+
}
47+
.tooltip:hover .detector-tooltip-field {
48+
visibility: visible;
49+
background-color: white !important;
50+
width: 100px;
51+
top: 100%;
52+
left: -50%;
53+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
54+
}
3455

3556
.tracker {
3657
position: absolute;

0 commit comments

Comments
 (0)