Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 925138d

Browse files
committed
cleanup of summary/table view
Fixes #786
1 parent 5346700 commit 925138d

File tree

8 files changed

+194
-187
lines changed

8 files changed

+194
-187
lines changed

app/content/css/themes/ibm.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ badge.clickable:hover {
150150
.sidecar-bottom-stripe .sidecar-bottom-stripe-button:not(.sidecar-bottom-stripe-button-active):hover, .sidecar-bottom-stripe .sidecar-bottom-stripe-button.hover, .sidecar-bottom-stripe-button-as-button.selected {
151151
color: var(--color-brand-02);
152152
}
153+
.sidecar-bottom-stripe .sidecar-bottom-stripe-button-as-button.sidecar-bottom-stripe-button-as-radio-button:not(.sidecar-bottom-stripe-button-active):hover, .sidecar-bottom-stripe-button-as-button.sidecar-bottom-stripe-button-as-radio-button.selected {
154+
color: var(--color-support-03);
155+
color: #e31a1c;
156+
}
153157

154158
sidecar .header-right-bits {
155159
color: hsla(201, 22%, 10%, 1);

app/content/css/ui.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,3 +1687,14 @@ break {
16871687
.bx--breadcrumb .bx--no-link:not(.bx--link) {
16881688
font-weight: 400;
16891689
}
1690+
1691+
.icon-container {
1692+
display: flex;
1693+
flex-direction: column;
1694+
align-items: center;
1695+
}
1696+
.icon-container .deemphasize {
1697+
white-space: nowrap;
1698+
font-size: 0.5em;
1699+
margin-top: 0.5ex;
1700+
}

app/content/js/bottom-stripe.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const css = {
2121
modeContainer: '#sidecar .sidecar-bottom-stripe .sidecar-bottom-stripe-left-bits .sidecar-bottom-stripe-mode-bits',
2222
button: 'sidecar-bottom-stripe-button',
2323
buttonActingAsButton: 'sidecar-bottom-stripe-button-as-button',
24+
buttonActingAsRadioButton: 'sidecar-bottom-stripe-button-as-radio-button',
2425
active: 'sidecar-bottom-stripe-button-active',
2526
selected: 'selected',
2627
hidden: 'hidden'
@@ -29,8 +30,9 @@ exports.css = css
2930

3031
const addModeButton = (bottomStripe, opts, entity, show) => {
3132
const {mode, label, flush, selected, selectionController, visibleWhen,
32-
fontawesome, balloon, balloonLength, data, command=()=>mode, direct,
33-
defaultMode, actAsButton, echo=false, noHistory=true} = opts
33+
fontawesome, labelBelow, // show label below the fontawesome?
34+
balloon, balloonLength, data, command=()=>mode, direct,
35+
defaultMode, actAsButton, radioButton=false, echo=false, noHistory=true} = opts
3436

3537
if (visibleWhen && visibleWhen !== show) {
3638
// only visible when a specific mode is active!
@@ -46,6 +48,10 @@ const addModeButton = (bottomStripe, opts, entity, show) => {
4648
// let's make them behave a bit more like buttons
4749
button.classList.add(css.buttonActingAsButton)
4850

51+
if (radioButton) {
52+
button.classList.add(css.buttonActingAsRadioButton)
53+
}
54+
4955
if (selected) {
5056
button.classList.add(css.selected)
5157
}
@@ -72,10 +78,20 @@ const addModeButton = (bottomStripe, opts, entity, show) => {
7278

7379
// add the button label
7480
if (fontawesome) {
75-
const icon = document.createElement('i')
81+
const iconContainer = document.createElement('span'),
82+
icon = document.createElement('i')
7683
icon.className = fontawesome
7784
button.classList.add('graphical-icon')
78-
button.appendChild(icon)
85+
button.appendChild(iconContainer)
86+
iconContainer.appendChild(icon)
87+
iconContainer.classList.add('icon-container')
88+
89+
if (labelBelow) {
90+
const labelContainer = document.createElement('div')
91+
labelContainer.classList.add('deemphasize')
92+
labelContainer.innerText = label
93+
iconContainer.appendChild(labelContainer)
94+
}
7995
} else {
8096
button.innerText = label || mode
8197
}
@@ -132,11 +148,15 @@ const addModeButton = (bottomStripe, opts, entity, show) => {
132148
})*/
133149

134150
} else if (actAsButton && selected !== undefined) {
135-
const currentSelected = bottomStripe.querySelector(`.${css.selected}`)
136-
if (currentSelected) {
137-
currentSelected.classList.remove(css.selected)
151+
if (radioButton) {
152+
button.classList.toggle(css.selected)
153+
} else {
154+
const currentSelected = bottomStripe.querySelector(`.${css.selected}`)
155+
if (currentSelected) {
156+
currentSelected.classList.remove(css.selected)
157+
}
158+
button.classList.add(css.selected)
138159
}
139-
button.classList.add(css.selected)
140160
}
141161

142162
// execute the command

app/content/js/repl.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ self.exec = (commandUntrimmed, execOptions) => {
907907
}
908908
})
909909
.catch(err => {
910+
console.error(err)
910911
if (execOptions && execOptions.noHistory) {
911912
// then pass the error upstream
912913
throw err
@@ -919,6 +920,8 @@ self.exec = (commandUntrimmed, execOptions) => {
919920
}
920921
})
921922
.catch(err => {
923+
console.error(err)
924+
922925
if (ui.headless) {
923926
throw err
924927
} else {

app/plugins/modules/activation-visualizations/lib/grouping.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const summarizePerformance = (activations, options) => {
6868
initTime = (initAnno && initAnno.value) || 0,
6969
start = activation.start - waitTime,
7070
executionTime = activation.end - activation.start,
71-
total = executionTime + waitTime + initTime
71+
total = executionTime + waitTime /*+ initTime*/
7272

7373
const durDisparity = executionTime - durAvgForFastest,
7474
waitDisparity = Math.max(0, waitTime - waitAvgForFastest),
@@ -85,8 +85,10 @@ const summarizePerformance = (activations, options) => {
8585
return { total, start, reasons }
8686
}
8787

88-
// outlier activations
89-
const outliers = summaries.slice(idxOutlier),
88+
// outlier activations; make sure not to include degenerate
89+
// "outliers" that are just the median
90+
const median = summaries[idx50].duration
91+
const outliers = summaries.slice(idxOutlier).filter(({duration}) => duration > median),
9092
outlierMax = outliers.reduce((max, {duration}) => Math.max(max, duration), 0)
9193

9294
return { min, max,

0 commit comments

Comments
 (0)