Skip to content

Commit 88162c5

Browse files
authored
Merge pull request #189 from micmro/185
#185 add overlay opening animation
2 parents b6a896c + 923ea83 commit 88162c5

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

Diff for: src/css-raw/perf-cascade.css

+12-5
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
.water-fall-chart .mark-holder text {writing-mode:vertical-lr;}
2626

27-
.left-fixed-holder .label-full-bg {fill: #fff; opacity: 0.9}
27+
.left-fixed-holder .label-full-bg {fill: #fff; opacity: 0.9;}
2828

2929
.time-scale line {stroke:#0cc; stroke-width:1;}
3030
.time-scale line.sub-second-line {stroke: #ccc; opacity: 0.75; stroke-width:0.50;}
3131
.time-scale text {font-weight:bold;}
3232

33-
.row-item {cursor: pointer}
33+
.row-item {cursor: pointer;}
3434
.row-item .even {fill: #ccc; opacity: 0.05;}
3535
.row-item .odd {fill: #000; opacity: 0.05;}
3636
.row-item:hover .odd,
@@ -48,14 +48,21 @@
4848
.row-item.status4xx .even,
4949
.row-item.status4xx .odd,
5050
.row-item.status3xx .even,
51-
.row-item.status3xx .odd {opacity: 0.3}
51+
.row-item.status3xx .odd {opacity: 0.3;}
5252
.row-item.status5xx:hover .even,
5353
.row-item.status5xx:hover .odd,
5454
.row-item.status4xx:hover .even,
5555
.row-item.status4xx:hover .odd,
5656
.row-item.status3xx:hover .even,
57-
.row-item.status3xx:hover .odd {opacity: 0.5}
57+
.row-item.status3xx:hover .odd {opacity: 0.5;}
5858

59+
/** overlay animation settings **/
60+
.water-fall-chart .line-label-holder,
61+
.row-item,
62+
.water-fall-chart .line-holder line,
63+
.time-scale line,
64+
.time-scale text {transition:transform 60ms;}
65+
.water-fall-chart.closing {transition-delay: 60ms;}
5966

6067
.labels { overflow: hidden;}
6168

@@ -90,7 +97,7 @@
9097
.block-undefined {fill: #0f0;}
9198

9299
/* Info overlay SVG - wrapper */
93-
.info-overlay {fill: #fff; stroke: #cdcdcd; }
100+
.info-overlay {fill: #fff; stroke: #cdcdcd;}
94101
.info-overlay-close-btn {fill: rgba(205, 205, 205, 0.8); transform: translate(-23px, -23px); cursor: pointer;}
95102
.info-overlay-close-btn text {fill: #111; pointer-events: none;}
96103
.info-overlay-close-btn:focus {border: solid 1px #36c;}

Diff for: src/ts/waterfall/svg-chart.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,14 @@ export function createWaterfallSvg(data: WaterfallData, options: ChartRenderOpti
139139

140140
let barEls: SVGGElement[] = [];
141141

142-
function getChartHeight(): string {
143-
return (chartHolderHeight + context.overlayManager.getCombinedOverlayHeight()).toString() + "px";
142+
function getChartHeight(): number {
143+
return chartHolderHeight + context.overlayManager.getCombinedOverlayHeight();
144144
}
145145

146146
context.pubSub.subscribeToOverlayChanges(() => {
147-
timeLineHolder.style.height = getChartHeight();
147+
const newHeight = getChartHeight();
148+
timeLineHolder.classList.toggle("closing", newHeight < timeLineHolder.clientHeight);
149+
timeLineHolder.style.height = `${newHeight}px`;
148150
});
149151

150152
/** Renders single row and hooks up behaviour */

0 commit comments

Comments
 (0)