pythx-cli 0.0.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +15 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -114,13 +114,26 @@ function colorScore(score) {
|
|
|
114
114
|
if (score < -0.05) return chalk3.red(formatted);
|
|
115
115
|
return chalk3.gray(formatted);
|
|
116
116
|
}
|
|
117
|
+
function trendArrow(prev, curr) {
|
|
118
|
+
const delta = curr - prev;
|
|
119
|
+
if (delta > 0.02) return chalk3.green("\u25B2");
|
|
120
|
+
if (delta < -0.02) return chalk3.red("\u25BC");
|
|
121
|
+
return chalk3.gray("\u2500");
|
|
122
|
+
}
|
|
117
123
|
function WindowBar({ windows }) {
|
|
118
124
|
const ordered = [...windows].reverse();
|
|
119
125
|
return /* @__PURE__ */ jsxs3(Box3, { paddingX: 1, flexDirection: "column", children: [
|
|
120
126
|
/* @__PURE__ */ jsx3(Text3, { children: chalk3.dim(" SENTIMENT OVER TIME") }),
|
|
121
127
|
/* @__PURE__ */ jsx3(Box3, { children: /* @__PURE__ */ jsxs3(Text3, { children: [
|
|
122
128
|
" ",
|
|
123
|
-
ordered.map((w) =>
|
|
129
|
+
ordered.map((w, i) => {
|
|
130
|
+
const score = colorScore(w.snapshot.averageScore);
|
|
131
|
+
const arrow = i > 0 ? trendArrow(
|
|
132
|
+
ordered[i - 1].snapshot.averageScore,
|
|
133
|
+
w.snapshot.averageScore
|
|
134
|
+
) + " " : "";
|
|
135
|
+
return `${arrow}${chalk3.dim(w.label + ":")}${score}`;
|
|
136
|
+
}).join(" ")
|
|
124
137
|
] }) })
|
|
125
138
|
] });
|
|
126
139
|
}
|
|
@@ -200,9 +213,7 @@ function StatusBar() {
|
|
|
200
213
|
chalk5.white("enter"),
|
|
201
214
|
chalk5.dim(":expand "),
|
|
202
215
|
chalk5.white("r"),
|
|
203
|
-
chalk5.dim(":refresh
|
|
204
|
-
chalk5.white("t"),
|
|
205
|
-
chalk5.dim(":timeseries")
|
|
216
|
+
chalk5.dim(":refresh")
|
|
206
217
|
] })
|
|
207
218
|
}
|
|
208
219
|
);
|