ela 4.1.5 → 4.1.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c64b64f369d8208adc4ca837614a1c4aa5d3234c1ae22fdab8eb8f209973ec00
|
4
|
+
data.tar.gz: 96a808ce8df7c572ea2338e0dcb538a5ca407315524613eb4dd97d9363e39642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f787de4b452df33ffc34b5c6a6d690219b6fc925142211ce80325070a7f11f2ab9dab606aa2ee0b08e095c59be6c159621a99e9c7075a686216785ba285d47b
|
7
|
+
data.tar.gz: d4a24f33704fce88710b846f00a91ec59b30004432af0281bc3d9889d03fd256ab4a7e8278f355125015ceb2371563e3bf45aa77c3932f4b059cefa0073b0313
|
@@ -56,7 +56,7 @@ class ELA.Collections.LimitedCollection extends Backbone.Collection
|
|
56
56
|
removeFromHistory: (model) ->
|
57
57
|
while @inHistory(model)
|
58
58
|
@history.splice(@history.indexOf(model), 1)
|
59
|
-
@trigger('
|
59
|
+
@trigger('historyRemove')
|
60
60
|
|
61
61
|
# Rebuilds history leaving old history entries untouched. Entries
|
62
62
|
# are being added in collection order.
|
@@ -66,7 +66,7 @@ class ELA.Collections.LimitedCollection extends Backbone.Collection
|
|
66
66
|
@each (model) =>
|
67
67
|
@manageHistory(model, silent: true)
|
68
68
|
unless _.isEqual(oldHistory, @history)
|
69
|
-
@trigger('
|
69
|
+
@trigger('historyReset')
|
70
70
|
|
71
71
|
# Whenever a model is changing its `activeState` the history is
|
72
72
|
# checked. If the model is `activated` and the history is at its
|
@@ -79,7 +79,7 @@ class ELA.Collections.LimitedCollection extends Backbone.Collection
|
|
79
79
|
while @atLimit()
|
80
80
|
@history.shift().set(@attribute, not @activeState)
|
81
81
|
@history.push(model)
|
82
|
-
@trigger('
|
82
|
+
@trigger('historyAdd') unless options.silent
|
83
83
|
else
|
84
84
|
@removeFromHistory(model)
|
85
85
|
this
|
@@ -45,12 +45,31 @@ class ELA.Models.GraphParams extends ELA.Models.CanvasParams
|
|
45
45
|
@on('change:yScale', @calculateRanges)
|
46
46
|
|
47
47
|
@calculateRanges()
|
48
|
+
@ensureCurveForAxisLabeling(initialCall: true)
|
48
49
|
@bindCalculatorEvents()
|
49
50
|
@listenTo(@app.curves, 'change:selected', @bindCalculatorEvents)
|
51
|
+
@listenTo(@app.curves, 'historyRemove historyReset', @ensureCurveForAxisLabeling)
|
52
|
+
@listenTo @app.curves, 'historyAdd', ->
|
53
|
+
@ensureCurveForAxisLabeling(reset: true)
|
50
54
|
@listenTo @app, 'change:calculators', ->
|
51
55
|
@calculateRanges()
|
52
56
|
@bindCalculatorEvents()
|
53
57
|
|
58
|
+
ensureCurveForAxisLabeling: (options = {}) ->
|
59
|
+
currentAxisLabelingCurve = @get('axisLabelingForCurve')
|
60
|
+
curves = @filteredCurves()
|
61
|
+
|
62
|
+
if curves.indexOf(currentAxisLabelingCurve) < 0 or options.reset
|
63
|
+
if curves.length > 0
|
64
|
+
newLabelCurve = if options.initialCall
|
65
|
+
# First curve in legend
|
66
|
+
curves[0]
|
67
|
+
else
|
68
|
+
# Curve that has been selected recently (last curve in legend)
|
69
|
+
curves[curves.length - 1]
|
70
|
+
|
71
|
+
@set(axisLabelingForCurve: newLabelCurve)
|
72
|
+
|
54
73
|
bindCalculatorEvents: ->
|
55
74
|
# Remove current callbacks, add new ones for each curve
|
56
75
|
@stopListening(@app.previous('calculators'))
|
@@ -65,6 +84,8 @@ class ELA.Models.GraphParams extends ELA.Models.CanvasParams
|
|
65
84
|
@listenTo(calc, 'change:maxY change:yRange', @calculateRangeY)
|
66
85
|
# TODO: Add dynamic dependencies to calculator, so that we can
|
67
86
|
# actually only listen to maxY changes and recalculate ranges.
|
87
|
+
# TODO: is this block required?! change:xRange and change:yRange
|
88
|
+
# above should be enough.
|
68
89
|
oldestCurve = filteredCurves[0]
|
69
90
|
if oldestCurve?
|
70
91
|
@listenTo(calc,
|
@@ -41,12 +41,7 @@ class ELA.Views.GraphView extends ELA.Views.ViewportView
|
|
41
41
|
orientation: 'horizontal'
|
42
42
|
attribute: @leftAxisHandler.attribute
|
43
43
|
|
44
|
-
if options.graph?.curves?
|
45
|
-
@curves = options.graph.curves.slice()
|
46
|
-
@axisLabelingForCurve = @model.curves.find (curve) =>
|
47
|
-
curve.get('function') is @curves[0]
|
48
|
-
else
|
49
|
-
@axisLabelingForCurve = @model.curves.first()
|
44
|
+
@curves = options.graph.curves.slice() if options.graph?.curves?
|
50
45
|
|
51
46
|
if options.graph?.view
|
52
47
|
@GraphView = options.graph.view.toFunction()
|
@@ -55,7 +50,6 @@ class ELA.Views.GraphView extends ELA.Views.ViewportView
|
|
55
50
|
@displayParams = @model.displayParams[options.name] ?= new @GraphView.Params
|
56
51
|
guides: @guides
|
57
52
|
curves: @curves
|
58
|
-
axisLabelingForCurve: @axisLabelingForCurve
|
59
53
|
xAxisY: @xAxisY
|
60
54
|
xAxisScale: @xAxisScale
|
61
55
|
yAxisX: @yAxisX
|
data/lib/ela/version.rb
CHANGED
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: 4.1.
|
4
|
+
version: 4.1.6
|
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: 2019-
|
11
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|