Skip to content

Commit 14614d3

Browse files
committed
ascii-cli-7: bump version
1 parent ee253df commit 14614d3

File tree

4 files changed

+44
-9
lines changed

4 files changed

+44
-9
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-ascii-chart-cli",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Simple ascii chart generator CLI",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -19,7 +19,7 @@
1919
},
2020
"devDependencies": {
2121
"@types/jest": "^29.5.14",
22-
"@types/node": "^22.8.0",
22+
"@types/node": "^22.8.1",
2323
"@typescript-eslint/eslint-plugin": "^8.11.0",
2424
"@typescript-eslint/parser": "^8.11.0",
2525
"eslint": "^9.13.0",
@@ -52,7 +52,7 @@
5252
"dist/**/*"
5353
],
5454
"dependencies": {
55-
"simple-ascii-chart": "^4.1.1",
55+
"simple-ascii-chart": "^4.2.0",
5656
"yargs": "^17.7.2"
5757
}
5858
}

src/cli.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ const { argv } = yargs
3737
type: 'boolean',
3838
description: 'Hide the x-axis if set to true',
3939
})
40+
.option('barChart', {
41+
type: 'boolean',
42+
description: 'Draw bar chart if set to true',
43+
})
44+
.option('horizontalBarChart', {
45+
type: 'boolean',
46+
description: 'Draw horizontal bar chart if set to true',
47+
})
4048
.option('hideYAxis', {
4149
type: 'boolean',
4250
description: 'Hide the y-axis if set to true',
@@ -143,6 +151,8 @@ const prepareParams = ({
143151
formatter,
144152
lineFormatter,
145153
symbols,
154+
barChart,
155+
horizontalBarChart,
146156
}: {
147157
input: string;
148158
options?: string;
@@ -163,6 +173,8 @@ const prepareParams = ({
163173
formatter?: string;
164174
lineFormatter?: string;
165175
symbols?: string;
176+
barChart?: boolean;
177+
horizontalBarChart?: boolean;
166178
}) => {
167179
const currentOptions = options ? JSON.parse(options) : {};
168180

@@ -178,6 +190,8 @@ const prepareParams = ({
178190
xLabel,
179191
yLabel,
180192
fillArea,
193+
barChart,
194+
horizontalBarChart,
181195
color: color ? validateColors(color) : undefined, // Ensure color matches Colors type
182196
axisCenter: validateAxisCenter(axisCenter), // Validate and format axisCenter
183197
yRange: validateYRange(yRange), // Validate and format yRange

src/tests/validators.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,21 @@ describe('Utility Functions Tests', () => {
9595
it('returns a valid LineFormatter function for correct string input', () => {
9696
const lineFormatterStr = '(args) => ({ x: args.x, y: args.y, symbol: "*" })';
9797
const lineFormatter = validateLineFormatter(lineFormatterStr);
98-
expect(lineFormatter!({ x: 1, y: 2, plotX: 1, plotY: 2, input: [], index: 0 })).toEqual({
98+
expect(
99+
lineFormatter!({
100+
x: 1,
101+
y: 2,
102+
plotX: 1,
103+
plotY: 2,
104+
input: [],
105+
index: 0,
106+
minX: 0,
107+
minY: 0,
108+
expansionX: [0, 0],
109+
expansionY: [0, 0],
110+
toPlotCoordinates: () => [0, 0],
111+
}),
112+
).toEqual({
99113
x: 1,
100114
y: 2,
101115
symbol: '*',

yarn.lock

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -721,13 +721,20 @@
721721
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
722722
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
723723

724-
"@types/node@*", "@types/node@^22.8.0":
724+
"@types/node@*":
725725
version "22.8.0"
726726
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.8.0.tgz#193c6f82f9356ce0e6bba86b59f2ffe06e7e320b"
727727
integrity sha512-84rafSBHC/z1i1E3p0cJwKA+CfYDNSXX9WSZBRopjIzLET8oNt6ht2tei4C7izwDeEiLLfdeSVBv1egOH916hg==
728728
dependencies:
729729
undici-types "~6.19.8"
730730

731+
"@types/node@^22.8.1":
732+
version "22.8.1"
733+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.8.1.tgz#b39d4b98165e2ae792ce213f610c7c6108ccfa16"
734+
integrity sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==
735+
dependencies:
736+
undici-types "~6.19.8"
737+
731738
"@types/stack-utils@^2.0.0":
732739
version "2.0.3"
733740
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8"
@@ -3127,10 +3134,10 @@ signal-exit@^3.0.3, signal-exit@^3.0.7:
31273134
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
31283135
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
31293136

3130-
simple-ascii-chart@^4.1.1:
3131-
version "4.1.1"
3132-
resolved "https://registry.yarnpkg.com/simple-ascii-chart/-/simple-ascii-chart-4.1.1.tgz#5a7074a6c7f8b13d3bb518f1af73880f8adf5042"
3133-
integrity sha512-uYJUYCpeyFG9chvLgb/MjJukB1BIJxI0hSe7DKF+5bw8iQ4okYaL0r82Mu+lFkh1CTkof2sl34P0nGRUPCfutg==
3137+
simple-ascii-chart@^4.2.0:
3138+
version "4.2.0"
3139+
resolved "https://registry.yarnpkg.com/simple-ascii-chart/-/simple-ascii-chart-4.2.0.tgz#390cfe00ec7bf8632dcd9140810999600adccfc3"
3140+
integrity sha512-xm/1W5Y2Ir+r1vgfYp3gAf8FjK3hYUveSowEJdQQdOkC4Uq1F8KexXXnAYXz5qrghhxx7lg8vuLPPGu1IJzxIA==
31343141

31353142
sisteransi@^1.0.5:
31363143
version "1.0.5"

0 commit comments

Comments
 (0)