hyper-vis 1.0.0.lap25 → 1.0.0.lap26

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ describe 'Hyperloop::Vis::Component', js: true do
5
5
  it 'creates a component by using the mixin and renders it' do
6
6
  mount 'OuterComponent' do
7
7
  class VisComponent
8
- include Hyperloop::Vis::Mixin
8
+ include Hyperloop::Vis::Network::Mixin
9
9
 
10
10
  render_with_dom_node do |dom_node, data|
11
11
  net = Vis::Network.new(dom_node, data)
@@ -23,7 +23,7 @@ describe 'Hyperloop::Vis::Component', js: true do
23
23
 
24
24
  it 'creates a component by inheriting and renders it' do
25
25
  mount 'OuterComponent' do
26
- class VisComponent < Hyperloop::Vis::Component
26
+ class VisComponent < Hyperloop::Vis::Network::Component
27
27
  render_with_dom_node do |dom_node, data|
28
28
  net = Vis::Network.new(dom_node, data)
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyper-vis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.lap25
4
+ version: 1.0.0.lap26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-23 00:00:00.000000000 Z
11
+ date: 2018-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -177,8 +177,8 @@ files:
177
177
  - README.md
178
178
  - hyper-vis.gemspec
179
179
  - lib/hyper-vis.rb
180
- - lib/hyperloop/vis/component.rb
181
- - lib/hyperloop/vis/mixin.rb
180
+ - lib/hyperloop/vis/network/component.rb
181
+ - lib/hyperloop/vis/network/mixin.rb
182
182
  - lib/hyperloop/vis/version.rb
183
183
  - lib/vis.rb
184
184
  - lib/vis/data_common.rb
@@ -187,6 +187,22 @@ files:
187
187
  - lib/vis/event_support.rb
188
188
  - lib/vis/native.rb
189
189
  - lib/vis/network.rb
190
+ - lib/vis/source/img/network/acceptDeleteIcon.png
191
+ - lib/vis/source/img/network/addNodeIcon.png
192
+ - lib/vis/source/img/network/backIcon.png
193
+ - lib/vis/source/img/network/connectIcon.png
194
+ - lib/vis/source/img/network/cross.png
195
+ - lib/vis/source/img/network/cross2.png
196
+ - lib/vis/source/img/network/deleteIcon.png
197
+ - lib/vis/source/img/network/downArrow.png
198
+ - lib/vis/source/img/network/editIcon.png
199
+ - lib/vis/source/img/network/leftArrow.png
200
+ - lib/vis/source/img/network/minus.png
201
+ - lib/vis/source/img/network/plus.png
202
+ - lib/vis/source/img/network/rightArrow.png
203
+ - lib/vis/source/img/network/upArrow.png
204
+ - lib/vis/source/img/network/zoomExtends.png
205
+ - lib/vis/source/vis.css
190
206
  - lib/vis/source/vis.js
191
207
  - lib/vis/utilities.rb
192
208
  - spec/spec_helper.rb
@@ -271,9 +287,9 @@ files:
271
287
  - spec/test_app/test/test_helper.rb
272
288
  - spec/test_app/tmp/.keep
273
289
  - spec/test_app/vendor/.keep
274
- - spec/vis_component_spec.rb
275
290
  - spec/vis_data_set_spec.rb
276
291
  - spec/vis_data_view_spec.rb
292
+ - spec/vis_network_component_spec.rb
277
293
  - spec/vis_network_spec.rb
278
294
  homepage: https://github.com/janbiedermann/hyper-vis
279
295
  licenses: []
@@ -381,7 +397,7 @@ test_files:
381
397
  - spec/test_app/test/test_helper.rb
382
398
  - spec/test_app/tmp/.keep
383
399
  - spec/test_app/vendor/.keep
384
- - spec/vis_component_spec.rb
385
400
  - spec/vis_data_set_spec.rb
386
401
  - spec/vis_data_view_spec.rb
402
+ - spec/vis_network_component_spec.rb
387
403
  - spec/vis_network_spec.rb
@@ -1,12 +0,0 @@
1
- module Hyperloop
2
- module Vis
3
- class Component
4
- include Hyperloop::Vis::Mixin
5
- def self.inherited(base)
6
- base.class_eval do
7
- param data: nil
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,54 +0,0 @@
1
- require 'react/component'
2
-
3
- module Hyperloop
4
- module Vis
5
- module Mixin
6
- def self.included(base)
7
- base.include(Hyperloop::Component::Mixin)
8
- base.class_eval do
9
- param data: nil
10
-
11
- def _set_dom_node(dom_node)
12
- @_dom_node = dom_node
13
- end
14
-
15
- def data
16
- @_data
17
- end
18
-
19
- def document
20
- `window.document`
21
- end
22
-
23
- def self.render_with_dom_node(tag = 'DIV', &block)
24
- render do
25
- @_vis_render_block = block
26
- @_data = params.data
27
- send(tag, ref: method(:_set_dom_node).to_proc)
28
- end
29
- end
30
-
31
- def should_component_update?
32
- false
33
- end
34
-
35
- after_mount do
36
- if @_dom_node && @_vis_render_block
37
- @_vis_render_block.call(@_dom_node, @_data)
38
- end
39
- end
40
-
41
- before_receive_props do |new_props|
42
- if new_props[:data] != @_data
43
- @_data = new_props[:data]
44
- if @_dom_node && @_vis_render_block
45
- @_vis_render_block.call(@_dom_node, @_data)
46
- end
47
- end
48
- end
49
- end
50
- end
51
-
52
- end
53
- end
54
- end