atome 0.5.7.3.6 → 0.5.7.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -1
  3. data/documentation/deep learning/architecture.txt +4 -4
  4. data/documentation/deep learning/basic_infos.txt +2 -2
  5. data/documentation/deep learning/example_of_users_code.rb +43 -43
  6. data/documentation/installation/buiding_atome.md +2 -2
  7. data/lib/atome/atome.rb +24 -56
  8. data/lib/atome/extensions/atome.rb +31 -77
  9. data/lib/atome/extensions/sha.rb +7 -7
  10. data/lib/atome/genesis/atomes.rb +1 -1
  11. data/lib/atome/genesis/genesis.rb +6 -95
  12. data/lib/atome/genesis/particles/communication.rb +1 -1
  13. data/lib/atome/genesis/particles/event.rb +0 -8
  14. data/lib/atome/genesis/particles/geometry.rb +3 -4
  15. data/lib/atome/genesis/particles/hierarchy.rb +28 -27
  16. data/lib/atome/genesis/particles/identity.rb +0 -30
  17. data/lib/atome/genesis/particles/material.rb +13 -12
  18. data/lib/atome/genesis/particles/property.rb +41 -16
  19. data/lib/atome/genesis/particles/security.rb +0 -45
  20. data/lib/atome/genesis/particles/utility.rb +77 -137
  21. data/lib/atome/genesis/sparkle.rb +3 -12
  22. data/lib/atome/kernel/black_matter.rb +2 -0
  23. data/lib/atome/kernel/universe.rb +5 -45
  24. data/lib/atome/presets/atome.rb +0 -22
  25. data/lib/atome/utilities/utilities.rb +19 -8
  26. data/lib/atome/version.rb +2 -1
  27. data/lib/molecules/init.rb +0 -14
  28. data/lib/molecules/intuition/tools.rb +24 -43
  29. data/lib/molecules/intuition/utilities.rb +261 -135
  30. data/lib/platform_specific/opal/atome_opal_extensions.rb +0 -1
  31. data/lib/platform_specific/opal/extensions/color.rb +0 -5
  32. data/lib/platform_specific/opal/extensions/geolocation.rb +5 -5
  33. data/lib/platform_specific/opal/extensions/object.rb +1 -1
  34. data/lib/platform_specific/opal/extensions/ping.rb +11 -20
  35. data/lib/renderers/html/effect.rb +0 -11
  36. data/lib/renderers/html/event.rb +0 -7
  37. data/lib/renderers/html/geometry.rb +0 -31
  38. data/lib/renderers/html/html.rb +32 -128
  39. data/lib/renderers/html/material.rb +0 -22
  40. data/lib/renderers/html/spatial.rb +0 -9
  41. data/lib/renderers/html/utility.rb +5 -8
  42. data/lib/renderers/renderer.rb +0 -1
  43. data/vendor/assets/application/examples/account.rb +35 -0
  44. data/vendor/assets/application/examples/actor&role.rb +23 -0
  45. data/vendor/assets/application/examples/animation.rb +1 -1
  46. data/vendor/assets/application/examples/applications.rb +26 -77
  47. data/vendor/assets/application/examples/atome.rb +1 -1
  48. data/vendor/assets/application/examples/attach.rb +7 -7
  49. data/vendor/assets/application/examples/attached.rb +13 -15
  50. data/vendor/assets/application/examples/basic_understanding.rb +1 -1
  51. data/vendor/assets/application/examples/buttons.rb +48 -0
  52. data/vendor/assets/application/examples/clear.rb +12 -12
  53. data/vendor/assets/application/examples/clones&monitoring.rb +1 -1
  54. data/vendor/assets/application/examples/delete.rb +19 -14
  55. data/vendor/assets/application/examples/detach.rb +8 -0
  56. data/vendor/assets/application/examples/dig.rb +1 -1
  57. data/vendor/assets/application/examples/display.rb +6 -6
  58. data/vendor/assets/application/examples/drag.rb +1 -1
  59. data/vendor/assets/application/examples/duplicate.rb +6 -6
  60. data/vendor/assets/application/examples/exchange.rb +17 -0
  61. data/vendor/assets/application/examples/generator_and_build.rb +3 -3
  62. data/vendor/assets/application/examples/hierarchy.rb +5 -5
  63. data/vendor/assets/application/examples/layout.rb +1 -1
  64. data/vendor/assets/application/examples/preset.rb +3 -3
  65. data/vendor/assets/application/examples/selected.rb +1 -1
  66. data/vendor/assets/application/examples/shapes.rb +1 -1
  67. data/vendor/assets/application/examples/size.rb +1 -1
  68. data/vendor/assets/application/examples/test.rb +0 -320
  69. data/vendor/assets/application/examples/tools.rb +136 -192
  70. data/vendor/assets/application/examples/unfasten.rb +23 -0
  71. data/vendor/assets/application/index.rb +1 -1
  72. data/vendor/assets/server/atome_server.rb +1 -0
  73. data/vendor/assets/server/capture.rb +0 -1
  74. data/vendor/assets/server/database.rb +0 -1
  75. data/vendor/assets/server/eDen.rb +16 -94
  76. data/vendor/assets/src/index_server_wasm.html +1 -0
  77. data/vendor/assets/src/index_wasm.html +0 -6
  78. data/vendor/assets/src/js/atome/specific/wasm.js +22 -4
  79. data/vendor/assets/src/js/third_parties/three.min.js +1 -1
  80. data/vendor/assets/src/medias/fonts/Roboto/LICENSE.txt +1 -1
  81. data/vendor/assets/src/medias/fonts/Roboto_Slab/LICENSE.txt +1 -1
  82. metadata +8 -6
  83. data/lib/molecules/_deprecated_examples/site.rb +0 -34
  84. data/lib/molecules/intuition/_deprecated_inputs.rb +0 -111
  85. data/lib/molecules/intuition/_deprecated_toolbox.rb +0 -282
  86. data/lib/platform_specific/opal/extensions/sha.rb +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdac6b85c37bdf4d8e6842a2b423912931a8d33dd693aa03dd90d46a8c91e16f
4
- data.tar.gz: d52b45f795e5c583a548a29a6d979ffc4fd6671907070c1b28f0234351a83131
3
+ metadata.gz: 6c766c7eb85bcd7a3de7dda8058e641e6353e4be8f0813326c4626affd3254e1
4
+ data.tar.gz: '079339808511cf96b9e393897a9c58e35d7b4ad964916f8392dc9e636fa65b52'
5
5
  SHA512:
6
- metadata.gz: 276797c37915a64902cd3491ec29111aa17364e7aa87b7eeff16f3c7901428a9cd5f94117c459e5e9f11acfd7d39ccccbd5e8aea0baa8f96f57ec3f930710b8f
7
- data.tar.gz: 88e5562ae2ad330ae11c895e905296c56498f09868c0b881242b17d2c268c9aadd915e35b804610d54a9f3d68c3c6091d21483e3aff52f21186496ba6825b6e5
6
+ metadata.gz: 778782a81a4f6b55e11afd04e0d4c16506156eda4861a3bb615c326ce1b4d0949229b9740afbc31c291a77de97957e084b516dd3cd560c42ada9e3f6e25bcaea
7
+ data.tar.gz: 34f16f5b2446434aedc38490ad0726d9170d8d191109e6e2671f05ff88e5269005657b849190aa88c926a1fd1ce1952626cc3fd5e7e4c5657cede5d0e897a670
data/CHANGELOG.md CHANGED
@@ -15,7 +15,7 @@ vector now use class instead of a local style
15
15
  ## [0.5.4.1.7] - 2023-05-25
16
16
 
17
17
  remove "shape :pre" and move the condition when using :definition to atome_common , because of a bug that remove all
18
- attached atome
18
+ fasten atome
19
19
 
20
20
  ## [0.5.4.1.8] - 2023-05-25
21
21
  Ready to add gradient color now systematically use a variable for each component( Red, green , blue , alpha)
@@ -344,7 +344,7 @@ This is a detailed view of the file tree of the Atome framework:
344
344
  │ │ │ ├── animation.rb
345
345
  │ │ │ ├── atome_new.rb
346
346
  │ │ │ ├── attach.rb
347
- │ │ │ ├── attached.rb
347
+ │ │ │ ├── fasten.rb
348
348
  │ │ │ ├── auto_height.rb
349
349
  │ │ │ ├── auto_width.rb
350
350
  │ │ │ ├── batch.rb
@@ -507,7 +507,7 @@ This is a detailed view of the file tree of the Atome framework:
507
507
  │ │ │ ├── animation.rb
508
508
  │ │ │ ├── atome.rb
509
509
  │ │ │ ├── attach.rb
510
- │ │ │ ├── attached.rb
510
+ │ │ │ ├── fasten.rb
511
511
  │ │ │ ├── basic_understanding.rb
512
512
  │ │ │ ├── browse.rb
513
513
  │ │ │ ├── callback.rb
@@ -3453,7 +3453,7 @@ This is a detailed view of the file tree of the Atome framework:
3453
3453
  │ │ │ ├── animation.rb
3454
3454
  │ │ │ ├── atome.rb
3455
3455
  │ │ │ ├── attach.rb
3456
- │ │ │ ├── attached.rb
3456
+ │ │ │ ├── fasten.rb
3457
3457
  │ │ │ ├── browse.rb
3458
3458
  │ │ │ ├── callback.rb
3459
3459
  │ │ │ ├── clear.rb
@@ -3532,7 +3532,7 @@ This is a detailed view of the file tree of the Atome framework:
3532
3532
  │ │ ├── animation.rb
3533
3533
  │ │ ├── atome.rb
3534
3534
  │ │ ├── attach.rb
3535
- │ │ ├── attached.rb
3535
+ │ │ ├── fasten.rb
3536
3536
  │ │ ├── basic_understanding.rb
3537
3537
  │ │ ├── browse.rb
3538
3538
  │ │ ├── callback.rb
@@ -232,14 +232,14 @@ Each Each particles and atome is store as an :
232
232
  It may need a bit more optimization
233
233
 
234
234
 
235
- Atomes have a special method to monitor all attached /affected atomes , call : Atome.global_monitoring
235
+ Atomes have a special method to monitor all fasten /affected atomes , call : Atome.global_monitoring
236
236
  Code at : helpers/utilities.rb /def global_monitoring
237
237
  Usage :
238
238
  Atome.global_monitoring(self, [:red, :blue, :blue, :alpha, :left, :right, :diffusion], [:variable1, :variable2])
239
239
 
240
240
  The ephemera @new_atome to allow access to data send to the atome at init time
241
241
 
242
- Important : for atomes that needs to be attached or apply to
242
+ Important : for atomes that needs to be fasten or apply to
243
243
  This happen in the method in presets/atome.rb : atome_common
244
244
  at this line :
245
245
  if params[:type] == :color || basic_params[:type] == :color || params[:type] == :shadow || basic_params[:type] == :shadow
@@ -6,17 +6,17 @@ b.animate(true)
6
6
 
7
7
 
8
8
  Atome.new( { renderers: [:html], attach: [:view],id: :my_test_box, type: :shape, apply: [:shape_color],
9
- left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, attached: [], center: true
9
+ left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, fasten: [], center: true
10
10
  })
11
11
 
12
12
 
13
13
  # Here is the attach explanation and example
14
14
  # the attach method in atome is both a getter and a setter
15
- # attach and attached particles serve the same purpose but just in the opposite direction
15
+ # attach and fasten particles serve the same purpose but just in the opposite direction
16
16
  # please note that atome.attach([:atome_id]) means that atome will be the parent of the atome with the id :atome_id
17
- # to sum up : attach and attached are both setter and getter :
17
+ # to sum up : attach and fasten are both setter and getter :
18
18
  # attach will attach the current object to the IDs passed in the params. The current atome will be the child of the the atomes width IDS passed in the the params,
19
- # while attached is the opposite to attached it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
19
+ # while fasten is the opposite to fasten it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
20
20
 
21
21
  # atome.attach([:atome_id]) means that atome will be the child of the atome with the id :atome_id
22
22
  # Here is how to use it as a setter :
@@ -36,20 +36,20 @@ box({ id: :my_test_box })
36
36
  wait 1 do
37
37
  b.attach([:c_12])
38
38
  # Here is how to use it as a getter :
39
- # to retrieve witch atomes b315 is attached to to the atome c_12 just type
39
+ # to retrieve witch atomes b315 is fasten to to the atome c_12 just type
40
40
  puts b.attach # => [:c_12]
41
- # to retrieve atome attached to the atome c_12 just type tha other method
42
- puts c.attached #=> [:b_1]
41
+ # to retrieve atome fasten to the atome c_12 just type tha other method
42
+ puts c.fasten #=> [:b_1]
43
43
  end
44
44
 
45
- # Here is the attached explanation and example :
45
+ # Here is the fasten explanation and example :
46
46
 
47
- # the attached method in atome is both a getter and a setter
48
- # attach and attached particles serve the same purpose but just in the opposite direction
47
+ # the fasten method in atome is both a getter and a setter
48
+ # attach and fasten particles serve the same purpose but just in the opposite direction
49
49
  # please note that atome.attach([:atome_id]) means that atome will be the parent of the atome with the id :atome_id
50
- # to sum up : attach and attached are both setter and getter :
50
+ # to sum up : attach and fasten are both setter and getter :
51
51
  # attach will attach the current object to the IDs passed in the params. The current atome will be the child of the the atomes width IDS passed in the the params,
52
- # while attached is the opposite to attached it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
52
+ # while fasten is the opposite to fasten it will attach IDs passed in the params to the current atome. The current atome will be the parent of of the the atomes width IDS passed in the the params
53
53
 
54
54
 
55
55
  # Here is how to use it as a setter :
@@ -63,13 +63,13 @@ end
63
63
  c = circle({ left: 333, id: :the_circle })
64
64
  wait 2 do
65
65
  c.apply(:inactive_color)
66
- b.attached([c.id])
66
+ b.fasten([c.id])
67
67
 
68
68
  # Here is how to use it as a getter :
69
- # to retrieve witch atomes b315 is attached to to the atome c_12 just type
69
+ # to retrieve witch atomes b315 is fasten to to the atome c_12 just type
70
70
  puts c.attach # => [:the_box]
71
- # to retrieve atome attached to the atome c_12 just type tha other method
72
- puts b.attached #=> [:the_circle]
71
+ # to retrieve atome fasten to the atome c_12 just type tha other method
72
+ puts b.fasten #=> [:the_circle]
73
73
  end
74
74
 
75
75
 
@@ -121,7 +121,7 @@ a.apply([:box_color])
121
121
  wait 2 do
122
122
  # a bit less efficient and a bit more processor intensive solution is to use the box preset, that render a box too
123
123
  b=box
124
- # we can add a color atome onto the new atome my_shape. as stated before for some atome types such as color, shadows ,the relation between the two atomes won't be attach and attached but apply and affect instead the atome color with the particle red onto the
124
+ # we can add a color atome onto the new atome my_shape. as stated before for some atome types such as color, shadows ,the relation between the two atomes won't be attach and fasten but apply and affect instead the atome color with the particle red onto the
125
125
  b.color(:red)
126
126
  end
127
127
 
@@ -173,56 +173,56 @@ end
173
173
 
174
174
 
175
175
  #Atome.new(
176
- # { renderers: [], id: :eDen, type: :element, tag: { system: true }, attach: [], attached: [] }
176
+ # { renderers: [], id: :eDen, type: :element, tag: { system: true }, attach: [], fasten: [] }
177
177
  # )
178
178
  # Atome.new(
179
179
  # { renderers: [], id: :user_view, type: :element, tag: { system: true },
180
- # attach: [:eDen], attached: [] }
180
+ # attach: [:eDen], fasten: [] }
181
181
  # )
182
182
  #
183
183
  # # color creation
184
184
  # Atome.new(
185
185
  # { renderers: default_render, id: :view_color, type: :color, tag: ({ system: true, persistent: true }),
186
- # red: 0.15, green: 0.15, blue: 0.15, alpha: 1, top: 12, left: 12, diffusion: :linear, attach: [], attached: [] }
186
+ # red: 0.15, green: 0.15, blue: 0.15, alpha: 1, top: 12, left: 12, diffusion: :linear, attach: [], fasten: [] }
187
187
  # )
188
188
  #
189
189
  # Atome.new(
190
190
  # { renderers: default_render, id: :shape_color, type: :color, tag: ({ system: true, persistent: true }),
191
- # red: 0.4, green: 0.4, blue: 0.4, alpha: 1, attach: [], attached: [] }
191
+ # red: 0.4, green: 0.4, blue: 0.4, alpha: 1, attach: [], fasten: [] }
192
192
  # )
193
193
  #
194
194
  # Atome.new(
195
195
  # { renderers: default_render, id: :box_color, type: :color, tag: ({ system: true, persistent: true }),
196
- # red: 0.5, green: 0.5, blue: 0.5, alpha: 1, attach: [], attached: [] }
196
+ # red: 0.5, green: 0.5, blue: 0.5, alpha: 1, attach: [], fasten: [] }
197
197
  # )
198
198
  #
199
199
  # Atome.new(
200
200
  # { renderers: default_render, id: :invisible_color, type: :color, tag: ({ system: true, persistent: true }),
201
- # red: 0, green: 0, blue: 0, alpha: 1, attach: [], attached: [] }
201
+ # red: 0, green: 0, blue: 0, alpha: 1, attach: [], fasten: [] }
202
202
  # )
203
203
  #
204
204
  # Atome.new(
205
205
  # { renderers: default_render, id: :text_color, type: :color, tag: ({ system: true, persistent: true }),
206
- # red: 0.9, green: 0.9, blue: 0.9, alpha: 1, attach: [], attached: [] }
206
+ # red: 0.9, green: 0.9, blue: 0.9, alpha: 1, attach: [], fasten: [] }
207
207
  # )
208
208
  #
209
209
  # Atome.new(
210
210
  # { renderers: default_render, id: :circle_color, type: :color, tag: ({ system: true, persistent: true }),
211
- # red: 0.6, green: 0.6, blue: 0.6, alpha: 1, attach: [], attached: [] }
211
+ # red: 0.6, green: 0.6, blue: 0.6, alpha: 1, attach: [], fasten: [] }
212
212
  # )
213
213
  #
214
214
  # # system object creation
215
215
  # # the black_matter is used to store un materialized atomes
216
216
  # Atome.new(
217
217
  # { renderers: default_render, id: :black_matter, type: :shape, attach: [:user_view],apply: [],
218
- # left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0, overflow: :hidden, tag: { system: true }, attached: []
218
+ # left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0, overflow: :hidden, tag: { system: true }, fasten: []
219
219
  # })
220
220
  #
221
221
  # # view port
222
222
  # Atome.new(
223
223
  # { renderers: default_render, id: :view, type: :shape, attach: [:user_view], apply: [:view_color],
224
224
  # tag: { system: true },
225
- # attached: [], left: 0, right: 0, top: 0, bottom: 0, width: :auto, height: :auto, overflow: :auto,
225
+ # fasten: [], left: 0, right: 0, top: 0, bottom: 0, width: :auto, height: :auto, overflow: :auto,
226
226
  # }
227
227
  #
228
228
  # )
@@ -230,7 +230,7 @@ end
230
230
  # # unreal port, hold system object and tools
231
231
  # Atome.new(
232
232
  # { renderers: default_render, id: :intuition, type: :shape, attach: [:user_view], tag: { system: true },
233
- # left: 0, top: 0, width: 0, height: 0, overflow: :visible, attached: [],apply: []
233
+ # left: 0, top: 0, width: 0, height: 0, overflow: :visible, fasten: [],apply: []
234
234
  # }
235
235
  # )
236
236
  #
@@ -247,7 +247,7 @@ end
247
247
  # Universe.current_machine = machine_id
248
248
  # # the constant A is used to access alla atomes methods
249
249
  # A = Atome.new(
250
- # { renderers: default_render, id: :atome, type: :element, tag: { system: true }, attach: [], attached: [] }
250
+ # { renderers: default_render, id: :atome, type: :element, tag: { system: true }, attach: [], fasten: [] }
251
251
  # )#
252
252
  #
253
253
  # # TODO : clones alteration must be bidirectional, to do so :
@@ -257,7 +257,7 @@ end
257
257
  #
258
258
  # b = box({ color: :red, smooth: 6, id: :the_box })
259
259
  #
260
- # b.clones([{ left: 300, top: 300, color: :blue, entangled: [:width, :attached, :height] },
260
+ # b.clones([{ left: 300, top: 300, color: :blue, entangled: [:width, :fasten, :height] },
261
261
  # { left: 600, top: 366, color: :green, entangled: [:left, :height] }])
262
262
  #
263
263
  # wait 1 do
@@ -570,8 +570,8 @@ def duplicate(ids)
570
570
 
571
571
  atome_passed=grab(id_passed)
572
572
  # atome_passed.particles.delete(:left)
573
- # we remove attached
574
- particle_to_remove=[:id, :broadcast, :history,:callback, :html_object, :store_allow,:attached]
573
+ # we remove fasten
574
+ particle_to_remove=[:id, :broadcast, :history,:callback, :html_object, :store_allow,:fasten]
575
575
  particles_found=atome_passed.particles.dup
576
576
  particles_found.delete_if { |key, value| particle_to_remove.include?(key) }
577
577
  particles_found[:id]=identity_generator(particles_found[:type])
@@ -601,7 +601,7 @@ c.text(:hello)
601
601
  b.touch(true) do
602
602
  puts @id
603
603
  end
604
- b.clones([{ left: 300, top: 300, color: :blue, entangled: [:width, :attached, :height] },
604
+ b.clones([{ left: 300, top: 300, color: :blue, entangled: [:width, :fasten, :height] },
605
605
  { left: 600, top: 366, color: :green, entangled: [:left, :height] }])
606
606
 
607
607
 
@@ -769,7 +769,7 @@ clone = ""
769
769
  b.drag(:start) do
770
770
  b.color(:black)
771
771
  b.height(123)
772
- # beware you must use grab(:view) else it'll be attached to the context, that means to 'b' in this case
772
+ # beware you must use grab(:view) else it'll be fasten to the context, that means to 'b' in this case
773
773
  clone = grab(:view).circle({ id: "#{b.id}_cloned",color: :white, left: b.left, top: b.top, depth: 3 })
774
774
  end
775
775
 
@@ -961,7 +961,7 @@ end
961
961
  # FIXME : on touch code above crash but works with wait
962
962
 
963
963
 
964
- # here is how to setup a hierarchy within atome using a more simple way than attached and attach .simply adding atome inside another atome. here is a example to do to so : b = box({ id: :the_box })
964
+ # here is how to setup a hierarchy within atome using a more simple way than fasten and attach .simply adding atome inside another atome. here is a example to do to so : b = box({ id: :the_box })
965
965
  b=box
966
966
  # the line below will create a circle inside the box b
967
967
  c = b.circle({ id: :the_circle })
@@ -972,14 +972,14 @@ t.image({ path: 'medias/images/logos/atome.svg', width: 33 })
972
972
 
973
973
  # note that creating a hierarchy this way automatically
974
974
 
975
- # Note that when you create a hierarchy in this way, it automatically creates a relationship by populating the 'attach' and 'attached' properties. So, if you enter:
975
+ # Note that when you create a hierarchy in this way, it automatically creates a relationship by populating the 'attach' and 'fasten' properties. So, if you enter:
976
976
 
977
977
 
978
- puts "b attach : #{b.attach}" # prints [:view] in the console as it is attached to the view atom
979
- puts "b attached :#{b.attached}" # prints [:the_circle, :the_cirle] in the console
978
+ puts "b attach : #{b.attach}" # prints [:view] in the console as it is fasten to the view atom
979
+ puts "b fasten :#{b.fasten}" # prints [:the_circle, :the_cirle] in the console
980
980
 
981
981
  puts "c attach: #{c.attach}" # prints [:the_box] in the console
982
- puts "c attached: #{c.attached}" # prints [:box_14] in the console as there's no child#
982
+ puts "c fasten: #{c.fasten}" # prints [:box_14] in the console as there's no child#
983
983
 
984
984
  b = box({ id: :the_box })
985
985
  b.data(:canyouwritethis)
@@ -1344,7 +1344,7 @@ puts "restrict ro :view doesnt work"
1344
1344
  my_box=box
1345
1345
  # using the code line above a lot of particles will be implicitly created, if we inspect my_box
1346
1346
  puts my_box.inspect # this will print :
1347
- #[Log] #<Atome: @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 @element=[object HTMLDivElement], @id="box_14", @original_atome=#<Atome: @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 ...>, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
1347
+ #[Log] #<Atome: @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 @element=[object HTMLDivElement], @id="box_14", @original_atome=#<Atome: @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @id=:box_14, @type=:shape, @html=#<HTML:0x0662a164 ...>, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @attach=[:view], @renderers=[:html], @width=99, @height=99, @apply=[:box_color], @left=100, @top=100, @clones=[], @preset={:box=>{:width=>99, :height=>99, :apply=>[:box_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
1348
1348
 
1349
1349
  # please note that an ID is automatically created using a simple strategy id : atome_type_total_number_of_users_atomes ex here : @id="box_14"
1350
1350
 
@@ -1355,7 +1355,7 @@ puts " my_box preset is : #{my_box.preset}"
1355
1355
 
1356
1356
  c=circle
1357
1357
  puts " c is : #{c.inspect }"
1358
- # this print : [Log] c is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 @element=[object HTMLDivElement], @id="circle_16", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 ...>, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
1358
+ # this print : [Log] c is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 @element=[object HTMLDivElement], @id="circle_16", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_16, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x06579be8 ...>, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}>, @element_type="div">, @top=100, @attach=[:view], @left=100, @apply=[:circle_color], @clones=[], @preset={:circle=>{:width=>99, :height=>99, :smooth=>"100%", :apply=>[:circle_color], :left=>100, :top=>100, :clones=>[]}}> (browser.script.iife.min.js, line 13)
1359
1359
  # it's pôssible to alter basic preset using the particle .preset
1360
1360
  my_box.preset({ circle: {type: :shape, :width=>99, :height=>99, :smooth=>"100%", color: :red, :left=>100, :top=>100, :clones=>[]}})
1361
1361
  puts " my_box preset is now : #{my_box.preset}"
@@ -1366,7 +1366,7 @@ my_box.touch(true) do
1366
1366
 
1367
1367
  new_circle=circle # as the preset circle has been modified tha circle is now red as specified in the updated preset
1368
1368
  puts "new_circle is : #{new_circle.inspect}"
1369
- # this print : new_circle is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c @element=[object HTMLDivElement], @id="circle_18", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @attached=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c ...>, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>, @element_type="div">, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>
1369
+ # this print : new_circle is : #<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c @element=[object HTMLDivElement], @id="circle_18", @original_atome=#<Atome: @type=:shape, @smooth="100%", @width=99, @id=:circle_18, @renderers=[:html], @height=99, @broadcast={}, @callback={}, @tag={}, @fasten=[], @unit={}, @collected={}, @html=#<HTML:0x0664e99c ...>, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>, @element_type="div">, @top=100, @attach=[:box_14], @left=100, @apply=[:circle_18_color_1_0_0_0_0_0____], @clones=[]>
1370
1370
  end
1371
1371
  #
1372
1372
 
@@ -1616,7 +1616,7 @@ the_text.shadow({
1616
1616
 
1617
1617
  shape(
1618
1618
  { renderers: [:html], id: :my_test_box, type: :shape, apply: [:shape_color],
1619
- left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, attached: [], center: true
1619
+ left: 120, top: 0, width: 100, smooth: 15, height: 100, overflow: :visible, fasten: [], center: true
1620
1620
  })
1621
1621
 
1622
1622
 
@@ -250,14 +250,14 @@ Each Each particles and atome is store as an :
250
250
  It may need a bit more optimization
251
251
 
252
252
 
253
- Atomes have a special method to monitor all attached /affected atomes , call : Atome.global_monitoring
253
+ Atomes have a special method to monitor all fasten /affected atomes , call : Atome.global_monitoring
254
254
  Code at : helpers/utilities.rb /def global_monitoring
255
255
  Usage :
256
256
  Atome.global_monitoring(self, [:red, :blue, :blue, :alpha, :left, :right, :diffusion], [:variable1, :variable2])
257
257
 
258
258
  The ephemera @new_atome to allow access to data send to the atome at init time
259
259
 
260
- Important : for atomes that needs to be attached or apply to
260
+ Important : for atomes that needs to be fasten or apply to
261
261
  This happen in the method in presets/atome.rb : atome_common
262
262
  at this line :
263
263
  if params[:type] == :color || basic_params[:type] == :color || params[:type] == :shadow || basic_params[:type] == :shadow
data/lib/atome/atome.rb CHANGED
@@ -15,33 +15,16 @@ class Atome
15
15
  # dummy method to catch a method get all instance variable and try to call a method but initialized is only an
16
16
  # instance variable not a method
17
17
  # FIXME : replace all
18
- # def initialized(*_msg)
19
- #
20
- # end
21
18
 
22
19
  def initialize(new_atome = {}, &atomes_proc)
23
20
  # TODO: atome format should always be as followed : {value: 0.44, unit: :px, opt1: 554}
24
- # when using optimised version of atome you must type eg : a.set({left: {value: 33, unit: '%', reference: :center}})
25
- # if Universe.atomes[new_atome[:id]]
26
- # # puts "------ 2 #{new_atome[:id]} => #{Universe.atomes[new_atome[:id]]}"
27
- # # puts 'atome_id already exist'
28
- # # old_atome= grab(new_atome[:id])
29
- # # new_atome.each do |element, value|
30
- # # old_atome.send(element, value)
31
- # # end
32
- # # return false
33
- # grab(new_atome[:id])
34
- # else
35
21
  # the keys :renderers, :type and :id should be placed in the first position in the hash
36
22
  @history = {}
37
- # @language = :english
38
- # @callback = {}
39
23
  @tag = {}
40
24
  @tick = {}
41
25
  @storage = {}
42
26
  @behavior = {}
43
27
  @selected = false
44
- #@metrics = {}
45
28
  @unit = {}
46
29
  @apply = []
47
30
  @collect = {}
@@ -51,40 +34,31 @@ class Atome
51
34
  @aid = new_atome[:aid] || identity_generator
52
35
  @controller_proc = []
53
36
  @id = new_atome[:id] || @aid
54
- # if grab(@id)
55
- # collapse({})
56
- # puts "#{@id} already exists"
57
- # else
58
- Universe.atomes.each_value do |atome_f|
59
- # we affect the already existing atome to target
60
- next unless atome_f.id == @id
61
-
62
- new_atome[:affect].each do |affected|
63
- grab(affected).apply(@id)
64
- end if new_atome[:affect]
65
- return false
66
- end
67
- Universe.add_to_atomes(@aid, self)
68
- Universe.id_to_aid(@id, @aid)
69
- @type = new_atome[:type] || :element
70
- @attached = []
71
- @affect = []
72
- @category = []
73
- # @display = { mode: :default }
74
- # @backup={} # mainly used to restore particle when using grid /table /list display mode
75
- @html = HTML.new(@id, self)
76
- @headless = Headless.new(@id, self)
77
- @initialized = {}
78
- @creator = Universe.current_user
79
- # now we store the proc in a an atome's property called :bloc
80
- new_atome[:code] = atomes_proc if atomes_proc
81
- # we reorder the hash
82
- reordered_atome = reorder_particles(new_atome)
83
- # FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
84
-
85
- collapse(reordered_atome)
86
- # end
37
+ Universe.atomes.each_value do |atome_f|
38
+ # we affect the already existing atome to target
39
+ next unless atome_f.id == @id
87
40
 
41
+ new_atome[:affect].each do |affected|
42
+ grab(affected).apply(@id)
43
+ end if new_atome[:affect]
44
+ return false
45
+ end
46
+ Universe.add_to_atomes(@aid, self)
47
+ Universe.id_to_aid(@id, @aid)
48
+ @type = new_atome[:type] || :element
49
+ @fasten = []
50
+ @affect = []
51
+ @category = []
52
+ @html = HTML.new(@id, self)
53
+ @headless = Headless.new(@id, self)
54
+ @initialized = {}
55
+ @creator = Universe.current_user
56
+ # now we store the proc in a an atome's property called :bloc
57
+ new_atome[:code] = atomes_proc if atomes_proc
58
+ # we reorder the hash
59
+ reordered_atome = reorder_particles(new_atome)
60
+ # FIXME : try to remove the condition below (it crash in the method : def generator ... in genesis.rb)
61
+ collapse(reordered_atome)
88
62
  end
89
63
 
90
64
  def js
@@ -93,7 +67,6 @@ class Atome
93
67
 
94
68
  def particle_creation(element, params, store, rendering, &user_proc)
95
69
 
96
- # @store_allow = false
97
70
  params = particle_main(element, params, &user_proc)
98
71
  # Params is now an instance variable so it should be passed thru different methods
99
72
  instance_variable_set("@#{element}", params) if store
@@ -103,14 +76,11 @@ class Atome
103
76
  particle_callback(element)
104
77
  store_proc(element, params, &user_proc) if user_proc
105
78
  render(element, params, &user_proc) if rendering
106
- # broadcasting(element)
107
79
  # post rendering processor
108
80
  params = particle_post(element, params, &user_proc)
109
81
  instance_variable_set("@#{element}", params) if store
110
82
  Universe.historicize(@aid, :write, element, params)
111
- # after storage processor
112
83
  particle_after(element, params, &user_proc)
113
- # self
114
84
  end
115
85
 
116
86
  def inspect
@@ -122,5 +92,3 @@ class Atome
122
92
  "#<#{self.class}: #{content}>"
123
93
  end
124
94
  end
125
-
126
-