27 Commits

Author SHA1 Message Date
Eriko Sugiyama (eririn)
92b6f73ca4 Merge 764fb977f3 into 1c80af2b2f 2025-07-11 20:32:01 +09:00
kojix2
1c80af2b2f Update sampo grafiikka URL
Some checks failed
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 2.6) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 2.7) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.0) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.1) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.2) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.3) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.4) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, head) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 2.6) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 2.7) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.0) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.1) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.2) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.3) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.4) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, head) (push) Has been cancelled
doc / build (push) Has been cancelled
2025-07-04 11:29:13 +09:00
kojix2
2d8cbba4c2 Update LICENSE.txt 2025-07-04 11:25:37 +09:00
kojix2
8a8a009b22 Removed FUNDING.yml 2025-07-04 11:21:50 +09:00
kojix2
1616d9c9a4 Add Ruby head version to CI matrix
Some checks failed
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 2.6) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 2.7) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.0) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.1) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.2) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.3) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.4) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, head) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 2.6) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 2.7) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.0) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.1) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.2) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.3) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.4) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, head) (push) Has been cancelled
doc / build (push) Has been cancelled
2025-05-28 10:26:50 +09:00
ericgpks
764fb977f3 fix: add condition for using steep and typeprof to pass CI with all Ruby versions
Some checks failed
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 2.6) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 2.7) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.0) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.1) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.2) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.3) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (macos, 3.4) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 2.6) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 2.7) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.0) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.1) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.2) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.3) (push) Has been cancelled
test / ${{ matrix.os }} Ruby ${{ matrix.ruby }} (ubuntu, 3.4) (push) Has been cancelled
2025-04-30 23:20:59 +09:00
ericgpks
448c1e9079 feat: add processing.rbs as a type definition file for processing.rb
As a first step toward adopting rbs for this project, added type a definition for a simple method.
More type definitions will be added incrementally.
2025-04-28 22:31:43 +09:00
ericgpks
674daa84eb feat: add Steepfile with the minimum configuration
This file indicates that type definition files are placed in the `sig` directory and the actual implementation files that I want to define types for are located in the `lib` directory.
Additionally, it is configured to disable type error checking so as not to raise much errors.
2025-04-28 22:11:31 +09:00
ericgpks
3e2ab1258b feat: add necessary gems to introduce rbs to this repository
To add types, I would like to have help from typeprof to define rbs files for current library code that's why I added both steep and typeprof to Gemfile.
2025-04-28 22:01:16 +09:00
kojix2
cd638f7ec1 Enable workflow_dispatch for test 2024-12-26 09:02:26 +09:00
kojix2
9aabd4a877 v0.4.6 2024-07-20 15:42:36 +09:00
kojix2
48f4af10c3 Add csv to gemspec
csv  is not part of the default gems since Ruby 3.4.0
2024-07-20 15:36:48 +09:00
kojix2
b0b03053af Add Ruby 3.4 to CI 2024-07-20 15:30:16 +09:00
kojix2
2a8c621be6 Update GitHub Actions versions in ci.yml and doc.yml 2024-07-20 15:29:02 +09:00
kojix2
4c45143edb Update README.md
Adjust the order of installation commands
2024-06-25 14:01:30 +09:00
Naser Aleisa
ef6794e32f docs: add nix command to installation 2024-06-25 13:58:23 +09:00
kojix2
7cad6753ca Remove Ruby 2.5 from GitHub Actions testing
CRuby < 2.6 does not support macos-arm64
2024-06-09 23:51:22 +09:00
Gabor Szarnyas
9b239cef89 Fix typo: baplot -> barplot 2024-06-09 23:45:48 +09:00
kojix2
6451ab40d4 Update FUNDING.yml 2024-02-10 09:27:42 +09:00
kojix2
575a780321 Added Ruby 3.3 to CI and removed 2.4 2023-12-26 14:42:00 +09:00
muxator
666df42e07 readme: fix typo for "-o" option (#47)
If you want to output to "standard input" -> "standard output"
2023-11-15 19:39:42 +09:00
kojix2
a2d04dafa3 Update README.md
How to install with Anaconda
2023-04-28 06:11:36 +09:00
kojix2
7d595d7ede Update README.md 2023-04-10 11:08:01 +09:00
kojix2
99bdbb06d1 Add examples that work offline to the README (#42)
Fix #41
Reported by @zhangwenda0518 Thanks!
2023-04-09 16:07:48 +09:00
gemmaro
60f9cb32dd Added Guix installation (#40)
Guix issue tracker: https://issues.guix.gnu.org/62161
2023-04-06 17:23:15 +09:00
TO226
1a3a80568d Fix a missing link 2023-02-26 11:28:47 +09:00
kojix2
3ee329908b Update README.md
YouPlot is available via homebrew
Reported by @zachvalenta (#33) Thanks!
2023-02-13 14:35:49 +09:00
11 changed files with 94 additions and 16 deletions

2
.github/FUNDING.yml vendored
View File

@@ -1,2 +0,0 @@
github: kojix2
ko_fi: kojix2

View File

@@ -1,15 +1,15 @@
name: test name: test
on: [push, pull_request] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
build: build:
name: ${{ matrix.os }} Ruby ${{ matrix.ruby }} name: ${{ matrix.os }} Ruby ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}-latest runs-on: ${{ matrix.os }}-latest
strategy: strategy:
matrix: matrix:
os: [ 'ubuntu', 'macos' ] os: ["ubuntu", "macos"]
ruby: [ '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2' ] ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "head"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
with: with:
ruby-version: ${{ matrix.ruby }} ruby-version: ${{ matrix.ruby }}

View File

@@ -10,14 +10,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
with: with:
ruby-version: ruby ruby-version: ruby
- name: Generate document - name: Generate document
run: gem install -N yard && yard doc run: gem install -N yard && yard doc
- name: Publish Documentation on GitHub Pages - name: Publish Documentation on GitHub Pages
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v4
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc publish_dir: ./doc

View File

@@ -5,6 +5,13 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in youplot.gemspec # Specify your gem's dependencies in youplot.gemspec
gemspec gemspec
group :development do
if RUBY_VERSION >= '3.0'
gem 'steep', require: false
gem 'typeprof'
end
end
group :test do group :test do
gem 'rake' gem 'rake'
gem 'simplecov' gem 'simplecov'

View File

@@ -1,6 +1,7 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2020 kojix2 Copyright (c) 2020 kojix2
Copyright (c) 2025 Red Data Tools
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,7 +1,7 @@
<div align="center"> <div align="center">
<img src="logo.svg"> <img src="logo.svg">
<hr> <hr>
<img alt="Build Status" src="https://github.com/red-data-tools/YouPlot/workflows/test/badge.svg"> <a href="https://github.com/red-data-tools/YouPlot/actions/workflows/ci.yml"><img alt="Build Status" src="https://github.com/red-data-tools/YouPlot/workflows/test/badge.svg"></a>
<a href="https://rubygems.org/gems/youplot/"><img alt="Gem Version" src="https://badge.fury.io/rb/youplot.svg"></a> <a href="https://rubygems.org/gems/youplot/"><img alt="Gem Version" src="https://badge.fury.io/rb/youplot.svg"></a>
<a href="https://zenodo.org/badge/latestdoi/283230219"><img alt="DOI" src="https://zenodo.org/badge/283230219.svg"></a> <a href="https://zenodo.org/badge/latestdoi/283230219"><img alt="DOI" src="https://zenodo.org/badge/283230219.svg"></a>
<a href="https://rubydoc.info/gems/youplot/"><img alt="Docs Stable" src="https://img.shields.io/badge/docs-stable-blue.svg"></a> <a href="https://rubydoc.info/gems/youplot/"><img alt="Docs Stable" src="https://img.shields.io/badge/docs-stable-blue.svg"></a>
@@ -15,6 +15,24 @@
## Installation ## Installation
``` ```
brew install youplot
```
```
gem install youplot
```
```
nix shell nixpkgs#youplot
```
```
guix install youplot
```
```
conda install -c conda-forge ruby
conda install -c conda-forge compilers
gem install youplot gem install youplot
``` ```
@@ -37,13 +55,20 @@ curl -sL https://git.io/ISLANDScsv \
<img alt="barplot" src="https://user-images.githubusercontent.com/5798442/101999903-d36a2d00-3d24-11eb-9361-b89116f44122.png"> <img alt="barplot" src="https://user-images.githubusercontent.com/5798442/101999903-d36a2d00-3d24-11eb-9361-b89116f44122.png">
</p> </p>
```sh
# For offline user: Sorts files in a directory by size and shows a bar graph.
ls -l | awk '{print $9, $5}' | sort -nk 2 | uplot bar -d ' '
```
### histogram ### histogram
```sh ```sh
echo -e "from numpy import random;" \ echo -e "from numpy import random;" \
"n = random.randn(10000);" \ "n = random.randn(10000);" \
"print('\\\n'.join(str(i) for i in n))" \ "print('\\\n'.join(str(i) for i in n))" \
| python \ | python3 \
| uplot hist --nbins 20 | uplot hist --nbins 20
``` ```
@@ -63,6 +88,14 @@ curl -sL https://git.io/AirPassengers \
<img alt="lineplot" src="https://user-images.githubusercontent.com/5798442/101999825-24c5ec80-3d24-11eb-99f4-c642e8d221bc.png"> <img alt="lineplot" src="https://user-images.githubusercontent.com/5798442/101999825-24c5ec80-3d24-11eb-99f4-c642e8d221bc.png">
</p> </p>
```sh
# For offline users: Calculates sin values (0-2*pi) and plots a sine wave.
python3 -c '
from math import sin, pi
data = "\n".join(f"{i*pi/50}\t{sin(i*pi/50)}" for i in range(101))
print(data)' | uplot line
```
### scatter ### scatter
```sh ```sh
@@ -75,6 +108,12 @@ curl -sL https://git.io/IRIStsv \
<img alt="scatter" src="https://user-images.githubusercontent.com/5798442/101999827-27284680-3d24-11eb-9903-551857eaa69c.png"> <img alt="scatter" src="https://user-images.githubusercontent.com/5798442/101999827-27284680-3d24-11eb-9903-551857eaa69c.png">
</p> </p>
```sh
# For offline users
cat test/fixtures/iris.csv | cut -f1-4 -d, | uplot scatter -H -d, -t IRIS
```
### density ### density
```sh ```sh
@@ -87,6 +126,11 @@ curl -sL https://git.io/IRIStsv \
<img alt="density" src="https://user-images.githubusercontent.com/5798442/101999828-2abbcd80-3d24-11eb-902c-2f44266fa6ae.png"> <img alt="density" src="https://user-images.githubusercontent.com/5798442/101999828-2abbcd80-3d24-11eb-902c-2f44266fa6ae.png">
</p> </p>
```sh
# For offline users
cat test/fixtures/iris.csv | cut -f1-4 -d, | uplot density -H -d, -t IRIS
```
### boxplot ### boxplot
```sh ```sh
@@ -99,8 +143,21 @@ curl -sL https://git.io/IRIStsv \
<img alt="boxplot" src="https://user-images.githubusercontent.com/5798442/101999830-2e4f5480-3d24-11eb-8891-728c18bf5b35.png"> <img alt="boxplot" src="https://user-images.githubusercontent.com/5798442/101999830-2e4f5480-3d24-11eb-8891-728c18bf5b35.png">
</p> </p>
```sh
# For offline users
cat test/fixtures/iris.csv | cut -f1-4 -d, | uplot boxplot -H -d, -t IRIS
```
### count ### count
Count processes by user ID.
```sh
ps aux | awk '{print $1}' | uplot count
```
Count the number of chromosomes where genes are located.
```sh ```sh
cat gencode.v35.annotation.gff3 \ cat gencode.v35.annotation.gff3 \
| grep -v '#' | grep 'gene' | cut -f1 \ | grep -v '#' | grep 'gene' | cut -f1 \
@@ -111,7 +168,6 @@ cat gencode.v35.annotation.gff3 \
<img alt="count" src="https://user-images.githubusercontent.com/5798442/101999832-30b1ae80-3d24-11eb-96fe-e5000bed1f5c.png"> <img alt="count" src="https://user-images.githubusercontent.com/5798442/101999832-30b1ae80-3d24-11eb-96fe-e5000bed1f5c.png">
</p> </p>
In this example, YouPlot counts the number of chromosomes where genes are located.
* [GENCODE - Human Release](https://www.gencodegenes.org/human/) * [GENCODE - Human Release](https://www.gencodegenes.org/human/)
Note: `count` is not very fast because it runs in a Ruby script. Note: `count` is not very fast because it runs in a Ruby script.
@@ -157,7 +213,7 @@ The following sub-commands are available.
* `-o` * `-o`
* By default, the plot is output to **standard error output**. * By default, the plot is output to **standard error output**.
* If you want to output to standard input, Use hyphen ` -o -` or no argument `uplot s -o | `. * If you want to output to standard output, Use hyphen ` -o -` or no argument `uplot s -o | `.
### Output the input data ### Output the input data
@@ -255,7 +311,7 @@ bundle exec exe/uplot # Run youplot (Try out the edited code)
### Acknowledgements ### Acknowledgements
* [sampo grafiikka](https://jypg.net/sampo_grafiikka) - Project logo creation * [sampo grafiikka](https://lepo.sampo-grafiikka.com/) - Project logo creation
* [yutaas](https://github.com/yutaas) - English proofreading * [yutaas](https://github.com/yutaas) - English proofreading
## License ## License

8
Steepfile Normal file
View File

@@ -0,0 +1,8 @@
D = Steep::Diagnostic
target :lib do
signature "sig"
check "lib" # Directory name to check
configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting
end

View File

@@ -189,7 +189,7 @@ module YouPlot
scatter s draw a scatter plot scatter s draw a scatter plot
density d draw a density plot density d draw a density plot
boxplot box draw a horizontal boxplot boxplot box draw a horizontal boxplot
count c draw a baplot based on the number of count c draw a barplot based on the number of
occurrences (slow) occurrences (slow)
colors color show the list of available colors colors color show the list of available colors

View File

@@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module YouPlot module YouPlot
VERSION = '0.4.5' VERSION = '0.4.6'
end end

View File

@@ -0,0 +1,7 @@
module YouPlot
module Backends
module Processing
def count_values: ([], ?tally: true, ?reverse: false) -> Array[Array[untyped]]
end
end
end

View File

@@ -12,12 +12,13 @@ Gem::Specification.new do |spec|
spec.description = 'A command line tool for Unicode Plotting' spec.description = 'A command line tool for Unicode Plotting'
spec.homepage = 'https://github.com/red-data-tools/YouPlot' spec.homepage = 'https://github.com/red-data-tools/YouPlot'
spec.license = 'MIT' spec.license = 'MIT'
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0') spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
spec.files = Dir['*.{md,txt}', '{lib,exe}/**/*'] spec.files = Dir['*.{md,txt}', '{lib,exe}/**/*']
spec.bindir = 'exe' spec.bindir = 'exe'
spec.executables = %w[uplot youplot] spec.executables = %w[uplot youplot]
spec.require_paths = ['lib'] spec.require_paths = ['lib']
spec.add_dependency 'csv'
spec.add_dependency 'unicode_plot', '>= 0.0.5' spec.add_dependency 'unicode_plot', '>= 0.0.5'
end end