Skip to content

Commit 61c0b05

Browse files
committed
updated the project description
1 parent f5a7627 commit 61c0b05

7 files changed

Lines changed: 66 additions & 3 deletions

File tree

README.md

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,77 @@
11
ruby4knime
22
==========
33

4-
Ruby scripting extension for [Knime](http://knime.org)
4+
## Intro
5+
Ruby scripting extension for [KNIME](http://knime.org)
56

67
This is preliminary support of Ruby scripting language for Knime.
78

8-
Now realized Source (Ruby Generator) and Manipulator (Ruby Script) node types.
9+
Now realized following node types:
910
* Ruby Generator allows to generate any string or numeric data. Or process any external sources using Ruby.
10-
* Ruby Script allows to process input DataTable into output.
11+
* Ruby Script allows to process input DataTable into output DataTable.
12+
* Ruby Script 2x2 allows to process 2 input DataTable into 2 output DataTable.
13+
* Ruby Snippet allows to process input DataTable into output DataTable by writing code only for one row processing.
1114

1215
See [Ruby wrapper](RubyScript/rb/README.rdoc)
1316

1417
[Download binary](https://drive.google.com/folderview?id=0Bwx0cbtdU5K6TklLRG90cm5HbFk)
18+
19+
## Sample workflow
20+
[Download sample workflow](samples/KNIME_Ruby_Test.zip)
21+
22+
This is simple workflow for ruby4knime testing only. It includes all realized node types.
23+
![Ruby test workflow](docs/pics/workflow.png)
24+
25+
Now some details.
26+
27+
Node 1 contains the following code:
28+
1000.times do |i|
29+
x = i * 0.1 / Math::PI
30+
$outContainer << Cells.new.double(x).double(Math.sin(x)).double(Math.sin(x + Math::PI/3))
31+
end
32+
33+
Node 2 contains the following code:
34+
$outContainer.rowKey = 100000 # generate table keys from this number
35+
1000.times do |i|
36+
x = i * 0.1 / Math::PI
37+
$outContainer << Cells.new.double(x).double(Math.cos(x)).double(Math.cos(0.3*x))
38+
end
39+
40+
Node 3 contains the following code:
41+
$inData0.each do |row|
42+
$outContainer << (row << Cells.new.double(row[1].to_f-row[2].to_f))
43+
end
44+
45+
46+
Node 4 contains the following code:
47+
$inData0.each do |row|
48+
$outContainer0 << row
49+
end
50+
$inData1.each do |row|
51+
$outContainer1 << row
52+
end
53+
54+
Node 6 contains the following code:
55+
Cells.new.
56+
double(row[1].to_f).
57+
double(row[2].to_f - row[4].to_f)
58+
59+
60+
Joiner (Node 5) generates following data:
61+
![joiner node 5](docs/pics/joiner.png)
62+
63+
We can control results by line plots.
64+
65+
Fragment of Line Plot (Node 10)
66+
![line plot 10](docs/pics/output_10.png)
67+
68+
Fragment of Line Plot (Node 11)
69+
![line plot 11](docs/pics/output_11.png)
70+
71+
Fragment of Line Plot (Node 12)
72+
![line plot 12](docs/pics/output_12.png)
73+
74+
Fragment of Line Plot (Node 13)
75+
![line plot 13](docs/pics/output_13.png)
76+
77+
You can combine these Ruby nodes in any combination with other KNIME nodes.

doc/pics/joiner.png

16.7 KB
Loading

doc/pics/output_10.png

5.71 KB
Loading

doc/pics/output_11.png

5.24 KB
Loading

doc/pics/output_12.png

5.03 KB
Loading

doc/pics/output_13.png

8.05 KB
Loading

doc/pics/workflow.png

23.5 KB
Loading

0 commit comments

Comments
 (0)