-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdonut_sample.js
69 lines (56 loc) · 1.4 KB
/
donut_sample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const blessed = require("blessed");
const contrib = require("blessed-contrib");
const screen = blessed.screen();
// var pct = 10;
// var index = 0;
// var totalParameters = 5;
// getDonutData();
// function getDonutData() {
// var donutData = [];
// for (let i = 0; i < totalParameters; i++) {
// let color = "green";
// if (index === i) {
// color = "red";
// }
// donutData.push({ percent: pct, label: "web3", color: color });
// }
// return donutData;
// }
// var donut = contrib.donut({
// label: "Test",
// radius: 8,
// arcWidth: 3,
// yPadding: 2,
// data: getDonutData(),
// });
// screen.append(donut);
// screen.render();
// // setInterval(updateDonuts, 100);
// function updateDonuts() {
// donut.setData(getDonutData());
// // console.log("asdasdsssssssssssssssssssssssssssssssssssa");
// screen.render();
// }
screen.key(["escape", "q", "C-c"], function (ch, key) {
return process.exit(0);
});
// screen.key(["left"], function (ch, key) {
// if (index > 0) {
// index--;
// updateDonuts();
// }
// });
// screen.key(["right"], function (ch, key) {
// if (index < totalParameters - 1) {
// index = index + 1;
// updateDonuts();
// }
// });
// screen.key(["up"], function (ch, key) {
// updateDonuts();
// index = index - 1;
// });
// screen.key(["down"], function (ch, key) {
// index = index + 1;
// updateDonuts();
// });