ruby-gr 0.64.0.0 → 0.64.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/gr/ffi.rb +1 -1
- data/lib/gr.rb +26 -0
- data/lib/gr_commons/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4227a0ab868cbed63c7d88eaa5d74f95d319bf13aaaf27f6a69864aac452320
|
4
|
+
data.tar.gz: 6fd396df74a2192b5bdb3e2cb02105bd96d9436bbccfce5cca092cb41e9f1980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c50e7d93397d4349919810f0c954e8a63c1b3c7ac2cd8a861cb51e2a6efcb22543a99c7b6bde1023e04fc0e86f4b0a6b393b91d272006effe64075cbd9a34bb
|
7
|
+
data.tar.gz: 50ec885a694e5d4383638bf538cb792ea0d0d0c6120ccca2079d304fc81c7f0e07e7842fc5382c9607e740e4ff0c51553dc2409838170330d501d00c86c29165
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
|
28
28
|
GR.rb supports Ruby 2.5+.
|
29
29
|
|
30
|
-
First, [install GR](#gr-installation). Then install `gr-plot` gem.
|
30
|
+
First, [install GR](#gr-installation). Then install [`gr-plot`](https://github.com/red-data-tools/gr-plot) gem.
|
31
31
|
|
32
32
|
```sh
|
33
33
|
gem install gr-plot
|
@@ -60,9 +60,11 @@ GR.plot(x, y)
|
|
60
60
|
GR.savefig("figure.png")
|
61
61
|
```
|
62
62
|
|
63
|
+
GR.rb supports [Jupyter Notebook / Lab](../../wiki/Jupyter-Notebook).
|
64
|
+
|
63
65
|
## API Overview
|
64
66
|
|
65
|
-
#### GR::Plot - A simple, matlab-style API.
|
67
|
+
#### [GR::Plot - A simple, matlab-style API](https://github.com/red-data-tools/gr-plot)
|
66
68
|
|
67
69
|
```ruby
|
68
70
|
require 'gr/plot'
|
@@ -98,7 +100,7 @@ List of available functions.
|
|
98
100
|
See [GR.rb Wiki](https://github.com/red-data-tools/GR.rb/wiki) for details.
|
99
101
|
Some GR module methods are overwritten. Code has been moved to [gr-plot](https://github.com/red-data-tools/gr-plot).
|
100
102
|
|
101
|
-
#### GR - A module for calling native GR functions
|
103
|
+
#### GR - A module for calling native GR functions
|
102
104
|
|
103
105
|
2-D Plots and common 3-D Plots.
|
104
106
|
|
@@ -110,7 +112,7 @@ GR.setviewport(0.1, 0.9, 0.1, 0.9)
|
|
110
112
|
GR.setwindow(0.0, 20.0, 0.0, 20.0)
|
111
113
|
```
|
112
114
|
|
113
|
-
#### GR3 - A module for calling native GR3 functions
|
115
|
+
#### GR3 - A module for calling native GR3 functions
|
114
116
|
|
115
117
|
Complex 3D scenes.
|
116
118
|
|
data/lib/gr/ffi.rb
CHANGED
@@ -35,7 +35,7 @@ module GR
|
|
35
35
|
try_extern 'void gr_text(double, double, char *)'
|
36
36
|
try_extern 'void gr_textx(double, double, char *, int)'
|
37
37
|
try_extern 'void gr_inqtext(double, double, char *, double *, double *)'
|
38
|
-
try_extern 'gr_inqtextx(double, double, char *, int, double *, double *)'
|
38
|
+
try_extern 'void gr_inqtextx(double, double, char *, int, double *, double *)'
|
39
39
|
try_extern 'void gr_fillarea(int, double *, double *)'
|
40
40
|
try_extern 'void gr_cellarray(double, double, double, double, ' \
|
41
41
|
'int, int, int, int, int, int, int *)'
|
data/lib/gr.rb
CHANGED
@@ -268,12 +268,38 @@ module GR
|
|
268
268
|
#
|
269
269
|
# @!method text
|
270
270
|
|
271
|
+
# Draw a text at position `x`, `y` using the given options and current text
|
272
|
+
# attributes.
|
273
|
+
#
|
274
|
+
# @param x [Numeric] The X coordinate of the starting position of the text string
|
275
|
+
# @param y [Numeric] The Y coordinate of the starting position of the text string
|
276
|
+
# @param string [String] The text to be drawn
|
277
|
+
# @param opts [Integer] Bit mask including text options (GR_TEXT_USE_WC,
|
278
|
+
# GR_TEXT_ENABLE_INLINE_MATH)
|
279
|
+
#
|
280
|
+
# The values for `x` and `y` specify the text position. If the GR_TEXT_USE_WC
|
281
|
+
# option is set, they are interpreted as world cordinates, otherwise as
|
282
|
+
# normalized device coordinates. The string may contain new line characters
|
283
|
+
# and inline math expressions ($...$). The latter are only taken into account,
|
284
|
+
# if the GR_TEXT_ENABLE_INLINE_MATH option is set.
|
285
|
+
# The attributes that control the appearance of text are text font and
|
286
|
+
# precision, character expansion factor, character spacing, text color index,
|
287
|
+
# character height, character up vector, text path and text alignment.
|
288
|
+
#
|
289
|
+
# @!method textx
|
290
|
+
|
271
291
|
def inqtext(x, y, string)
|
272
292
|
inquiry [{ double: 4 }, { double: 4 }] do |tbx, tby|
|
273
293
|
super(x, y, string, tbx, tby)
|
274
294
|
end
|
275
295
|
end
|
276
296
|
|
297
|
+
def inqtextx(x, y, string, opts)
|
298
|
+
inquiry [{ double: 4 }, { double: 4 }] do |tbx, tby|
|
299
|
+
super(x, y, string, opts, tbx, tby)
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
277
303
|
# Allows you to specify a polygonal shape of an area to be filled.
|
278
304
|
#
|
279
305
|
# @param x [Array, NArray] A list containing the X coordinates
|
data/lib/gr_commons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-gr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.64.0.
|
4
|
+
version: 0.64.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fiddle
|