ela 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1112b240f9642bc0878084ee7066762d730d7804
4
- data.tar.gz: 59d78a09904bd572492cab10ffe75d40233530a9
3
+ metadata.gz: bb4619edb649e36852192e36da53215947d80d99
4
+ data.tar.gz: 3a616aa2061220cacf65b61e4abec4bd48ae0342
5
5
  SHA512:
6
- metadata.gz: d545d29da4c083115779102fef81936a44b2c37925d01d15a624ba6b9d2d0c9c9b08d51cedf080eced714976c4fcd4ccda10799968c6a60980173a504d3d54b9
7
- data.tar.gz: 3328796e67eee755034e8d35167d384497f200a54e813babd3b531c3613afdd9af0d7f8d0cb0c5eb7fe6e5de8c390e5fda3332accc1c618ac3695aed4ba0d181
6
+ metadata.gz: b01324e4bdf443a77ddc9bfbbc4dde41ab03ed4c6d5ba8d053de507800b1ecfe969c84451c6085d3cc955fc1c3e20e79ecca7f73e4ae58c7669f99dc7f56936b
7
+ data.tar.gz: 706e1209962ced109b068074ac30ff55c70ee4bc2c5c73e95da7eac180efcfe306f25aaa2494755b4b5cc4025aa8a6edc319757ae6b52daa9c69eb5fdb440e3d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ela (3.0.0)
4
+ ela (3.1.0)
5
5
  andand (~> 1.3, >= 1.3.3)
6
6
  bundler (~> 1.13)
7
7
  coffee-script (~> 2.4, >= 2.4.1)
@@ -113,10 +113,9 @@ li.share-form
113
113
  content "\f00d"
114
114
 
115
115
  article.viewport
116
- display flex
116
+ display grid
117
117
 
118
118
  .view
119
- flex 1
120
119
  display flex
121
120
  flex-direction column
122
121
  border-right 1px solid #bbb
@@ -218,6 +217,7 @@ article.viewport
218
217
  z-layer 'section', 'graph'
219
218
  flex 1
220
219
  overflow hidden
220
+ position relative
221
221
 
222
222
  div.graph-overlay-wrapper
223
223
  height 0
@@ -36,10 +36,10 @@ class ELA.Views.AxisHandler extends Backbone.Poised.View
36
36
  if @orientation is 'x'
37
37
  width = @displayParams.get('width')
38
38
  point = (range / width) *
39
- (e.gesture.pointers[0].clientX - graphOffset.left - origin)
39
+ (e.gesture.center.x - graphOffset.left - origin)
40
40
  else # @orientation is 'y'
41
41
  height = @displayParams.get('height')
42
- y = e.gesture.pointers[0].clientY - graphOffset.top
42
+ y = e.gesture.center.y - graphOffset.top
43
43
  y = Math.min(Math.max(y, 0), height)
44
44
  point = (range / height) * (origin - y)
45
45
 
@@ -188,6 +188,7 @@ class ELA.Views.BaseApp extends Backbone.Poised.View
188
188
  model: @model
189
189
  parentView: this
190
190
  views: @views
191
+ layout: @layout
191
192
  localePrefix: @localePrefix
192
193
  @$('.viewport').replaceWith(view.render().el)
193
194
 
@@ -11,6 +11,8 @@ class ELA.Views.ChartJS extends Backbone.Poised.View
11
11
  $.extend @chartConfig.options.title,
12
12
  fontFamily: 'Roboto'
13
13
  fontStyle: '500'
14
+ $.extend @chartConfig.options,
15
+ maintainAspectRatio: false
14
16
  @dataFunction = options.dataFunction
15
17
  @params = options.params
16
18
 
@@ -106,6 +106,10 @@ class ELA.Views.GraphView extends ELA.Views.ViewportView
106
106
  curves: @curves
107
107
  axisLabelingForCurve: @axisLabelingForCurve
108
108
  localePrefix: @localePrefix
109
+ if @leftAxisHandler?
110
+ view.$el.on('tap', @subviews.leftAxisHandler.updateValue)
111
+ if @bottomAxisHandler?
112
+ view.$el.on('tap', @subviews.bottomAxisHandler.updateValue)
109
113
  $graph.html(view.render().el)
110
114
 
111
115
  this
@@ -13,14 +13,29 @@ class ELA.Views.Viewport extends Backbone.Poised.View
13
13
 
14
14
  @subviews = {}
15
15
 
16
+ @layout = options.layout or
17
+ [ _.map(@views, (view, idx) -> String.fromCharCode(97 + idx)).join(' ') ]
18
+
19
+ _style: ->
20
+ 'grid-template-areas: "' + @layout.join('" "') + '";' +
21
+ 'grid-auto-columns: ' +
22
+ Array(@layout[0].split(' ').length).fill('1fr').join(' ') + ';' +
23
+ 'grid-auto-rows: ' +
24
+ Array(@layout.length).fill('1fr').join(' ') + ';'
25
+
26
+
16
27
  render: ->
17
- @$el.empty()
18
- for view in @views
28
+ @$el.empty().attr('style', @_style())
29
+
30
+ for view, idx in @views
19
31
  options = _.extend
20
32
  model: @model
21
33
  parentView: this
22
34
  localePrefix: @localePrefix
35
+ attributes:
36
+ style: "grid-area: #{String.fromCharCode(97 + idx)}"
23
37
  , view.options
24
38
  view = @subviews[view.options.name] ?= new view.View(options)
25
39
  @$el.append(view.render().el)
40
+
26
41
  this
@@ -1,3 +1,3 @@
1
1
  module ELA
2
- VERSION = '3.0.0'
2
+ VERSION = '3.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ela
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franz Kißig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-16 00:00:00.000000000 Z
11
+ date: 2018-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler