@qodalis/cli-chart 2.0.0-beta.1
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/package.json +34 -0
- package/public-api.d.mts +31 -0
- package/public-api.d.ts +31 -0
- package/public-api.js +237 -0
- package/public-api.js.map +1 -0
- package/public-api.mjs +228 -0
- package/public-api.mjs.map +1 -0
- package/umd/cli-entrypoint.global.js +3019 -0
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qodalis/cli-chart",
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"description": "ASCII chart and graph rendering",
|
|
5
|
+
"author": "Qodalis Solutions",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/qodalis-solutions/web-cli"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://qodalis.com",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"cli",
|
|
14
|
+
"qodalis",
|
|
15
|
+
"terminal",
|
|
16
|
+
"chart"
|
|
17
|
+
],
|
|
18
|
+
"umd": "./umd/index.js",
|
|
19
|
+
"unpkg": "./umd/index.js",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@qodalis/cli-core": "2.0.0-beta.1"
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"main": "./public-api.js",
|
|
25
|
+
"module": "./public-api.mjs",
|
|
26
|
+
"types": "./public-api.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./public-api.d.ts",
|
|
30
|
+
"import": "./public-api.mjs",
|
|
31
|
+
"require": "./public-api.js"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/public-api.d.mts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ICliCommandProcessor, ICliCommandAuthor, CliProcessorMetadata, ICliCommandChildProcessor, CliProcessCommand, ICliExecutionContext, ICliModule } from '@qodalis/cli-core';
|
|
2
|
+
|
|
3
|
+
declare class CliChartCommandProcessor implements ICliCommandProcessor {
|
|
4
|
+
command: string;
|
|
5
|
+
description: string;
|
|
6
|
+
author: ICliCommandAuthor;
|
|
7
|
+
version: string;
|
|
8
|
+
metadata: CliProcessorMetadata;
|
|
9
|
+
processors: ICliCommandChildProcessor[];
|
|
10
|
+
processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
11
|
+
writeDescription(context: ICliExecutionContext): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ChartDataPoint {
|
|
15
|
+
label: string;
|
|
16
|
+
value: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Parse newline-separated numbers or "key:value" pairs.
|
|
20
|
+
*/
|
|
21
|
+
declare function parseChartInput(input: string): ChartDataPoint[];
|
|
22
|
+
declare function renderBarChart(data: ChartDataPoint[], width?: number): string[];
|
|
23
|
+
declare function renderSparkline(data: ChartDataPoint[]): string;
|
|
24
|
+
declare function renderLineChart(data: ChartDataPoint[], width?: number, height?: number): string[];
|
|
25
|
+
|
|
26
|
+
declare const LIBRARY_VERSION = "2.0.0-beta.1";
|
|
27
|
+
declare const API_VERSION = 2;
|
|
28
|
+
|
|
29
|
+
declare const chartModule: ICliModule;
|
|
30
|
+
|
|
31
|
+
export { API_VERSION, type ChartDataPoint, CliChartCommandProcessor, LIBRARY_VERSION, chartModule, parseChartInput, renderBarChart, renderLineChart, renderSparkline };
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ICliCommandProcessor, ICliCommandAuthor, CliProcessorMetadata, ICliCommandChildProcessor, CliProcessCommand, ICliExecutionContext, ICliModule } from '@qodalis/cli-core';
|
|
2
|
+
|
|
3
|
+
declare class CliChartCommandProcessor implements ICliCommandProcessor {
|
|
4
|
+
command: string;
|
|
5
|
+
description: string;
|
|
6
|
+
author: ICliCommandAuthor;
|
|
7
|
+
version: string;
|
|
8
|
+
metadata: CliProcessorMetadata;
|
|
9
|
+
processors: ICliCommandChildProcessor[];
|
|
10
|
+
processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
11
|
+
writeDescription(context: ICliExecutionContext): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ChartDataPoint {
|
|
15
|
+
label: string;
|
|
16
|
+
value: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Parse newline-separated numbers or "key:value" pairs.
|
|
20
|
+
*/
|
|
21
|
+
declare function parseChartInput(input: string): ChartDataPoint[];
|
|
22
|
+
declare function renderBarChart(data: ChartDataPoint[], width?: number): string[];
|
|
23
|
+
declare function renderSparkline(data: ChartDataPoint[]): string;
|
|
24
|
+
declare function renderLineChart(data: ChartDataPoint[], width?: number, height?: number): string[];
|
|
25
|
+
|
|
26
|
+
declare const LIBRARY_VERSION = "2.0.0-beta.1";
|
|
27
|
+
declare const API_VERSION = 2;
|
|
28
|
+
|
|
29
|
+
declare const chartModule: ICliModule;
|
|
30
|
+
|
|
31
|
+
export { API_VERSION, type ChartDataPoint, CliChartCommandProcessor, LIBRARY_VERSION, chartModule, parseChartInput, renderBarChart, renderLineChart, renderSparkline };
|
package/public-api.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var cliCore = require('@qodalis/cli-core');
|
|
4
|
+
|
|
5
|
+
// src/lib/processors/cli-chart-command-processor.ts
|
|
6
|
+
|
|
7
|
+
// src/lib/chart-utils.ts
|
|
8
|
+
function parseChartInput(input) {
|
|
9
|
+
if (!input.trim()) return [];
|
|
10
|
+
return input.split("\n").map((l) => l.trim()).filter(Boolean).map((line, i) => {
|
|
11
|
+
const colonIdx = line.indexOf(":");
|
|
12
|
+
if (colonIdx !== -1) {
|
|
13
|
+
const label = line.slice(0, colonIdx).trim();
|
|
14
|
+
const value2 = parseFloat(line.slice(colonIdx + 1).trim());
|
|
15
|
+
return { label, value: isNaN(value2) ? 0 : value2 };
|
|
16
|
+
}
|
|
17
|
+
const value = parseFloat(line);
|
|
18
|
+
return { label: String(i + 1), value: isNaN(value) ? 0 : value };
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
var BLOCK_CHARS = " \u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588";
|
|
22
|
+
function renderBarChart(data, width = 40) {
|
|
23
|
+
if (data.length === 0) return ["No data"];
|
|
24
|
+
const max = Math.max(...data.map((d) => d.value));
|
|
25
|
+
const labelWidth = Math.max(...data.map((d) => d.label.length)) + 1;
|
|
26
|
+
if (max === 0) {
|
|
27
|
+
return data.map(({ label }) => `${label.padStart(labelWidth)} | \u2581 0`);
|
|
28
|
+
}
|
|
29
|
+
return data.map(({ label, value }) => {
|
|
30
|
+
const ratio = value / max;
|
|
31
|
+
const barLen = Math.round(ratio * width);
|
|
32
|
+
const bar = "\u2588".repeat(barLen);
|
|
33
|
+
return `${label.padStart(labelWidth)} | ${bar} ${value}`;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function renderSparkline(data) {
|
|
37
|
+
if (data.length === 0) return "";
|
|
38
|
+
const values = data.map((d) => d.value);
|
|
39
|
+
const min = Math.min(...values);
|
|
40
|
+
const max = Math.max(...values);
|
|
41
|
+
const range = max - min;
|
|
42
|
+
if (range === 0) {
|
|
43
|
+
const midChar = BLOCK_CHARS[Math.floor(BLOCK_CHARS.length / 2)];
|
|
44
|
+
return values.map(() => midChar).join("");
|
|
45
|
+
}
|
|
46
|
+
return values.map((v) => {
|
|
47
|
+
const idx = Math.round((v - min) / range * (BLOCK_CHARS.length - 1));
|
|
48
|
+
return BLOCK_CHARS[idx];
|
|
49
|
+
}).join("");
|
|
50
|
+
}
|
|
51
|
+
function renderLineChart(data, width = 60, height = 12) {
|
|
52
|
+
if (data.length === 0) return ["No data"];
|
|
53
|
+
const values = data.map((d) => d.value);
|
|
54
|
+
const min = Math.min(...values);
|
|
55
|
+
const max = Math.max(...values);
|
|
56
|
+
const range = max - min || 1;
|
|
57
|
+
const grid = Array.from(
|
|
58
|
+
{ length: height },
|
|
59
|
+
() => Array(width).fill(" ")
|
|
60
|
+
);
|
|
61
|
+
data.forEach(({ value }, i) => {
|
|
62
|
+
const col = Math.round(i / (data.length - 1 || 1) * (width - 1));
|
|
63
|
+
const row = height - 1 - Math.round((value - min) / range * (height - 1));
|
|
64
|
+
if (grid[row]) grid[row][col] = "\u25CF";
|
|
65
|
+
});
|
|
66
|
+
return grid.map((row, i) => {
|
|
67
|
+
const yLabel = i === 0 ? String(max.toFixed(1)).padStart(6) : i === height - 1 ? String(min.toFixed(1)).padStart(6) : "".padStart(6);
|
|
68
|
+
return `${yLabel} |${row.join("")}`;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/lib/version.ts
|
|
73
|
+
var LIBRARY_VERSION = "2.0.0-beta.1";
|
|
74
|
+
var API_VERSION = 2;
|
|
75
|
+
|
|
76
|
+
// src/lib/processors/cli-chart-command-processor.ts
|
|
77
|
+
var CliChartCommandProcessor = class {
|
|
78
|
+
constructor() {
|
|
79
|
+
this.command = "chart";
|
|
80
|
+
this.description = "Render ASCII charts from piped data (numbers or key:value pairs)";
|
|
81
|
+
this.author = cliCore.DefaultLibraryAuthor;
|
|
82
|
+
this.version = LIBRARY_VERSION;
|
|
83
|
+
this.metadata = {
|
|
84
|
+
icon: cliCore.CliIcon.Growth,
|
|
85
|
+
module: "chart"
|
|
86
|
+
};
|
|
87
|
+
this.processors = [
|
|
88
|
+
{
|
|
89
|
+
command: "bar",
|
|
90
|
+
description: "Horizontal bar chart. Pipe numbers or key:value pairs.",
|
|
91
|
+
valueRequired: true,
|
|
92
|
+
processCommand: async (cmd, context) => {
|
|
93
|
+
const raw = cmd.value || (typeof cmd.data === "string" ? cmd.data : "") || "";
|
|
94
|
+
const data = parseChartInput(raw);
|
|
95
|
+
if (!data.length) {
|
|
96
|
+
context.writer.writeError("No data. Pipe numbers or key:value pairs.");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const width = Math.min((context.terminal?.cols ?? 80) - 20, 60);
|
|
100
|
+
const lines = renderBarChart(data, width);
|
|
101
|
+
for (const line of lines) {
|
|
102
|
+
context.writer.writeln(
|
|
103
|
+
context.writer.wrapInColor(line, cliCore.CliForegroundColor.Cyan)
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
context.process.output(lines);
|
|
107
|
+
},
|
|
108
|
+
writeDescription: (context) => {
|
|
109
|
+
const { writer } = context;
|
|
110
|
+
writer.writeln("Render a horizontal ASCII bar chart from piped data.");
|
|
111
|
+
writer.writeln();
|
|
112
|
+
writer.writeln("Usage:");
|
|
113
|
+
writer.writeln(
|
|
114
|
+
` ${writer.wrapInColor('echo "10\\n20\\n30" | chart bar', cliCore.CliForegroundColor.Cyan)}`
|
|
115
|
+
);
|
|
116
|
+
writer.writeln(
|
|
117
|
+
` ${writer.wrapInColor('echo "Jan:100\\nFeb:200\\nMar:150" | chart bar', cliCore.CliForegroundColor.Cyan)}`
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
command: "line",
|
|
123
|
+
description: "Line chart. Pipe numbers or key:value pairs.",
|
|
124
|
+
valueRequired: true,
|
|
125
|
+
processCommand: async (cmd, context) => {
|
|
126
|
+
const raw = cmd.value || (typeof cmd.data === "string" ? cmd.data : "") || "";
|
|
127
|
+
const data = parseChartInput(raw);
|
|
128
|
+
if (!data.length) {
|
|
129
|
+
context.writer.writeError("No data. Pipe numbers or key:value pairs.");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const width = Math.min((context.terminal?.cols ?? 80) - 10, 60);
|
|
133
|
+
const lines = renderLineChart(data, width);
|
|
134
|
+
for (const line of lines) {
|
|
135
|
+
context.writer.writeln(line);
|
|
136
|
+
}
|
|
137
|
+
const labels = data.map((d) => d.label.slice(0, 3));
|
|
138
|
+
context.writer.writeln(" " + labels.join(" "));
|
|
139
|
+
context.process.output(lines);
|
|
140
|
+
},
|
|
141
|
+
writeDescription: (context) => {
|
|
142
|
+
const { writer } = context;
|
|
143
|
+
writer.writeln("Render an ASCII line/scatter chart from piped data.");
|
|
144
|
+
writer.writeln();
|
|
145
|
+
writer.writeln("Usage:");
|
|
146
|
+
writer.writeln(
|
|
147
|
+
` ${writer.wrapInColor('echo "Jan:100\\nFeb:200\\nMar:150" | chart line', cliCore.CliForegroundColor.Cyan)}`
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
command: "sparkline",
|
|
153
|
+
description: "Single-line sparkline. Pipe numbers or key:value pairs.",
|
|
154
|
+
valueRequired: true,
|
|
155
|
+
processCommand: async (cmd, context) => {
|
|
156
|
+
const raw = cmd.value || (typeof cmd.data === "string" ? cmd.data : "") || "";
|
|
157
|
+
const data = parseChartInput(raw);
|
|
158
|
+
if (!data.length) {
|
|
159
|
+
context.writer.writeError("No data. Pipe numbers or key:value pairs.");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const spark = renderSparkline(data);
|
|
163
|
+
context.writer.writeln(spark);
|
|
164
|
+
context.process.output(spark);
|
|
165
|
+
},
|
|
166
|
+
writeDescription: (context) => {
|
|
167
|
+
const { writer } = context;
|
|
168
|
+
writer.writeln("Render a compact single-line sparkline from piped data.");
|
|
169
|
+
writer.writeln();
|
|
170
|
+
writer.writeln("Usage:");
|
|
171
|
+
writer.writeln(
|
|
172
|
+
` ${writer.wrapInColor('echo "1\\n4\\n9\\n16\\n25" | chart sparkline', cliCore.CliForegroundColor.Cyan)}`
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
async processCommand(_, context) {
|
|
179
|
+
await context.executor.showHelp(_, context);
|
|
180
|
+
}
|
|
181
|
+
writeDescription(context) {
|
|
182
|
+
const { writer } = context;
|
|
183
|
+
writer.writeln(this.description);
|
|
184
|
+
writer.writeln();
|
|
185
|
+
writer.writeln("Commands:");
|
|
186
|
+
writer.writeln(
|
|
187
|
+
` ${writer.wrapInColor("chart bar", cliCore.CliForegroundColor.Cyan)} Horizontal bar chart`
|
|
188
|
+
);
|
|
189
|
+
writer.writeln(
|
|
190
|
+
` ${writer.wrapInColor("chart line", cliCore.CliForegroundColor.Cyan)} Scatter/line chart`
|
|
191
|
+
);
|
|
192
|
+
writer.writeln(
|
|
193
|
+
` ${writer.wrapInColor("chart sparkline", cliCore.CliForegroundColor.Cyan)} Compact single-line sparkline`
|
|
194
|
+
);
|
|
195
|
+
writer.writeln();
|
|
196
|
+
writer.writeln("Examples:");
|
|
197
|
+
writer.writeln(
|
|
198
|
+
` ${writer.wrapInColor('echo "10\\n20\\n30" | chart bar', cliCore.CliForegroundColor.Cyan)}`
|
|
199
|
+
);
|
|
200
|
+
writer.writeln(
|
|
201
|
+
` ${writer.wrapInColor('echo "Jan:100\\nFeb:200" | chart line', cliCore.CliForegroundColor.Cyan)}`
|
|
202
|
+
);
|
|
203
|
+
writer.writeln(
|
|
204
|
+
` ${writer.wrapInColor('echo "1\\n4\\n9\\n16" | chart sparkline', cliCore.CliForegroundColor.Cyan)}`
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// src/public-api.ts
|
|
210
|
+
var chartModule = {
|
|
211
|
+
apiVersion: API_VERSION,
|
|
212
|
+
name: "@qodalis/cli-chart",
|
|
213
|
+
processors: [new CliChartCommandProcessor()],
|
|
214
|
+
translations: {
|
|
215
|
+
es: { "cli.chart.description": "Renderizar gr\xE1ficos ASCII a partir de datos" },
|
|
216
|
+
fr: { "cli.chart.description": "Afficher des graphiques ASCII \xE0 partir de donn\xE9es" },
|
|
217
|
+
de: { "cli.chart.description": "ASCII-Diagramme aus Daten rendern" },
|
|
218
|
+
pt: { "cli.chart.description": "Renderizar gr\xE1ficos ASCII a partir de dados" },
|
|
219
|
+
it: { "cli.chart.description": "Renderizzare grafici ASCII dai dati" },
|
|
220
|
+
ja: { "cli.chart.description": "\u30C7\u30FC\u30BF\u304B\u3089ASCII\u30C1\u30E3\u30FC\u30C8\u3092\u63CF\u753B" },
|
|
221
|
+
ko: { "cli.chart.description": "\uB370\uC774\uD130\uB97C ASCII \uCC28\uD2B8\uB85C \uB80C\uB354\uB9C1" },
|
|
222
|
+
zh: { "cli.chart.description": "\u5C06\u6570\u636E\u6E32\u67D3\u4E3A ASCII \u56FE\u8868" },
|
|
223
|
+
ru: { "cli.chart.description": "\u041F\u043E\u0441\u0442\u0440\u043E\u0435\u043D\u0438\u0435 ASCII-\u0433\u0440\u0430\u0444\u0438\u043A\u043E\u0432 \u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445" },
|
|
224
|
+
ro: { "cli.chart.description": "Redare grafice ASCII din date" }
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
exports.API_VERSION = API_VERSION;
|
|
229
|
+
exports.CliChartCommandProcessor = CliChartCommandProcessor;
|
|
230
|
+
exports.LIBRARY_VERSION = LIBRARY_VERSION;
|
|
231
|
+
exports.chartModule = chartModule;
|
|
232
|
+
exports.parseChartInput = parseChartInput;
|
|
233
|
+
exports.renderBarChart = renderBarChart;
|
|
234
|
+
exports.renderLineChart = renderLineChart;
|
|
235
|
+
exports.renderSparkline = renderSparkline;
|
|
236
|
+
//# sourceMappingURL=public-api.js.map
|
|
237
|
+
//# sourceMappingURL=public-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/plugins/chart/src/lib/chart-utils.ts","../../packages/plugins/chart/src/lib/version.ts","../../packages/plugins/chart/src/lib/processors/cli-chart-command-processor.ts","../../packages/plugins/chart/src/public-api.ts"],"names":["value","DefaultLibraryAuthor","CliIcon","CliForegroundColor"],"mappings":";;;;;;;AAQO,SAAS,gBAAgB,KAA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CAAmB,IAAI,CAAC,CAAA;AAAA,KAC/F;AAAA,EACJ;AACJ;;;ACrIO,IAAM,WAAA,GAA0B;AAAA,EACnC,UAAA,EAAY,WAAA;AAAA,EACZ,IAAA,EAAM,oBAAA;AAAA,EACN,UAAA,EAAY,CAAC,IAAI,wBAAA,EAA0B,CAAA;AAAA,EAC3C,YAAA,EAAc;AAAA,IACV,EAAA,EAAI,EAAE,uBAAA,EAAyB,gDAAA,EAA8C;AAAA,IAC7E,EAAA,EAAI,EAAE,uBAAA,EAAyB,yDAAA,EAAoD;AAAA,IACnF,EAAA,EAAI,EAAE,uBAAA,EAAyB,mCAAA,EAAoC;AAAA,IACnE,EAAA,EAAI,EAAE,uBAAA,EAAyB,gDAAA,EAA8C;AAAA,IAC7E,EAAA,EAAI,EAAE,uBAAA,EAAyB,qCAAA,EAAsC;AAAA,IACrE,EAAA,EAAI,EAAE,uBAAA,EAAyB,+EAAA,EAAoB;AAAA,IACnD,EAAA,EAAI,EAAE,uBAAA,EAAyB,sEAAA,EAAqB;AAAA,IACpD,EAAA,EAAI,EAAE,uBAAA,EAAyB,yDAAA,EAAkB;AAAA,IACjD,EAAA,EAAI,EAAE,uBAAA,EAAyB,uKAAA,EAAsC;AAAA,IACrE,EAAA,EAAI,EAAE,uBAAA,EAAyB,+BAAA;AAAgC;AAEvE","file":"public-api.js","sourcesContent":["export interface ChartDataPoint {\n label: string;\n value: number;\n}\n\n/**\n * Parse newline-separated numbers or \"key:value\" pairs.\n */\nexport function parseChartInput(input: string): ChartDataPoint[] {\n if (!input.trim()) return [];\n return input\n .split('\\n')\n .map((l) => l.trim())\n .filter(Boolean)\n .map((line, i) => {\n const colonIdx = line.indexOf(':');\n if (colonIdx !== -1) {\n const label = line.slice(0, colonIdx).trim();\n const value = parseFloat(line.slice(colonIdx + 1).trim());\n return { label, value: isNaN(value) ? 0 : value };\n }\n const value = parseFloat(line);\n return { label: String(i + 1), value: isNaN(value) ? 0 : value };\n });\n}\n\nconst BLOCK_CHARS = ' \\u2581\\u2582\\u2583\\u2584\\u2585\\u2586\\u2587\\u2588';\n\nexport function renderBarChart(data: ChartDataPoint[], width = 40): string[] {\n if (data.length === 0) return ['No data'];\n const max = Math.max(...data.map((d) => d.value));\n const labelWidth = Math.max(...data.map((d) => d.label.length)) + 1;\n\n // When all values are zero, show minimal bars\n if (max === 0) {\n return data.map(({ label }) => `${label.padStart(labelWidth)} | \\u2581 0`);\n }\n\n return data.map(({ label, value }) => {\n const ratio = value / max;\n const barLen = Math.round(ratio * width);\n const bar = '\\u2588'.repeat(barLen);\n return `${label.padStart(labelWidth)} | ${bar} ${value}`;\n });\n}\n\nexport function renderSparkline(data: ChartDataPoint[]): string {\n if (data.length === 0) return '';\n const values = data.map((d) => d.value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const range = max - min;\n\n // All same values → use half-block (visual middle)\n if (range === 0) {\n const midChar = BLOCK_CHARS[Math.floor(BLOCK_CHARS.length / 2)];\n return values.map(() => midChar).join('');\n }\n\n return values\n .map((v) => {\n const idx = Math.round(((v - min) / range) * (BLOCK_CHARS.length - 1));\n return BLOCK_CHARS[idx];\n })\n .join('');\n}\n\nexport function renderLineChart(data: ChartDataPoint[], width = 60, height = 12): string[] {\n if (data.length === 0) return ['No data'];\n const values = data.map((d) => d.value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const range = max - min || 1;\n\n const grid: string[][] = Array.from({ length: height }, () =>\n Array(width).fill(' '),\n );\n\n data.forEach(({ value }, i) => {\n const col = Math.round((i / (data.length - 1 || 1)) * (width - 1));\n const row = height - 1 - Math.round(((value - min) / range) * (height - 1));\n if (grid[row]) grid[row][col] = '\\u25cf';\n });\n\n return grid.map((row, i) => {\n const yLabel =\n i === 0\n ? String(max.toFixed(1)).padStart(6)\n : i === height - 1\n ? String(min.toFixed(1)).padStart(6)\n : ''.padStart(6);\n return `${yLabel} |${row.join('')}`;\n });\n}\n","\n// Automatically generated during build\nexport const LIBRARY_VERSION = '2.0.0-beta.1';\nexport const API_VERSION = 2;\n ","import {\n ICliCommandProcessor,\n ICliExecutionContext,\n CliProcessCommand,\n ICliCommandAuthor,\n CliProcessorMetadata,\n CliIcon,\n DefaultLibraryAuthor,\n CliForegroundColor,\n ICliCommandChildProcessor,\n} from '@qodalis/cli-core';\nimport { parseChartInput, renderBarChart, renderLineChart, renderSparkline } from '../chart-utils';\nimport { LIBRARY_VERSION } from '../version';\n\nexport class CliChartCommandProcessor implements ICliCommandProcessor {\n command = 'chart';\n description = 'Render ASCII charts from piped data (numbers or key:value pairs)';\n author: ICliCommandAuthor = DefaultLibraryAuthor;\n version = LIBRARY_VERSION;\n metadata: CliProcessorMetadata = {\n icon: CliIcon.Growth,\n module: 'chart',\n };\n\n processors: ICliCommandChildProcessor[] = [\n {\n command: 'bar',\n description: 'Horizontal bar chart. Pipe numbers or key:value pairs.',\n valueRequired: true,\n processCommand: async (cmd: CliProcessCommand, context: ICliExecutionContext) => {\n const raw = cmd.value || (typeof cmd.data === 'string' ? cmd.data : '') || '';\n const data = parseChartInput(raw);\n if (!data.length) {\n context.writer.writeError('No data. Pipe numbers or key:value pairs.');\n return;\n }\n const width = Math.min((context.terminal?.cols ?? 80) - 20, 60);\n const lines = renderBarChart(data, width);\n for (const line of lines) {\n context.writer.writeln(\n context.writer.wrapInColor(line, CliForegroundColor.Cyan),\n );\n }\n context.process.output(lines);\n },\n writeDescription: (context: ICliExecutionContext) => {\n const { writer } = context;\n writer.writeln('Render a horizontal ASCII bar chart from piped data.');\n writer.writeln();\n writer.writeln('Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"10\\\\n20\\\\n30\" | chart bar', CliForegroundColor.Cyan)}`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('echo \"Jan:100\\\\nFeb:200\\\\nMar:150\" | chart bar', CliForegroundColor.Cyan)}`,\n );\n },\n },\n {\n command: 'line',\n description: 'Line chart. Pipe numbers or key:value pairs.',\n valueRequired: true,\n processCommand: async (cmd: CliProcessCommand, context: ICliExecutionContext) => {\n const raw = cmd.value || (typeof cmd.data === 'string' ? cmd.data : '') || '';\n const data = parseChartInput(raw);\n if (!data.length) {\n context.writer.writeError('No data. Pipe numbers or key:value pairs.');\n return;\n }\n const width = Math.min((context.terminal?.cols ?? 80) - 10, 60);\n const lines = renderLineChart(data, width);\n for (const line of lines) {\n context.writer.writeln(line);\n }\n const labels = data.map((d) => d.label.slice(0, 3));\n context.writer.writeln(' ' + labels.join(' '));\n context.process.output(lines);\n },\n writeDescription: (context: ICliExecutionContext) => {\n const { writer } = context;\n writer.writeln('Render an ASCII line/scatter chart from piped data.');\n writer.writeln();\n writer.writeln('Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"Jan:100\\\\nFeb:200\\\\nMar:150\" | chart line', CliForegroundColor.Cyan)}`,\n );\n },\n },\n {\n command: 'sparkline',\n description: 'Single-line sparkline. Pipe numbers or key:value pairs.',\n valueRequired: true,\n processCommand: async (cmd: CliProcessCommand, context: ICliExecutionContext) => {\n const raw = cmd.value || (typeof cmd.data === 'string' ? cmd.data : '') || '';\n const data = parseChartInput(raw);\n if (!data.length) {\n context.writer.writeError('No data. Pipe numbers or key:value pairs.');\n return;\n }\n const spark = renderSparkline(data);\n context.writer.writeln(spark);\n context.process.output(spark);\n },\n writeDescription: (context: ICliExecutionContext) => {\n const { writer } = context;\n writer.writeln('Render a compact single-line sparkline from piped data.');\n writer.writeln();\n writer.writeln('Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"1\\\\n4\\\\n9\\\\n16\\\\n25\" | chart sparkline', CliForegroundColor.Cyan)}`,\n );\n },\n },\n ];\n\n async processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void> {\n await context.executor.showHelp(_, context);\n }\n\n writeDescription(context: ICliExecutionContext): void {\n const { writer } = context;\n writer.writeln(this.description!);\n writer.writeln();\n writer.writeln('Commands:');\n writer.writeln(\n ` ${writer.wrapInColor('chart bar', CliForegroundColor.Cyan)} Horizontal bar chart`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('chart line', CliForegroundColor.Cyan)} Scatter/line chart`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('chart sparkline', CliForegroundColor.Cyan)} Compact single-line sparkline`,\n );\n writer.writeln();\n writer.writeln('Examples:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"10\\\\n20\\\\n30\" | chart bar', CliForegroundColor.Cyan)}`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('echo \"Jan:100\\\\nFeb:200\" | chart line', CliForegroundColor.Cyan)}`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('echo \"1\\\\n4\\\\n9\\\\n16\" | chart sparkline', CliForegroundColor.Cyan)}`,\n );\n }\n}\n","/*\n * Public API Surface of chart\n */\n\nexport * from './lib/processors/cli-chart-command-processor';\nexport * from './lib/chart-utils';\nexport * from './lib/version';\n\nimport { ICliModule } from '@qodalis/cli-core';\nimport { CliChartCommandProcessor } from './lib/processors/cli-chart-command-processor';\nimport { API_VERSION } from './lib/version';\n\nexport const chartModule: ICliModule = {\n apiVersion: API_VERSION,\n name: '@qodalis/cli-chart',\n processors: [new CliChartCommandProcessor()],\n translations: {\n es: { 'cli.chart.description': 'Renderizar gráficos ASCII a partir de datos' },\n fr: { 'cli.chart.description': 'Afficher des graphiques ASCII à partir de données' },\n de: { 'cli.chart.description': 'ASCII-Diagramme aus Daten rendern' },\n pt: { 'cli.chart.description': 'Renderizar gráficos ASCII a partir de dados' },\n it: { 'cli.chart.description': 'Renderizzare grafici ASCII dai dati' },\n ja: { 'cli.chart.description': 'データからASCIIチャートを描画' },\n ko: { 'cli.chart.description': '데이터를 ASCII 차트로 렌더링' },\n zh: { 'cli.chart.description': '将数据渲染为 ASCII 图表' },\n ru: { 'cli.chart.description': 'Построение ASCII-графиков из данных' },\n ro: { 'cli.chart.description': 'Redare grafice ASCII din date' },\n },\n};\n"]}
|
package/public-api.mjs
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { DefaultLibraryAuthor, CliIcon, CliForegroundColor } from '@qodalis/cli-core';
|
|
2
|
+
|
|
3
|
+
// src/lib/processors/cli-chart-command-processor.ts
|
|
4
|
+
|
|
5
|
+
// src/lib/chart-utils.ts
|
|
6
|
+
function parseChartInput(input) {
|
|
7
|
+
if (!input.trim()) return [];
|
|
8
|
+
return input.split("\n").map((l) => l.trim()).filter(Boolean).map((line, i) => {
|
|
9
|
+
const colonIdx = line.indexOf(":");
|
|
10
|
+
if (colonIdx !== -1) {
|
|
11
|
+
const label = line.slice(0, colonIdx).trim();
|
|
12
|
+
const value2 = parseFloat(line.slice(colonIdx + 1).trim());
|
|
13
|
+
return { label, value: isNaN(value2) ? 0 : value2 };
|
|
14
|
+
}
|
|
15
|
+
const value = parseFloat(line);
|
|
16
|
+
return { label: String(i + 1), value: isNaN(value) ? 0 : value };
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
var BLOCK_CHARS = " \u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588";
|
|
20
|
+
function renderBarChart(data, width = 40) {
|
|
21
|
+
if (data.length === 0) return ["No data"];
|
|
22
|
+
const max = Math.max(...data.map((d) => d.value));
|
|
23
|
+
const labelWidth = Math.max(...data.map((d) => d.label.length)) + 1;
|
|
24
|
+
if (max === 0) {
|
|
25
|
+
return data.map(({ label }) => `${label.padStart(labelWidth)} | \u2581 0`);
|
|
26
|
+
}
|
|
27
|
+
return data.map(({ label, value }) => {
|
|
28
|
+
const ratio = value / max;
|
|
29
|
+
const barLen = Math.round(ratio * width);
|
|
30
|
+
const bar = "\u2588".repeat(barLen);
|
|
31
|
+
return `${label.padStart(labelWidth)} | ${bar} ${value}`;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function renderSparkline(data) {
|
|
35
|
+
if (data.length === 0) return "";
|
|
36
|
+
const values = data.map((d) => d.value);
|
|
37
|
+
const min = Math.min(...values);
|
|
38
|
+
const max = Math.max(...values);
|
|
39
|
+
const range = max - min;
|
|
40
|
+
if (range === 0) {
|
|
41
|
+
const midChar = BLOCK_CHARS[Math.floor(BLOCK_CHARS.length / 2)];
|
|
42
|
+
return values.map(() => midChar).join("");
|
|
43
|
+
}
|
|
44
|
+
return values.map((v) => {
|
|
45
|
+
const idx = Math.round((v - min) / range * (BLOCK_CHARS.length - 1));
|
|
46
|
+
return BLOCK_CHARS[idx];
|
|
47
|
+
}).join("");
|
|
48
|
+
}
|
|
49
|
+
function renderLineChart(data, width = 60, height = 12) {
|
|
50
|
+
if (data.length === 0) return ["No data"];
|
|
51
|
+
const values = data.map((d) => d.value);
|
|
52
|
+
const min = Math.min(...values);
|
|
53
|
+
const max = Math.max(...values);
|
|
54
|
+
const range = max - min || 1;
|
|
55
|
+
const grid = Array.from(
|
|
56
|
+
{ length: height },
|
|
57
|
+
() => Array(width).fill(" ")
|
|
58
|
+
);
|
|
59
|
+
data.forEach(({ value }, i) => {
|
|
60
|
+
const col = Math.round(i / (data.length - 1 || 1) * (width - 1));
|
|
61
|
+
const row = height - 1 - Math.round((value - min) / range * (height - 1));
|
|
62
|
+
if (grid[row]) grid[row][col] = "\u25CF";
|
|
63
|
+
});
|
|
64
|
+
return grid.map((row, i) => {
|
|
65
|
+
const yLabel = i === 0 ? String(max.toFixed(1)).padStart(6) : i === height - 1 ? String(min.toFixed(1)).padStart(6) : "".padStart(6);
|
|
66
|
+
return `${yLabel} |${row.join("")}`;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// src/lib/version.ts
|
|
71
|
+
var LIBRARY_VERSION = "2.0.0-beta.1";
|
|
72
|
+
var API_VERSION = 2;
|
|
73
|
+
|
|
74
|
+
// src/lib/processors/cli-chart-command-processor.ts
|
|
75
|
+
var CliChartCommandProcessor = class {
|
|
76
|
+
constructor() {
|
|
77
|
+
this.command = "chart";
|
|
78
|
+
this.description = "Render ASCII charts from piped data (numbers or key:value pairs)";
|
|
79
|
+
this.author = DefaultLibraryAuthor;
|
|
80
|
+
this.version = LIBRARY_VERSION;
|
|
81
|
+
this.metadata = {
|
|
82
|
+
icon: CliIcon.Growth,
|
|
83
|
+
module: "chart"
|
|
84
|
+
};
|
|
85
|
+
this.processors = [
|
|
86
|
+
{
|
|
87
|
+
command: "bar",
|
|
88
|
+
description: "Horizontal bar chart. Pipe numbers or key:value pairs.",
|
|
89
|
+
valueRequired: true,
|
|
90
|
+
processCommand: async (cmd, context) => {
|
|
91
|
+
const raw = cmd.value || (typeof cmd.data === "string" ? cmd.data : "") || "";
|
|
92
|
+
const data = parseChartInput(raw);
|
|
93
|
+
if (!data.length) {
|
|
94
|
+
context.writer.writeError("No data. Pipe numbers or key:value pairs.");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const width = Math.min((context.terminal?.cols ?? 80) - 20, 60);
|
|
98
|
+
const lines = renderBarChart(data, width);
|
|
99
|
+
for (const line of lines) {
|
|
100
|
+
context.writer.writeln(
|
|
101
|
+
context.writer.wrapInColor(line, CliForegroundColor.Cyan)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
context.process.output(lines);
|
|
105
|
+
},
|
|
106
|
+
writeDescription: (context) => {
|
|
107
|
+
const { writer } = context;
|
|
108
|
+
writer.writeln("Render a horizontal ASCII bar chart from piped data.");
|
|
109
|
+
writer.writeln();
|
|
110
|
+
writer.writeln("Usage:");
|
|
111
|
+
writer.writeln(
|
|
112
|
+
` ${writer.wrapInColor('echo "10\\n20\\n30" | chart bar', CliForegroundColor.Cyan)}`
|
|
113
|
+
);
|
|
114
|
+
writer.writeln(
|
|
115
|
+
` ${writer.wrapInColor('echo "Jan:100\\nFeb:200\\nMar:150" | chart bar', CliForegroundColor.Cyan)}`
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
command: "line",
|
|
121
|
+
description: "Line chart. Pipe numbers or key:value pairs.",
|
|
122
|
+
valueRequired: true,
|
|
123
|
+
processCommand: async (cmd, context) => {
|
|
124
|
+
const raw = cmd.value || (typeof cmd.data === "string" ? cmd.data : "") || "";
|
|
125
|
+
const data = parseChartInput(raw);
|
|
126
|
+
if (!data.length) {
|
|
127
|
+
context.writer.writeError("No data. Pipe numbers or key:value pairs.");
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const width = Math.min((context.terminal?.cols ?? 80) - 10, 60);
|
|
131
|
+
const lines = renderLineChart(data, width);
|
|
132
|
+
for (const line of lines) {
|
|
133
|
+
context.writer.writeln(line);
|
|
134
|
+
}
|
|
135
|
+
const labels = data.map((d) => d.label.slice(0, 3));
|
|
136
|
+
context.writer.writeln(" " + labels.join(" "));
|
|
137
|
+
context.process.output(lines);
|
|
138
|
+
},
|
|
139
|
+
writeDescription: (context) => {
|
|
140
|
+
const { writer } = context;
|
|
141
|
+
writer.writeln("Render an ASCII line/scatter chart from piped data.");
|
|
142
|
+
writer.writeln();
|
|
143
|
+
writer.writeln("Usage:");
|
|
144
|
+
writer.writeln(
|
|
145
|
+
` ${writer.wrapInColor('echo "Jan:100\\nFeb:200\\nMar:150" | chart line', CliForegroundColor.Cyan)}`
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
command: "sparkline",
|
|
151
|
+
description: "Single-line sparkline. Pipe numbers or key:value pairs.",
|
|
152
|
+
valueRequired: true,
|
|
153
|
+
processCommand: async (cmd, context) => {
|
|
154
|
+
const raw = cmd.value || (typeof cmd.data === "string" ? cmd.data : "") || "";
|
|
155
|
+
const data = parseChartInput(raw);
|
|
156
|
+
if (!data.length) {
|
|
157
|
+
context.writer.writeError("No data. Pipe numbers or key:value pairs.");
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const spark = renderSparkline(data);
|
|
161
|
+
context.writer.writeln(spark);
|
|
162
|
+
context.process.output(spark);
|
|
163
|
+
},
|
|
164
|
+
writeDescription: (context) => {
|
|
165
|
+
const { writer } = context;
|
|
166
|
+
writer.writeln("Render a compact single-line sparkline from piped data.");
|
|
167
|
+
writer.writeln();
|
|
168
|
+
writer.writeln("Usage:");
|
|
169
|
+
writer.writeln(
|
|
170
|
+
` ${writer.wrapInColor('echo "1\\n4\\n9\\n16\\n25" | chart sparkline', CliForegroundColor.Cyan)}`
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
async processCommand(_, context) {
|
|
177
|
+
await context.executor.showHelp(_, context);
|
|
178
|
+
}
|
|
179
|
+
writeDescription(context) {
|
|
180
|
+
const { writer } = context;
|
|
181
|
+
writer.writeln(this.description);
|
|
182
|
+
writer.writeln();
|
|
183
|
+
writer.writeln("Commands:");
|
|
184
|
+
writer.writeln(
|
|
185
|
+
` ${writer.wrapInColor("chart bar", CliForegroundColor.Cyan)} Horizontal bar chart`
|
|
186
|
+
);
|
|
187
|
+
writer.writeln(
|
|
188
|
+
` ${writer.wrapInColor("chart line", CliForegroundColor.Cyan)} Scatter/line chart`
|
|
189
|
+
);
|
|
190
|
+
writer.writeln(
|
|
191
|
+
` ${writer.wrapInColor("chart sparkline", CliForegroundColor.Cyan)} Compact single-line sparkline`
|
|
192
|
+
);
|
|
193
|
+
writer.writeln();
|
|
194
|
+
writer.writeln("Examples:");
|
|
195
|
+
writer.writeln(
|
|
196
|
+
` ${writer.wrapInColor('echo "10\\n20\\n30" | chart bar', CliForegroundColor.Cyan)}`
|
|
197
|
+
);
|
|
198
|
+
writer.writeln(
|
|
199
|
+
` ${writer.wrapInColor('echo "Jan:100\\nFeb:200" | chart line', CliForegroundColor.Cyan)}`
|
|
200
|
+
);
|
|
201
|
+
writer.writeln(
|
|
202
|
+
` ${writer.wrapInColor('echo "1\\n4\\n9\\n16" | chart sparkline', CliForegroundColor.Cyan)}`
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// src/public-api.ts
|
|
208
|
+
var chartModule = {
|
|
209
|
+
apiVersion: API_VERSION,
|
|
210
|
+
name: "@qodalis/cli-chart",
|
|
211
|
+
processors: [new CliChartCommandProcessor()],
|
|
212
|
+
translations: {
|
|
213
|
+
es: { "cli.chart.description": "Renderizar gr\xE1ficos ASCII a partir de datos" },
|
|
214
|
+
fr: { "cli.chart.description": "Afficher des graphiques ASCII \xE0 partir de donn\xE9es" },
|
|
215
|
+
de: { "cli.chart.description": "ASCII-Diagramme aus Daten rendern" },
|
|
216
|
+
pt: { "cli.chart.description": "Renderizar gr\xE1ficos ASCII a partir de dados" },
|
|
217
|
+
it: { "cli.chart.description": "Renderizzare grafici ASCII dai dati" },
|
|
218
|
+
ja: { "cli.chart.description": "\u30C7\u30FC\u30BF\u304B\u3089ASCII\u30C1\u30E3\u30FC\u30C8\u3092\u63CF\u753B" },
|
|
219
|
+
ko: { "cli.chart.description": "\uB370\uC774\uD130\uB97C ASCII \uCC28\uD2B8\uB85C \uB80C\uB354\uB9C1" },
|
|
220
|
+
zh: { "cli.chart.description": "\u5C06\u6570\u636E\u6E32\u67D3\u4E3A ASCII \u56FE\u8868" },
|
|
221
|
+
ru: { "cli.chart.description": "\u041F\u043E\u0441\u0442\u0440\u043E\u0435\u043D\u0438\u0435 ASCII-\u0433\u0440\u0430\u0444\u0438\u043A\u043E\u0432 \u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445" },
|
|
222
|
+
ro: { "cli.chart.description": "Redare grafice ASCII din date" }
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export { API_VERSION, CliChartCommandProcessor, LIBRARY_VERSION, chartModule, parseChartInput, renderBarChart, renderLineChart, renderSparkline };
|
|
227
|
+
//# sourceMappingURL=public-api.mjs.map
|
|
228
|
+
//# sourceMappingURL=public-api.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/plugins/chart/src/lib/chart-utils.ts","../../packages/plugins/chart/src/lib/version.ts","../../packages/plugins/chart/src/lib/processors/cli-chart-command-processor.ts","../../packages/plugins/chart/src/public-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O,WAAA,CAAY,yCAAA,EAA2C,kBAAA,CAAmB,IAAI,CAAC,CAAA;AAAA,KAC/F;AAAA,EACJ;AACJ;;;ACrIO,IAAM,WAAA,GAA0B;AAAA,EACnC,UAAA,EAAY,WAAA;AAAA,EACZ,IAAA,EAAM,oBAAA;AAAA,EACN,UAAA,EAAY,CAAC,IAAI,wBAAA,EAA0B,CAAA;AAAA,EAC3C,YAAA,EAAc;AAAA,IACV,EAAA,EAAI,EAAE,uBAAA,EAAyB,gDAAA,EAA8C;AAAA,IAC7E,EAAA,EAAI,EAAE,uBAAA,EAAyB,yDAAA,EAAoD;AAAA,IACnF,EAAA,EAAI,EAAE,uBAAA,EAAyB,mCAAA,EAAoC;AAAA,IACnE,EAAA,EAAI,EAAE,uBAAA,EAAyB,gDAAA,EAA8C;AAAA,IAC7E,EAAA,EAAI,EAAE,uBAAA,EAAyB,qCAAA,EAAsC;AAAA,IACrE,EAAA,EAAI,EAAE,uBAAA,EAAyB,+EAAA,EAAoB;AAAA,IACnD,EAAA,EAAI,EAAE,uBAAA,EAAyB,sEAAA,EAAqB;AAAA,IACpD,EAAA,EAAI,EAAE,uBAAA,EAAyB,yDAAA,EAAkB;AAAA,IACjD,EAAA,EAAI,EAAE,uBAAA,EAAyB,uKAAA,EAAsC;AAAA,IACrE,EAAA,EAAI,EAAE,uBAAA,EAAyB,+BAAA;AAAgC;AAEvE","file":"public-api.mjs","sourcesContent":["export interface ChartDataPoint {\n label: string;\n value: number;\n}\n\n/**\n * Parse newline-separated numbers or \"key:value\" pairs.\n */\nexport function parseChartInput(input: string): ChartDataPoint[] {\n if (!input.trim()) return [];\n return input\n .split('\\n')\n .map((l) => l.trim())\n .filter(Boolean)\n .map((line, i) => {\n const colonIdx = line.indexOf(':');\n if (colonIdx !== -1) {\n const label = line.slice(0, colonIdx).trim();\n const value = parseFloat(line.slice(colonIdx + 1).trim());\n return { label, value: isNaN(value) ? 0 : value };\n }\n const value = parseFloat(line);\n return { label: String(i + 1), value: isNaN(value) ? 0 : value };\n });\n}\n\nconst BLOCK_CHARS = ' \\u2581\\u2582\\u2583\\u2584\\u2585\\u2586\\u2587\\u2588';\n\nexport function renderBarChart(data: ChartDataPoint[], width = 40): string[] {\n if (data.length === 0) return ['No data'];\n const max = Math.max(...data.map((d) => d.value));\n const labelWidth = Math.max(...data.map((d) => d.label.length)) + 1;\n\n // When all values are zero, show minimal bars\n if (max === 0) {\n return data.map(({ label }) => `${label.padStart(labelWidth)} | \\u2581 0`);\n }\n\n return data.map(({ label, value }) => {\n const ratio = value / max;\n const barLen = Math.round(ratio * width);\n const bar = '\\u2588'.repeat(barLen);\n return `${label.padStart(labelWidth)} | ${bar} ${value}`;\n });\n}\n\nexport function renderSparkline(data: ChartDataPoint[]): string {\n if (data.length === 0) return '';\n const values = data.map((d) => d.value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const range = max - min;\n\n // All same values → use half-block (visual middle)\n if (range === 0) {\n const midChar = BLOCK_CHARS[Math.floor(BLOCK_CHARS.length / 2)];\n return values.map(() => midChar).join('');\n }\n\n return values\n .map((v) => {\n const idx = Math.round(((v - min) / range) * (BLOCK_CHARS.length - 1));\n return BLOCK_CHARS[idx];\n })\n .join('');\n}\n\nexport function renderLineChart(data: ChartDataPoint[], width = 60, height = 12): string[] {\n if (data.length === 0) return ['No data'];\n const values = data.map((d) => d.value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const range = max - min || 1;\n\n const grid: string[][] = Array.from({ length: height }, () =>\n Array(width).fill(' '),\n );\n\n data.forEach(({ value }, i) => {\n const col = Math.round((i / (data.length - 1 || 1)) * (width - 1));\n const row = height - 1 - Math.round(((value - min) / range) * (height - 1));\n if (grid[row]) grid[row][col] = '\\u25cf';\n });\n\n return grid.map((row, i) => {\n const yLabel =\n i === 0\n ? String(max.toFixed(1)).padStart(6)\n : i === height - 1\n ? String(min.toFixed(1)).padStart(6)\n : ''.padStart(6);\n return `${yLabel} |${row.join('')}`;\n });\n}\n","\n// Automatically generated during build\nexport const LIBRARY_VERSION = '2.0.0-beta.1';\nexport const API_VERSION = 2;\n ","import {\n ICliCommandProcessor,\n ICliExecutionContext,\n CliProcessCommand,\n ICliCommandAuthor,\n CliProcessorMetadata,\n CliIcon,\n DefaultLibraryAuthor,\n CliForegroundColor,\n ICliCommandChildProcessor,\n} from '@qodalis/cli-core';\nimport { parseChartInput, renderBarChart, renderLineChart, renderSparkline } from '../chart-utils';\nimport { LIBRARY_VERSION } from '../version';\n\nexport class CliChartCommandProcessor implements ICliCommandProcessor {\n command = 'chart';\n description = 'Render ASCII charts from piped data (numbers or key:value pairs)';\n author: ICliCommandAuthor = DefaultLibraryAuthor;\n version = LIBRARY_VERSION;\n metadata: CliProcessorMetadata = {\n icon: CliIcon.Growth,\n module: 'chart',\n };\n\n processors: ICliCommandChildProcessor[] = [\n {\n command: 'bar',\n description: 'Horizontal bar chart. Pipe numbers or key:value pairs.',\n valueRequired: true,\n processCommand: async (cmd: CliProcessCommand, context: ICliExecutionContext) => {\n const raw = cmd.value || (typeof cmd.data === 'string' ? cmd.data : '') || '';\n const data = parseChartInput(raw);\n if (!data.length) {\n context.writer.writeError('No data. Pipe numbers or key:value pairs.');\n return;\n }\n const width = Math.min((context.terminal?.cols ?? 80) - 20, 60);\n const lines = renderBarChart(data, width);\n for (const line of lines) {\n context.writer.writeln(\n context.writer.wrapInColor(line, CliForegroundColor.Cyan),\n );\n }\n context.process.output(lines);\n },\n writeDescription: (context: ICliExecutionContext) => {\n const { writer } = context;\n writer.writeln('Render a horizontal ASCII bar chart from piped data.');\n writer.writeln();\n writer.writeln('Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"10\\\\n20\\\\n30\" | chart bar', CliForegroundColor.Cyan)}`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('echo \"Jan:100\\\\nFeb:200\\\\nMar:150\" | chart bar', CliForegroundColor.Cyan)}`,\n );\n },\n },\n {\n command: 'line',\n description: 'Line chart. Pipe numbers or key:value pairs.',\n valueRequired: true,\n processCommand: async (cmd: CliProcessCommand, context: ICliExecutionContext) => {\n const raw = cmd.value || (typeof cmd.data === 'string' ? cmd.data : '') || '';\n const data = parseChartInput(raw);\n if (!data.length) {\n context.writer.writeError('No data. Pipe numbers or key:value pairs.');\n return;\n }\n const width = Math.min((context.terminal?.cols ?? 80) - 10, 60);\n const lines = renderLineChart(data, width);\n for (const line of lines) {\n context.writer.writeln(line);\n }\n const labels = data.map((d) => d.label.slice(0, 3));\n context.writer.writeln(' ' + labels.join(' '));\n context.process.output(lines);\n },\n writeDescription: (context: ICliExecutionContext) => {\n const { writer } = context;\n writer.writeln('Render an ASCII line/scatter chart from piped data.');\n writer.writeln();\n writer.writeln('Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"Jan:100\\\\nFeb:200\\\\nMar:150\" | chart line', CliForegroundColor.Cyan)}`,\n );\n },\n },\n {\n command: 'sparkline',\n description: 'Single-line sparkline. Pipe numbers or key:value pairs.',\n valueRequired: true,\n processCommand: async (cmd: CliProcessCommand, context: ICliExecutionContext) => {\n const raw = cmd.value || (typeof cmd.data === 'string' ? cmd.data : '') || '';\n const data = parseChartInput(raw);\n if (!data.length) {\n context.writer.writeError('No data. Pipe numbers or key:value pairs.');\n return;\n }\n const spark = renderSparkline(data);\n context.writer.writeln(spark);\n context.process.output(spark);\n },\n writeDescription: (context: ICliExecutionContext) => {\n const { writer } = context;\n writer.writeln('Render a compact single-line sparkline from piped data.');\n writer.writeln();\n writer.writeln('Usage:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"1\\\\n4\\\\n9\\\\n16\\\\n25\" | chart sparkline', CliForegroundColor.Cyan)}`,\n );\n },\n },\n ];\n\n async processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void> {\n await context.executor.showHelp(_, context);\n }\n\n writeDescription(context: ICliExecutionContext): void {\n const { writer } = context;\n writer.writeln(this.description!);\n writer.writeln();\n writer.writeln('Commands:');\n writer.writeln(\n ` ${writer.wrapInColor('chart bar', CliForegroundColor.Cyan)} Horizontal bar chart`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('chart line', CliForegroundColor.Cyan)} Scatter/line chart`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('chart sparkline', CliForegroundColor.Cyan)} Compact single-line sparkline`,\n );\n writer.writeln();\n writer.writeln('Examples:');\n writer.writeln(\n ` ${writer.wrapInColor('echo \"10\\\\n20\\\\n30\" | chart bar', CliForegroundColor.Cyan)}`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('echo \"Jan:100\\\\nFeb:200\" | chart line', CliForegroundColor.Cyan)}`,\n );\n writer.writeln(\n ` ${writer.wrapInColor('echo \"1\\\\n4\\\\n9\\\\n16\" | chart sparkline', CliForegroundColor.Cyan)}`,\n );\n }\n}\n","/*\n * Public API Surface of chart\n */\n\nexport * from './lib/processors/cli-chart-command-processor';\nexport * from './lib/chart-utils';\nexport * from './lib/version';\n\nimport { ICliModule } from '@qodalis/cli-core';\nimport { CliChartCommandProcessor } from './lib/processors/cli-chart-command-processor';\nimport { API_VERSION } from './lib/version';\n\nexport const chartModule: ICliModule = {\n apiVersion: API_VERSION,\n name: '@qodalis/cli-chart',\n processors: [new CliChartCommandProcessor()],\n translations: {\n es: { 'cli.chart.description': 'Renderizar gráficos ASCII a partir de datos' },\n fr: { 'cli.chart.description': 'Afficher des graphiques ASCII à partir de données' },\n de: { 'cli.chart.description': 'ASCII-Diagramme aus Daten rendern' },\n pt: { 'cli.chart.description': 'Renderizar gráficos ASCII a partir de dados' },\n it: { 'cli.chart.description': 'Renderizzare grafici ASCII dai dati' },\n ja: { 'cli.chart.description': 'データからASCIIチャートを描画' },\n ko: { 'cli.chart.description': '데이터를 ASCII 차트로 렌더링' },\n zh: { 'cli.chart.description': '将数据渲染为 ASCII 图表' },\n ru: { 'cli.chart.description': 'Построение ASCII-графиков из данных' },\n ro: { 'cli.chart.description': 'Redare grafice ASCII din date' },\n },\n};\n"]}
|