@miao-vision/cli 0.1.2 → 0.1.3
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.cjs +78 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -56651,6 +56651,14 @@ function renderDeckHtml(spec, rows, themeOverride) {
|
|
|
56651
56651
|
// src/cli.ts
|
|
56652
56652
|
async function main() {
|
|
56653
56653
|
const args = parseArgs(process.argv.slice(2));
|
|
56654
|
+
if (args.command === "--help" || args.command === "-h" || args.command === "help" || !args.command) {
|
|
56655
|
+
printHelp();
|
|
56656
|
+
return;
|
|
56657
|
+
}
|
|
56658
|
+
if (args.flags["help"] === true || args.flags["h"] === true) {
|
|
56659
|
+
printHelp(args.command);
|
|
56660
|
+
return;
|
|
56661
|
+
}
|
|
56654
56662
|
try {
|
|
56655
56663
|
if (args.command === "profile") {
|
|
56656
56664
|
printJson(runProfile(args));
|
|
@@ -56850,6 +56858,76 @@ function printJson(value) {
|
|
|
56850
56858
|
process.stdout.write(`${JSON.stringify(value, null, 2)}
|
|
56851
56859
|
`);
|
|
56852
56860
|
}
|
|
56861
|
+
var COMMAND_HELP = {
|
|
56862
|
+
profile: `Usage: miao-viz profile <file> [options]
|
|
56863
|
+
|
|
56864
|
+
Profile a data file and output column statistics.
|
|
56865
|
+
|
|
56866
|
+
Arguments:
|
|
56867
|
+
file Path to CSV, Excel (.xlsx/.xls), or JSON file
|
|
56868
|
+
|
|
56869
|
+
Options:
|
|
56870
|
+
--sheet <name> Sheet name (Excel only)
|
|
56871
|
+
--limit <n> Max rows to read
|
|
56872
|
+
`,
|
|
56873
|
+
validate: `Usage: miao-viz validate --spec <file> --profile <file>
|
|
56874
|
+
|
|
56875
|
+
Validate a vizspec against a data profile.
|
|
56876
|
+
|
|
56877
|
+
Options:
|
|
56878
|
+
--spec <file> Path to vizspec YAML/JSON
|
|
56879
|
+
--profile <file> Path to profile JSON (output of "profile")
|
|
56880
|
+
`,
|
|
56881
|
+
catalog: `Usage: miao-viz catalog
|
|
56882
|
+
|
|
56883
|
+
List all available chart types and their required fields.
|
|
56884
|
+
`,
|
|
56885
|
+
render: `Usage: miao-viz render --input <file> --spec <file> --output <file> [options]
|
|
56886
|
+
|
|
56887
|
+
Render a vizspec to HTML or SVG.
|
|
56888
|
+
|
|
56889
|
+
Options:
|
|
56890
|
+
--input <file> Path to data file
|
|
56891
|
+
--spec <file> Path to vizspec YAML/JSON
|
|
56892
|
+
--output <file> Output file path
|
|
56893
|
+
--format <fmt> Output format: html, svg (default: html)
|
|
56894
|
+
--theme <name> Theme: default, editorial, dark, minimal
|
|
56895
|
+
--sheet <name> Sheet name (Excel only)
|
|
56896
|
+
--limit <n> Max rows to read
|
|
56897
|
+
`,
|
|
56898
|
+
deck: `Usage: miao-viz deck --input <file> --spec <file> --output <file> [options]
|
|
56899
|
+
|
|
56900
|
+
Render a deck spec to HTML slides.
|
|
56901
|
+
|
|
56902
|
+
Options:
|
|
56903
|
+
--input <file> Path to data file
|
|
56904
|
+
--spec <file> Path to deck spec YAML/JSON
|
|
56905
|
+
--output <file> Output file path
|
|
56906
|
+
--theme <name> Theme: default, editorial, dark, minimal
|
|
56907
|
+
--sheet <name> Sheet name (Excel only)
|
|
56908
|
+
--limit <n> Max rows to read
|
|
56909
|
+
`
|
|
56910
|
+
};
|
|
56911
|
+
function printHelp(command) {
|
|
56912
|
+
if (command && COMMAND_HELP[command]) {
|
|
56913
|
+
process.stdout.write(COMMAND_HELP[command]);
|
|
56914
|
+
return;
|
|
56915
|
+
}
|
|
56916
|
+
process.stdout.write(`miao-viz \u2014 local data visualization CLI
|
|
56917
|
+
|
|
56918
|
+
Usage:
|
|
56919
|
+
miao-viz <command> [options]
|
|
56920
|
+
|
|
56921
|
+
Commands:
|
|
56922
|
+
profile Profile a data file (CSV, Excel, JSON)
|
|
56923
|
+
validate Validate a vizspec against a data profile
|
|
56924
|
+
catalog List all available chart types
|
|
56925
|
+
render Render a vizspec to HTML or SVG
|
|
56926
|
+
deck Render a deck spec to HTML slides
|
|
56927
|
+
|
|
56928
|
+
Run "miao-viz <command> --help" for command-specific options.
|
|
56929
|
+
`);
|
|
56930
|
+
}
|
|
56853
56931
|
main();
|
|
56854
56932
|
/*! Bundled license information:
|
|
56855
56933
|
|