%global _empty_manifest_terminate_build 0 Name: python-asciichartpy Version: 1.5.25 Release: 1 Summary: Nice-looking lightweight console ASCII line charts ╭┈╯ with no dependencies License: MIT URL: https://github.com/kroitor/asciichart Source0: https://mirrors.nju.edu.cn/pypi/web/packages/41/3a/b01436be647f881515ec2f253616bf4a40c1d27d02a69e7f038e27fcdf81/asciichartpy-1.5.25.tar.gz BuildArch: noarch Requires: python3-setuptools Requires: python3-flake8 %description # asciichart [![npm](https://img.shields.io/npm/v/asciichart.svg)](https://npmjs.com/package/asciichart) [![PyPI](https://img.shields.io/pypi/v/asciichartpy.svg)](https://pypi.python.org/pypi/asciichartpy) [![Travis](https://travis-ci.org/kroitor/asciichart.svg?branch=master)](https://travis-ci.org/kroitor/asciichart) [![Coverage Status](https://coveralls.io/repos/github/kroitor/asciichart/badge.svg?branch=master)](https://coveralls.io/github/kroitor/asciichart?branch=master) [![license](https://img.shields.io/github/license/kroitor/asciichart.svg)](https://github.com/kroitor/asciichart/blob/master/LICENSE.txt) Console ASCII line charts in pure Javascript (for NodeJS and browsers) with no dependencies. This code is absolutely free for any usage, you just do whatever the fuck you want. Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ## Usage ### NodeJS ```sh npm install asciichart ``` ```javascript var asciichart = require ('asciichart') var s0 = new Array (120) for (var i = 0; i < s0.length; i++) s0[i] = 15 * Math.sin (i * ((Math.PI * 4) / s0.length)) console.log (asciichart.plot (s0)) ``` ### Browsers ```html asciichart ``` ### Options The width of the chart will always equal the length of data series. The height and range are determined automatically. ```javascript var s0 = new Array (120) for (var i = 0; i < s0.length; i++) s0[i] = 15 * Math.sin (i * ((Math.PI * 4) / s0.length)) console.log (asciichart.plot (s0)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) The output can be configured by passing a second parameter to the `plot (series, config)` function. The following options are supported: ```javascript var config = { offset: 3, // axis offset from the left (min 2) padding: ' ', // padding string for label formatting (can be overrided) height: 10, // any height you want // the label format function applies default padding format: function (x, i) { return (padding + x.toFixed (2)).slice (-padding.length) } } ``` ### Scale To Desired Height Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ```javascript var s = [] for (var i = 0; i < 120; i++) s[i] = 15 * Math.cos (i * ((Math.PI * 8) / 120)) // values range from -15 to +15 console.log (asciichart.plot (s, { height: 6 })) // this rescales the graph to ±3 lines ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Auto-range ```javascript var s2 = new Array (120) s2[0] = Math.round (Math.random () * 15) for (i = 1; i < s2.length; i++) s2[i] = s2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) console.log (asciichart.plot (s2)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Multiple Series ```javascript var s2 = new Array (120) s2[0] = Math.round (Math.random () * 15) for (i = 1; i < s2.length; i++) s2[i] = s2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var s3 = new Array (120) s3[0] = Math.round (Math.random () * 15) for (i = 1; i < s3.length; i++) s3[i] = s3[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) console.log (asciichart.plot ([ s2, s3 ])) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Colors ```javascript var arr1 = new Array (120) arr1[0] = Math.round (Math.random () * 15) for (i = 1; i < arr1.length; i++) arr1[i] = arr1[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr2 = new Array (120) arr2[0] = Math.round (Math.random () * 15) for (i = 1; i < arr2.length; i++) arr2[i] = arr2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr3 = new Array (120) arr3[0] = Math.round (Math.random () * 15) for (i = 1; i < arr3.length; i++) arr3[i] = arr3[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr4 = new Array (120) arr4[0] = Math.round (Math.random () * 15) for (i = 1; i < arr4.length; i++) arr4[i] = arr4[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var config = { colors: [ asciichart.blue, asciichart.green, asciichart.default, // default color undefined, // equivalent to default ] } console.log (asciichart.plot([ arr1, arr2, arr3, arr4 ], config)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### See Also A util by [madnight](https://github.com/madnight) for drawing Bitcoin/Ether/altcoin charts in command-line console: [bitcoin-chart-cli](https://github.com/madnight/bitcoin-chart-cli). ![bitcoin-chart-cli](https://camo.githubusercontent.com/494806efd925c4cd56d8370c1d4e8b751812030a/68747470733a2f2f692e696d6775722e636f6d2f635474467879362e706e67) ### Ports Special thx to all who helped port it to other languages, great stuff! - [Python port](https://pypi.org/project/asciichartpy) included! - Java: [ASCIIGraph](https://github.com/MitchTalmadge/ASCIIGraph), ported by [MitchTalmadge](https://github.com/MitchTalmadge). If you're a Java-person, check it out! - Go: [asciigraph](https://github.com/guptarohit/asciigraph), ported by [guptarohit](https://github.com/guptarohit), Go people! ) - Haskell: [asciichart](https://github.com/madnight/asciichart), ported by [madnight](https://github.com/madnight) to Haskell world! - Ruby: [ascii_chart](https://github.com/zhustec/ascii_chart), ported by [zhustec](https://github.com/zhustec)! - Elixir: [asciichart](https://github.com/sndnv/asciichart), ported by [sndv](https://github.com/sndnv)! - Perl: [App::AsciiChart](https://github.com/vti/app-asciichart), ported by [vti](https://github.com/vti)! - C: [plot](https://github.com/annacrombie/plot), ported by [annacrombie](https://github.com/annacrombie) with a ruby extension! - R: [asciichartr](https://github.com/blmayer/asciichartr), ported by [blmayer](https://github.com/blmayer)! - Rust: [rasciigraph](https://github.com/orhanbalci/rasciigraph), ported by [orhanbalci](https://github.com/orhanbalci)! - PHP: [PHP-colored-ascii-linechart](https://github.com/noximo/PHP-colored-ascii-linechart), ported by [noximo](https://github.com/noximo)! - C#: [asciichart-sharp](https://github.com/samcarton/asciichart-sharp), ported by [samcarton](https://github.com/samcarton)! ### Future work (coming soon, hopefully) - levels and points on the graph! - even better value formatting and auto-scaling! ![preview](https://user-images.githubusercontent.com/1294454/31798504-ca2af4cc-b53c-11e7-946c-620d744f6d16.gif) %package -n python3-asciichartpy Summary: Nice-looking lightweight console ASCII line charts ╭┈╯ with no dependencies Provides: python-asciichartpy BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-asciichartpy # asciichart [![npm](https://img.shields.io/npm/v/asciichart.svg)](https://npmjs.com/package/asciichart) [![PyPI](https://img.shields.io/pypi/v/asciichartpy.svg)](https://pypi.python.org/pypi/asciichartpy) [![Travis](https://travis-ci.org/kroitor/asciichart.svg?branch=master)](https://travis-ci.org/kroitor/asciichart) [![Coverage Status](https://coveralls.io/repos/github/kroitor/asciichart/badge.svg?branch=master)](https://coveralls.io/github/kroitor/asciichart?branch=master) [![license](https://img.shields.io/github/license/kroitor/asciichart.svg)](https://github.com/kroitor/asciichart/blob/master/LICENSE.txt) Console ASCII line charts in pure Javascript (for NodeJS and browsers) with no dependencies. This code is absolutely free for any usage, you just do whatever the fuck you want. Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ## Usage ### NodeJS ```sh npm install asciichart ``` ```javascript var asciichart = require ('asciichart') var s0 = new Array (120) for (var i = 0; i < s0.length; i++) s0[i] = 15 * Math.sin (i * ((Math.PI * 4) / s0.length)) console.log (asciichart.plot (s0)) ``` ### Browsers ```html asciichart ``` ### Options The width of the chart will always equal the length of data series. The height and range are determined automatically. ```javascript var s0 = new Array (120) for (var i = 0; i < s0.length; i++) s0[i] = 15 * Math.sin (i * ((Math.PI * 4) / s0.length)) console.log (asciichart.plot (s0)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) The output can be configured by passing a second parameter to the `plot (series, config)` function. The following options are supported: ```javascript var config = { offset: 3, // axis offset from the left (min 2) padding: ' ', // padding string for label formatting (can be overrided) height: 10, // any height you want // the label format function applies default padding format: function (x, i) { return (padding + x.toFixed (2)).slice (-padding.length) } } ``` ### Scale To Desired Height Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ```javascript var s = [] for (var i = 0; i < 120; i++) s[i] = 15 * Math.cos (i * ((Math.PI * 8) / 120)) // values range from -15 to +15 console.log (asciichart.plot (s, { height: 6 })) // this rescales the graph to ±3 lines ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Auto-range ```javascript var s2 = new Array (120) s2[0] = Math.round (Math.random () * 15) for (i = 1; i < s2.length; i++) s2[i] = s2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) console.log (asciichart.plot (s2)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Multiple Series ```javascript var s2 = new Array (120) s2[0] = Math.round (Math.random () * 15) for (i = 1; i < s2.length; i++) s2[i] = s2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var s3 = new Array (120) s3[0] = Math.round (Math.random () * 15) for (i = 1; i < s3.length; i++) s3[i] = s3[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) console.log (asciichart.plot ([ s2, s3 ])) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Colors ```javascript var arr1 = new Array (120) arr1[0] = Math.round (Math.random () * 15) for (i = 1; i < arr1.length; i++) arr1[i] = arr1[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr2 = new Array (120) arr2[0] = Math.round (Math.random () * 15) for (i = 1; i < arr2.length; i++) arr2[i] = arr2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr3 = new Array (120) arr3[0] = Math.round (Math.random () * 15) for (i = 1; i < arr3.length; i++) arr3[i] = arr3[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr4 = new Array (120) arr4[0] = Math.round (Math.random () * 15) for (i = 1; i < arr4.length; i++) arr4[i] = arr4[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var config = { colors: [ asciichart.blue, asciichart.green, asciichart.default, // default color undefined, // equivalent to default ] } console.log (asciichart.plot([ arr1, arr2, arr3, arr4 ], config)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### See Also A util by [madnight](https://github.com/madnight) for drawing Bitcoin/Ether/altcoin charts in command-line console: [bitcoin-chart-cli](https://github.com/madnight/bitcoin-chart-cli). ![bitcoin-chart-cli](https://camo.githubusercontent.com/494806efd925c4cd56d8370c1d4e8b751812030a/68747470733a2f2f692e696d6775722e636f6d2f635474467879362e706e67) ### Ports Special thx to all who helped port it to other languages, great stuff! - [Python port](https://pypi.org/project/asciichartpy) included! - Java: [ASCIIGraph](https://github.com/MitchTalmadge/ASCIIGraph), ported by [MitchTalmadge](https://github.com/MitchTalmadge). If you're a Java-person, check it out! - Go: [asciigraph](https://github.com/guptarohit/asciigraph), ported by [guptarohit](https://github.com/guptarohit), Go people! ) - Haskell: [asciichart](https://github.com/madnight/asciichart), ported by [madnight](https://github.com/madnight) to Haskell world! - Ruby: [ascii_chart](https://github.com/zhustec/ascii_chart), ported by [zhustec](https://github.com/zhustec)! - Elixir: [asciichart](https://github.com/sndnv/asciichart), ported by [sndv](https://github.com/sndnv)! - Perl: [App::AsciiChart](https://github.com/vti/app-asciichart), ported by [vti](https://github.com/vti)! - C: [plot](https://github.com/annacrombie/plot), ported by [annacrombie](https://github.com/annacrombie) with a ruby extension! - R: [asciichartr](https://github.com/blmayer/asciichartr), ported by [blmayer](https://github.com/blmayer)! - Rust: [rasciigraph](https://github.com/orhanbalci/rasciigraph), ported by [orhanbalci](https://github.com/orhanbalci)! - PHP: [PHP-colored-ascii-linechart](https://github.com/noximo/PHP-colored-ascii-linechart), ported by [noximo](https://github.com/noximo)! - C#: [asciichart-sharp](https://github.com/samcarton/asciichart-sharp), ported by [samcarton](https://github.com/samcarton)! ### Future work (coming soon, hopefully) - levels and points on the graph! - even better value formatting and auto-scaling! ![preview](https://user-images.githubusercontent.com/1294454/31798504-ca2af4cc-b53c-11e7-946c-620d744f6d16.gif) %package help Summary: Development documents and examples for asciichartpy Provides: python3-asciichartpy-doc %description help # asciichart [![npm](https://img.shields.io/npm/v/asciichart.svg)](https://npmjs.com/package/asciichart) [![PyPI](https://img.shields.io/pypi/v/asciichartpy.svg)](https://pypi.python.org/pypi/asciichartpy) [![Travis](https://travis-ci.org/kroitor/asciichart.svg?branch=master)](https://travis-ci.org/kroitor/asciichart) [![Coverage Status](https://coveralls.io/repos/github/kroitor/asciichart/badge.svg?branch=master)](https://coveralls.io/github/kroitor/asciichart?branch=master) [![license](https://img.shields.io/github/license/kroitor/asciichart.svg)](https://github.com/kroitor/asciichart/blob/master/LICENSE.txt) Console ASCII line charts in pure Javascript (for NodeJS and browsers) with no dependencies. This code is absolutely free for any usage, you just do whatever the fuck you want. Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ## Usage ### NodeJS ```sh npm install asciichart ``` ```javascript var asciichart = require ('asciichart') var s0 = new Array (120) for (var i = 0; i < s0.length; i++) s0[i] = 15 * Math.sin (i * ((Math.PI * 4) / s0.length)) console.log (asciichart.plot (s0)) ``` ### Browsers ```html asciichart ``` ### Options The width of the chart will always equal the length of data series. The height and range are determined automatically. ```javascript var s0 = new Array (120) for (var i = 0; i < s0.length; i++) s0[i] = 15 * Math.sin (i * ((Math.PI * 4) / s0.length)) console.log (asciichart.plot (s0)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) The output can be configured by passing a second parameter to the `plot (series, config)` function. The following options are supported: ```javascript var config = { offset: 3, // axis offset from the left (min 2) padding: ' ', // padding string for label formatting (can be overrided) height: 10, // any height you want // the label format function applies default padding format: function (x, i) { return (padding + x.toFixed (2)).slice (-padding.length) } } ``` ### Scale To Desired Height Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ```javascript var s = [] for (var i = 0; i < 120; i++) s[i] = 15 * Math.cos (i * ((Math.PI * 8) / 120)) // values range from -15 to +15 console.log (asciichart.plot (s, { height: 6 })) // this rescales the graph to ±3 lines ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Auto-range ```javascript var s2 = new Array (120) s2[0] = Math.round (Math.random () * 15) for (i = 1; i < s2.length; i++) s2[i] = s2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) console.log (asciichart.plot (s2)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Multiple Series ```javascript var s2 = new Array (120) s2[0] = Math.round (Math.random () * 15) for (i = 1; i < s2.length; i++) s2[i] = s2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var s3 = new Array (120) s3[0] = Math.round (Math.random () * 15) for (i = 1; i < s3.length; i++) s3[i] = s3[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) console.log (asciichart.plot ([ s2, s3 ])) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### Colors ```javascript var arr1 = new Array (120) arr1[0] = Math.round (Math.random () * 15) for (i = 1; i < arr1.length; i++) arr1[i] = arr1[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr2 = new Array (120) arr2[0] = Math.round (Math.random () * 15) for (i = 1; i < arr2.length; i++) arr2[i] = arr2[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr3 = new Array (120) arr3[0] = Math.round (Math.random () * 15) for (i = 1; i < arr3.length; i++) arr3[i] = arr3[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var arr4 = new Array (120) arr4[0] = Math.round (Math.random () * 15) for (i = 1; i < arr4.length; i++) arr4[i] = arr4[i - 1] + Math.round (Math.random () * (Math.random () > 0.5 ? 2 : -2)) var config = { colors: [ asciichart.blue, asciichart.green, asciichart.default, // default color undefined, // equivalent to default ] } console.log (asciichart.plot([ arr1, arr2, arr3, arr4 ], config)) ``` Console ASCII Line charts in pure Javascript (for NodeJS and browsers) ### See Also A util by [madnight](https://github.com/madnight) for drawing Bitcoin/Ether/altcoin charts in command-line console: [bitcoin-chart-cli](https://github.com/madnight/bitcoin-chart-cli). ![bitcoin-chart-cli](https://camo.githubusercontent.com/494806efd925c4cd56d8370c1d4e8b751812030a/68747470733a2f2f692e696d6775722e636f6d2f635474467879362e706e67) ### Ports Special thx to all who helped port it to other languages, great stuff! - [Python port](https://pypi.org/project/asciichartpy) included! - Java: [ASCIIGraph](https://github.com/MitchTalmadge/ASCIIGraph), ported by [MitchTalmadge](https://github.com/MitchTalmadge). If you're a Java-person, check it out! - Go: [asciigraph](https://github.com/guptarohit/asciigraph), ported by [guptarohit](https://github.com/guptarohit), Go people! ) - Haskell: [asciichart](https://github.com/madnight/asciichart), ported by [madnight](https://github.com/madnight) to Haskell world! - Ruby: [ascii_chart](https://github.com/zhustec/ascii_chart), ported by [zhustec](https://github.com/zhustec)! - Elixir: [asciichart](https://github.com/sndnv/asciichart), ported by [sndv](https://github.com/sndnv)! - Perl: [App::AsciiChart](https://github.com/vti/app-asciichart), ported by [vti](https://github.com/vti)! - C: [plot](https://github.com/annacrombie/plot), ported by [annacrombie](https://github.com/annacrombie) with a ruby extension! - R: [asciichartr](https://github.com/blmayer/asciichartr), ported by [blmayer](https://github.com/blmayer)! - Rust: [rasciigraph](https://github.com/orhanbalci/rasciigraph), ported by [orhanbalci](https://github.com/orhanbalci)! - PHP: [PHP-colored-ascii-linechart](https://github.com/noximo/PHP-colored-ascii-linechart), ported by [noximo](https://github.com/noximo)! - C#: [asciichart-sharp](https://github.com/samcarton/asciichart-sharp), ported by [samcarton](https://github.com/samcarton)! ### Future work (coming soon, hopefully) - levels and points on the graph! - even better value formatting and auto-scaling! ![preview](https://user-images.githubusercontent.com/1294454/31798504-ca2af4cc-b53c-11e7-946c-620d744f6d16.gif) %prep %autosetup -n asciichartpy-1.5.25 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-asciichartpy -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 1.5.25-1 - Package Spec generated