hyper-vis 1.0.0.lap24 → 1.0.0.lap25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe18835be08b221fd9615c5726edee4a71c3fb58381f57b97e174e4ec7c762bf
4
- data.tar.gz: c12b8e5d6289cf07211e077e1e026caaeb0caaa07167ed63ead659d5ee1dbc63
3
+ metadata.gz: 749aaea83b655118b902175e75dee3dc7d6be3b4ad94f6f99ddd59382518d257
4
+ data.tar.gz: 7b59a5aa4e67be9c9da57be137949d59bf228cd977ced44d78ef16af2face9fd
5
5
  SHA512:
6
- metadata.gz: 491a08e191f79ccdb77c279850f3d30688a6bc798ca24e39945a63427ac4e244444351df077e1d0251b58b86f5f560da8aa6be3c2c809c23c7b2b297120232e5
7
- data.tar.gz: f2dc038fc7c21240169882776ca970e4f91435406063885148013724d1f736061f9b888a8feda6019d619f9abffe984673dde5b6f96f4de02f50e00409920f55
6
+ metadata.gz: 4cf89533e6e15d81f85fe3a9dbb744d24612d4262af39323937004935504cb29fb69766d606e249d3ebc39d38819e38d5040809a670ea1f6dd1c0ccabd759ec4
7
+ data.tar.gz: 8befb906b571f215eb6b884d953000acb468907fdd88c0120cdecdd4755187ab8e5b8d3f200070892d37ccb93ada3f5e8d51c2afbb981f3287e3f1a231ea5f74
data/README.md CHANGED
@@ -1 +1,4 @@
1
- # hyper-vis
1
+ # hyper-vis
2
+
3
+ No docs yet, See spec/ directory fo usage
4
+ Vis Stylesheets not included yet.
@@ -15,6 +15,10 @@ module Hyperloop
15
15
  def data
16
16
  @_data
17
17
  end
18
+
19
+ def document
20
+ `window.document`
21
+ end
18
22
 
19
23
  def self.render_with_dom_node(tag = 'DIV', &block)
20
24
  render do
@@ -1,5 +1,5 @@
1
1
  module Hyperloop
2
2
  module Vis
3
- VERSION = '1.0.0.lap24'
3
+ VERSION = '1.0.0.lap25'
4
4
  end
5
5
  end
@@ -52,27 +52,31 @@ module Vis
52
52
  `self["native"].off(event, handler)`
53
53
  @event_handlers[event].delete(event_handler_id)
54
54
  end
55
-
55
+
56
56
  def on(event, &block)
57
57
  event = lower_camelize(event)
58
58
  @event_handlers[event] = {} unless @event_handlers[event]
59
59
  event_handler_id = `Math.random().toString(36).substring(6)`
60
- handler = %x{
61
- function(event_info) {
62
- #{block.call(`Opal.Hash.$new(event_info)`)};
63
- }
64
- }
60
+ handler = if %i[afterDrawing beforeDrawing blurEdge blurNode hoverEdge hoverNode showPopup].include?(event)
61
+ `function(param) { #{block.call(`param`)}; }`
62
+ elsif %i[hidePopup startStabilizing stabilizationIterationsDone initRedraw].include?(event)
63
+ `function() { #{block.call}; }`
64
+ else
65
+ `function(event_info) { #{block.call(`Opal.Hash.$new(event_info)`)}; }`
66
+ end
65
67
  @event_handlers[event][event_handler_id] = handler
66
68
  `self["native"].on(event, handler);`
67
69
  event_handler_id
68
70
  end
69
71
 
70
72
  def once(event, &block)
71
- handler = %x{
72
- function(event_info) {
73
- #{block.call(`Opal.Hash.$new(event_info)`)};
74
- }
75
- }
73
+ handler = if %i[afterDrawing beforeDrawing blurEdge blurNode hoverEdge hoverNode showPopup].include?(event)
74
+ `function(param) { #{block.call(`param`)}; }`
75
+ elsif %i[hidePopup startStabilizing stabilizationIterationsDone initRedraw].include?(event)
76
+ `function() { #{block.call}; }`
77
+ else
78
+ `function(event_info) { #{block.call(`Opal.Hash.$new(event_info)`)}; }`
79
+ end
76
80
  `self["native"].once(event, handler);`
77
81
  end
78
82
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyper-vis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.lap24
4
+ version: 1.0.0.lap25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann