basis-processing 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README +9 -1
- data/basis.gemspec +1 -1
- data/lib/demo-rotated.rb +2 -2
- data/lib/screen.rb +5 -0
- metadata +3 -3
data/README
CHANGED
@@ -213,11 +213,19 @@ Additionally, starting with version 0.5.1, you will have to specify the environm
|
|
213
213
|
|
214
214
|
`export JRUBY_OPTS=--1.9`
|
215
215
|
|
216
|
+
## Renderer Compatibility
|
217
|
+
|
218
|
+
Basis has been tested with the Java2D and the Processing2D renderer. The OpenGL render mode needs some more work, because the cache behaves strangely in this mode.
|
219
|
+
|
216
220
|
## Notes on Interactivity
|
217
221
|
|
218
222
|
Experimental support exists for mouseover interactivity without (too much) extra effort on your part. To allow interactions to happen, you must specify ':track => true' while plotting a point, as in the line below:
|
219
223
|
|
220
|
-
|
224
|
+
@screen.plot(p, :track => true) do |original, mapped, s|
|
225
|
+
s.in_basis do
|
226
|
+
rect(original[:x], original[:y], 3, 3)
|
227
|
+
end
|
228
|
+
end
|
221
229
|
|
222
230
|
To actually enable interactivity, you must do a few things:
|
223
231
|
|
data/basis.gemspec
CHANGED
data/lib/demo-rotated.rb
CHANGED
@@ -19,7 +19,7 @@ class Demo < Processing::App
|
|
19
19
|
rect_mode(CENTER)
|
20
20
|
stroke(1,0,0)
|
21
21
|
fill(1,0,0)
|
22
|
-
rect(original[:x], original[:y],
|
22
|
+
rect(original[:x], original[:y], 6, 6)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -32,7 +32,7 @@ class Demo < Processing::App
|
|
32
32
|
y_range = ContinuousRange.new({:minimum => 0, :maximum => 300})
|
33
33
|
@basis = CoordinateSystem.new(Axis.new(@x_unit_vector,x_range), Axis.new(@y_unit_vector,y_range), self, [[1,0],[0,1]])
|
34
34
|
|
35
|
-
screen_transform = Transform.new({:x => 2, :y => -2}, {:x =>
|
35
|
+
screen_transform = Transform.new({:x => 2, :y => -2}, {:x => 600, :y => 1000})
|
36
36
|
@screen = Screen.new(screen_transform, self, @basis)
|
37
37
|
@screen.draw_axes(10,10)
|
38
38
|
stroke(1,1,0,1)
|
data/lib/screen.rb
CHANGED
@@ -39,6 +39,11 @@ class Screen
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def plot(point, options = {:bar => false, :track => false}, &block)
|
42
|
+
if (!point[:x] || !point[:y])
|
43
|
+
@artist.reset_matrix
|
44
|
+
block.call(point, self)
|
45
|
+
return
|
46
|
+
end
|
42
47
|
@points << point if options[:track]
|
43
48
|
@data << {:id => @points.count - 1, :point => [point[:x], point[:y]]}
|
44
49
|
p = transformed(point)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: basis-processing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-10-09 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: knnball
|
16
|
-
requirement: &
|
16
|
+
requirement: &21674420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.0.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *21674420
|
25
25
|
description: Basis provides a set of classes for easily plotting and transforming
|
26
26
|
arbitrary 2D coordinate systems by specifying their basis vectors in Ruby-Processing.
|
27
27
|
email: avishek.sen.gupta@gmail.com
|