Skip to content

Commit aee573f

Browse files
committed
fix: made loading texts more discrete, fixed element growth after loading (causing UI to "jump")
1 parent fe54dcc commit aee573f

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/visualizations/Summary.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<template lang="pug">
22
div
33
div.aw-summary-container
4-
div(v-if="fields && fields.length > 0 && with_limit && fields.length > limit_")
4+
// Use visibility to make sure elements don't skip when data finishes loading
5+
div(:style='{"visibility": visible ? "visible" : "hidden"}')
56
b-button.mt-1(size="sm", variant="outline-secondary", @click="limit_ += 5")
67
icon(name="angle-double-down")
78
| Show more
@@ -46,6 +47,13 @@ export default {
4647
data: function () {
4748
return { limit_: this.limit };
4849
},
50+
computed: {
51+
visible() {
52+
return (
53+
this.fields && this.fields.length > 0 && this.with_limit && this.fields.length > this.limit_
54+
);
55+
},
56+
},
4957
watch: {
5058
fields: function () {
5159
this.update();

src/visualizations/periodusage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ function set_status(svg_elem, msg) {
1818

1919
svg
2020
.append('text')
21-
.attr('x', '5pt')
21+
.attr('x', '50%')
2222
.attr('y', '25pt')
2323
.text(msg)
2424
.attr('font-family', 'sans-serif')
2525
.attr('font-size', '20pt')
26-
.attr('fill', 'black');
26+
.attr('text-anchor', 'middle')
27+
.attr('fill', '#AAA');
2728
}
2829

2930
const diagramcolor = '#aaa';

src/visualizations/summary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ function set_status(container, msg) {
3131
.attr('y', '25px')
3232
.text(msg)
3333
.attr('font-family', 'sans-serif')
34-
.attr('font-size', '25px')
35-
.attr('fill', textColor);
34+
.attr('font-size', '20px')
35+
.attr('fill', '#999');
3636
}
3737

3838
function update(container, apps) {

0 commit comments

Comments
 (0)