diff options
Diffstat (limited to 'node_modules/montage-user/ui/flow-path-sigmoid.js')
-rw-r--r-- | node_modules/montage-user/ui/flow-path-sigmoid.js | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/node_modules/montage-user/ui/flow-path-sigmoid.js b/node_modules/montage-user/ui/flow-path-sigmoid.js new file mode 100644 index 00000000..2e776b5a --- /dev/null +++ b/node_modules/montage-user/ui/flow-path-sigmoid.js | |||
@@ -0,0 +1,142 @@ | |||
1 | var Montage = require("montage").Montage; | ||
2 | |||
3 | var FlowPathSigmoid = exports.FlowPathSigmoid = Montage.create(Montage, { | ||
4 | |||
5 | _variable: { | ||
6 | enumerable: false, | ||
7 | value: "time" | ||
8 | }, | ||
9 | |||
10 | variable: { | ||
11 | get: function () { | ||
12 | return this._variable; | ||
13 | }, | ||
14 | set: function (value) { | ||
15 | switch (value) { | ||
16 | case "speed": | ||
17 | case "index": | ||
18 | this._variable = value; | ||
19 | break; | ||
20 | default: | ||
21 | this._variable = "time"; | ||
22 | } | ||
23 | this._updatePath(); | ||
24 | } | ||
25 | }, | ||
26 | |||
27 | _smoothness: { | ||
28 | enumerable: false, | ||
29 | value: 0 | ||
30 | }, | ||
31 | |||
32 | smoothness: { | ||
33 | get: function () { | ||
34 | return this._smoothness; | ||
35 | }, | ||
36 | set: function (value) { | ||
37 | this._smoothness = value; | ||
38 | this._updatePath(); | ||
39 | } | ||
40 | }, | ||
41 | |||
42 | _scale: { | ||
43 | enumerable: false, | ||
44 | value: 0 | ||
45 | }, | ||
46 | |||
47 | scale: { | ||
48 | get: function () { | ||
49 | return this._scale; | ||
50 | }, | ||
51 | set: function (value) { | ||
52 | this._scale = value; | ||
53 | this._updatePath(); | ||
54 | } | ||
55 | }, | ||
56 | |||
57 | _width: { | ||
58 | enumerable: false, | ||
59 | value: 0 | ||
60 | }, | ||
61 | |||
62 | width: { | ||
63 | get: function () { | ||
64 | return this._width; | ||
65 | }, | ||
66 | set: function (value) { | ||
67 | this._width = value; | ||
68 | this._updatePath(); | ||
69 | } | ||
70 | }, | ||
71 | |||
72 | _origin: { | ||
73 | enumerable: false, | ||
74 | value: 0 | ||
75 | }, | ||
76 | |||
77 | origin: { | ||
78 | get: function () { | ||
79 | return this._origin; | ||
80 | }, | ||
81 | set: function (value) { | ||
82 | this._origin = value; | ||
83 | this._updatePath(); | ||
84 | } | ||
85 | }, | ||
86 | |||
87 | _sigmoidCenter: { | ||
88 | enumerable: false, | ||
89 | value: 0 | ||
90 | }, | ||
91 | |||
92 | sigmoidCenter: { | ||
93 | get: function () { | ||
94 | return this._sigmoidCenter; | ||
95 | }, | ||
96 | set: function (value) { | ||
97 | this._sigmoidCenter = value; | ||
98 | this._updatePath(); | ||
99 | } | ||
100 | }, | ||
101 | |||
102 | _slope: { | ||
103 | enumerable: false, | ||
104 | value: 1 | ||
105 | }, | ||
106 | |||
107 | slope: { | ||
108 | get: function () { | ||
109 | return this._slope; | ||
110 | }, | ||
111 | set: function (value) { | ||
112 | this._slope = value; | ||
113 | this._updatePath(); | ||
114 | } | ||
115 | }, | ||
116 | |||
117 | _path: { | ||
118 | enumerable: false, | ||
119 | value: "0" | ||
120 | }, | ||
121 | |||
122 | path: { | ||
123 | get: function () { | ||
124 | return this._path; | ||
125 | }, | ||
126 | set: function (value) { | ||
127 | this._path = value; | ||
128 | } | ||
129 | }, | ||
130 | |||
131 | _updatePath: { | ||
132 | enumerable: false, | ||
133 | value: function () { | ||
134 | var s = "(slide."+this._variable+"-("+this._origin+"))"; | ||
135 | |||
136 | |||
137 | /** parseInt((a/(1+Math.pow(c, -(j*d)))-(a/2)+j*b)*1000)/1000; | ||
138 | this.path = "parseInt(("+this._a+"/(1+Math.pow("+this._c+", -"+s+"*("+this._d+")))-(("+this._a+")/2)+"+s+"*("+this._b+"))*1000)/1000";*/ | ||
139 | this.path = "((("+this._width+")/(1+Math.pow(2, (("+this._sigmoidCenter+")-"+s+")/("+this._smoothness+"))))-("+(this._width/2)+")+"+s+"*("+this._slope+"))*("+this._scale+")"; | ||
140 | } | ||
141 | } | ||
142 | }); | ||