Skip to content

Commit cc2c501

Browse files
committed
Update README.md
1 parent fc00115 commit cc2c501

1 file changed

Lines changed: 47 additions & 7 deletions

File tree

README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,29 @@
33
[![Test](https://github.com/kojix2/unicode_plot/actions/workflows/test.yml/badge.svg)](https://github.com/kojix2/unicode_plot/actions/workflows/test.yml)
44
[![Lines of Code](https://img.shields.io/endpoint?url=https%3A%2F%2Ftokei.kojix2.net%2Fbadge%2Fgithub%2Fkojix2%2Funicode_plot%2Flines)](https://tokei.kojix2.net/github/kojix2/unicode_plot)
55

6-
Unicode terminal plots for Crystal — a port of Julia's [UnicodePlots.jl](https://github.com/JuliaPlots/UnicodePlots.jl).
6+
Unicode terminal plots for Crystal, ported from Julia's [UnicodePlots.jl](https://github.com/JuliaPlots/UnicodePlots.jl).
77

8-
The code was ported from Julia using an AI tool
8+
🚧 **UNDER CONSTRUCTION** 🚧
99

10-
🚧 **UNDER CONSTRUCTION** 🚧 Until the first version is released, this repository will be updated by force push.
10+
- Before the first release, history may be rewritten (force-push).
11+
- API and behavior are still being aligned with UnicodePlots.jl.
12+
13+
## Current coverage
14+
15+
Implemented plot interfaces:
16+
17+
- `lineplot`, `lineplot!`
18+
- `scatterplot`, `scatterplot!`
19+
- `barplot`
20+
- `histogram`
21+
- `boxplot`
22+
- `densityplot`, `densityplot!`
23+
- `heatmap`
24+
- `spy`
25+
- `polarplot`, `polarplot!`
26+
- `stairs`, `stairs!`
27+
28+
See [examples/](examples/) for runnable scripts.
1129

1230
## Installation
1331

@@ -21,7 +39,7 @@ dependencies:
2139
2240
Then run `shards install`.
2341

24-
## Usage
42+
## Quick start
2543

2644
```crystal
2745
require "unicode_plot"
@@ -50,6 +68,14 @@ scatterplot!(p, x2, y2, name: "cluster B", color: :red)
5068
puts p
5169
```
5270

71+
### Polar plot
72+
73+
```crystal
74+
theta = (0...40).map { |i| 4.0 * Math::PI * i.to_f64 / 39.0 }
75+
r = theta.map { |angle| angle / (2.0 * Math::PI) }
76+
puts polarplot(theta, r, title: "Polar line", color: :green)
77+
```
78+
5379
### Bar plot
5480

5581
```crystal
@@ -71,9 +97,9 @@ data = (1..500).map { Random.rand * 10.0 }
7197
puts histogram(data, title: "Uniform [0, 10)", nbins: 15)
7298
```
7399

74-
### Multiple series / incremental plots
100+
### Add series incrementally (`!` variants)
75101

76-
All plot types support a mutating `!` variant for adding series to an existing plot:
102+
Most series-based plot types support a mutating `!` variant:
77103

78104
```crystal
79105
x = (1..20).map(&.to_f)
@@ -95,7 +121,21 @@ puts p
95121
| `width` / `height` | Canvas size in characters |
96122
| `canvas` | Canvas type (`:braille`, `:block`, `:ascii`) |
97123

98-
See `examples/` for runnable demos.
124+
## Practical notes
125+
126+
- This project prioritizes Julia compatibility in visible output.
127+
- Some interfaces may still differ while ports are in progress.
128+
- `spec/reference_spec.cr` compares output against Julia reference assets.
129+
130+
## Development
131+
132+
Run specs from repository root:
133+
134+
```bash
135+
crystal spec
136+
```
137+
138+
Reference fixtures are stored under [spec/fixtures/](spec/fixtures/).
99139

100140
## License
101141

0 commit comments

Comments
 (0)