Skip to content

Commit 8b53658

Browse files
committed
ascii-cli-12: mode
1 parent ee6f8e3 commit 8b53658

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-ascii-chart-cli",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"description": "Simple ascii chart generator CLI",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -52,7 +52,7 @@
5252
"dist/**/*"
5353
],
5454
"dependencies": {
55-
"simple-ascii-chart": "^5.1.0",
55+
"simple-ascii-chart": "^5.2.0",
5656
"yargs": "^17.7.2"
5757
}
5858
}

src/cli.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ const { argv } = yargs
3838
type: 'boolean',
3939
description: 'Hide the x-axis if set to true',
4040
})
41-
.option('barChart', {
42-
type: 'boolean',
43-
description: 'Draw bar chart if set to true',
44-
})
45-
.option('horizontalBarChart', {
46-
type: 'boolean',
47-
description: 'Draw horizontal bar chart if set to true',
41+
.option('mode', {
42+
type: 'string',
43+
description: 'Sets mode for the plot (e.g., "line", "bar", "horizontalBar", "point")',
4844
})
4945
.option('hideYAxis', {
5046
type: 'boolean',
@@ -157,8 +153,7 @@ const prepareParams = ({
157153
formatter,
158154
lineFormatter,
159155
symbols,
160-
barChart,
161-
horizontalBarChart,
156+
mode,
162157
}: {
163158
input: string;
164159
options?: string;
@@ -180,8 +175,7 @@ const prepareParams = ({
180175
formatter?: string;
181176
lineFormatter?: string;
182177
symbols?: string;
183-
barChart?: boolean;
184-
horizontalBarChart?: boolean;
178+
mode?: string;
185179
}) => {
186180
const currentOptions = options ? JSON.parse(options) : {};
187181

@@ -197,8 +191,7 @@ const prepareParams = ({
197191
xLabel,
198192
yLabel,
199193
fillArea,
200-
barChart,
201-
horizontalBarChart,
194+
mode,
202195
color: color ? validateColors(color) : undefined, // Ensure color matches Colors type
203196
axisCenter: validateAxisCenter(axisCenter), // Validate and format axisCenter
204197
yRange: validateYRange(yRange), // Validate and format yRange

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,10 +3663,10 @@ signal-exit@^3.0.3, signal-exit@^3.0.7:
36633663
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
36643664
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
36653665

3666-
simple-ascii-chart@^5.1.0:
3667-
version "5.1.0"
3668-
resolved "https://registry.yarnpkg.com/simple-ascii-chart/-/simple-ascii-chart-5.1.0.tgz#496a2b7a8a2f146a7a3e9309e86602a8c91b9609"
3669-
integrity sha512-4es8skTegTdnA6px2s97Zkv0k/Ra3+oaEHHx27wnt+HhDUu83Hl7YfiRZUTxE3XF+ClWgnpO6FYsw8QejKX5SQ==
3666+
simple-ascii-chart@^5.2.0:
3667+
version "5.2.0"
3668+
resolved "https://registry.yarnpkg.com/simple-ascii-chart/-/simple-ascii-chart-5.2.0.tgz#3f323d1023a076f7421536cd2c854e930fc3aa41"
3669+
integrity sha512-U7bAeTtg8EZ4Pf+6FIdHYmhlpupHTLBaHb29cDE5W3se4oCb/1POtKaHHyYYr8aTJvf4hlRq6ya0tFyvMnEzsQ==
36703670

36713671
sisteransi@^1.0.5:
36723672
version "1.0.5"

0 commit comments

Comments
 (0)