Skip to content

Commit 6fbccc3

Browse files
committed
fix: minor style changes to the Summary visualization (smaller duration text)
1 parent d6b608c commit 6fbccc3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/visualizations/summary.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { getCategoryColorFromString } from '../util/color';
88

99
import { seconds_to_duration } from '../util/time.js';
1010

11+
const textColor = '#333';
12+
1113
function create(container) {
1214
// Clear element
1315
container.innerHTML = '';
@@ -30,7 +32,7 @@ function set_status(container, msg) {
3032
.text(msg)
3133
.attr('font-family', 'sans-serif')
3234
.attr('font-size', '25px')
33-
.attr('fill', 'black');
35+
.attr('fill', textColor);
3436
}
3537

3638
function update(container, apps) {
@@ -56,8 +58,8 @@ function update(container, apps) {
5658

5759
// Variables
5860
const width = (app.duration / longest_duration) * 100 + '%';
59-
const barHeight = 50;
60-
const textSize = 15;
61+
const barHeight = 46;
62+
const textSize = 14;
6163
const appcolor = app.color || getCategoryColorFromString(app.colorKey || app.name);
6264
const hovercolor = Color(appcolor).darken(0.1).hex();
6365

@@ -86,20 +88,20 @@ function update(container, apps) {
8688
// App name
8789
eg.append('text')
8890
.attr('x', 5)
89-
.attr('y', curr_y + 5 + textSize)
91+
.attr('y', curr_y + 1.4 * textSize)
9092
.text(app.name)
9193
.attr('font-family', 'sans-serif')
9294
.attr('font-size', textSize + 'px')
93-
.attr('fill', 'black');
95+
.attr('fill', textColor);
9496

9597
// Duration
9698
eg.append('text')
9799
.attr('x', 5)
98-
.attr('y', curr_y + 5 + textSize + 5 + textSize)
100+
.attr('y', curr_y + 2.6 * textSize)
99101
.text(seconds_to_duration(app.duration))
100102
.attr('font-family', 'sans-serif')
101-
.attr('font-size', textSize + 'px')
102-
.attr('fill', 'black');
103+
.attr('font-size', textSize - 3 + 'px')
104+
.attr('fill', '#444');
103105

104106
curr_y += barHeight + 5;
105107
});

0 commit comments

Comments
 (0)