@@ -20,58 +20,66 @@ See [Ruby wrapper](RubyScript/rb/README.rdoc)
2020[ Download sample workflow] ( samples/KNIME_Ruby_Test.zip )
2121
2222This is simple workflow for ruby4knime testing only. It includes all realized node types.
23- ![ Ruby test workflow] ( docs /pics/workflow.png)
23+ ![ Ruby test workflow] ( doc /pics/workflow.png)
2424
2525Now some details.
2626
2727Node 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
28+ ``` ruby
29+ 1000 .times do |i |
30+ x = i * 0.1 / Math ::PI
31+ $outContainer << Cells .new .double(x).double(Math .sin(x)).double(Math .sin(x + Math ::PI / 3 ))
32+ end
33+ ```
3234
3335Node 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
36+ ``` ruby
37+ $outContainer .rowKey = 100000 # generate table keys from this number
38+ 1000 .times do |i |
39+ x = i * 0.1 / Math ::PI
40+ $outContainer << Cells .new .double(x).double(Math .cos(x)).double(Math .cos(0.3 * x))
41+ end
42+ ```
3943
4044Node 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+ ``` ruby
46+ $inData0 .each do |row |
47+ $outContainer << (row << Cells .new .double(row[1 ].to_f- row[2 ].to_f))
48+ end
49+ ```
4550
4651Node 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
52+ ``` ruby
53+ $inData0 .each do |row |
54+ $outContainer0 << row
55+ end
56+ $inData1 .each do |row |
57+ $outContainer1 << row
58+ end
59+ ```
5360
5461Node 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-
62+ ``` ruby
63+ Cells .new .
64+ double(row[1 ].to_f).
65+ double(row[2 ].to_f - row[4 ].to_f)
66+ ```
5967
6068Joiner (Node 5) generates following data:
61- ![ joiner node 5] ( docs /pics/joiner.png)
69+ ![ joiner node 5] ( doc /pics/joiner.png)
6270
6371We can control results by line plots.
6472
6573Fragment of Line Plot (Node 10)
66- ![ line plot 10] ( docs /pics/output_10.png)
74+ ![ line plot 10] ( doc /pics/output_10.png)
6775
6876Fragment of Line Plot (Node 11)
69- ![ line plot 11] ( docs /pics/output_11.png)
77+ ![ line plot 11] ( doc /pics/output_11.png)
7078
7179Fragment of Line Plot (Node 12)
72- ![ line plot 12] ( docs /pics/output_12.png)
80+ ![ line plot 12] ( doc /pics/output_12.png)
7381
7482Fragment of Line Plot (Node 13)
75- ![ line plot 13] ( docs /pics/output_13.png)
83+ ![ line plot 13] ( doc /pics/output_13.png)
7684
7785You can combine these Ruby nodes in any combination with other KNIME nodes.
0 commit comments