(gd, binding, cache)
| 207 | }; |
| 208 | |
| 209 | function bindingValueHasChanged(gd, binding, cache) { |
| 210 | var container, value, obj; |
| 211 | var changed = false; |
| 212 | |
| 213 | if(binding.type === 'data') { |
| 214 | // If it's data, we need to get a trace. Based on the limited scope |
| 215 | // of what we cover, we can just take the first trace from the list, |
| 216 | // or otherwise just the first trace: |
| 217 | container = gd._fullData[binding.traces !== null ? binding.traces[0] : 0]; |
| 218 | } else if(binding.type === 'layout') { |
| 219 | container = gd._fullLayout; |
| 220 | } else { |
| 221 | return false; |
| 222 | } |
| 223 | |
| 224 | value = Lib.nestedProperty(container, binding.prop).get(); |
| 225 | |
| 226 | obj = cache[binding.type] = cache[binding.type] || {}; |
| 227 | |
| 228 | if(obj.hasOwnProperty(binding.prop)) { |
| 229 | if(obj[binding.prop] !== value) { |
| 230 | changed = true; |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | obj[binding.prop] = value; |
| 235 | |
| 236 | return { |
| 237 | changed: changed, |
| 238 | value: value |
| 239 | }; |
| 240 | } |
| 241 | |
| 242 | /* |
| 243 | * Execute an API command. There's really not much to this; it just provides |
no outgoing calls
no test coverage detected
searching dependent graphs…