gr-crystal
gr-crystal
Crystal binding for GR framework
A (still incomplete) interface to GR framework from Crystal
Installation
-
You need to install GR in the standard way and set the enviromental variable GRDIR point to the installed directory.
-
Add the dependency to your
shard.yml
:dependencies: grlib: github: jmakino/gr-crystal
-
Run
shards install
Getting started
At your project directory (where you ran shards install), try
crystal lib/grlib/examples/grsample.cr
should show a simple plot.
- GRDIR env variable should point to the directory where you placed gr files. In particular, lib and fonts directories should be there
- GKS_WSTYPE env variable should be set. For X11, its value should be "x11".
Usage
Essentially the same as that for C binging. Difference:
-
All size+pointer arguments to C array are replaced by Crystal arrays.
-
C char* is replaced by Crysral Sring
Example of API
void gr_polyline(int, double *, double *)
is called as
GR.polyline(Array(Float64), Array(Float64))
Examples
Todo
All source and documents should be generated automatically...
Repository
gr-crystal
Owner
Statistic
- 7
- 1
- 0
- 4
- 0
- about 2 years ago
- January 26, 2020
License
MIT License
Links
Synced at
Wed, 06 Nov 2024 11:52:47 GMT
Languages