Changeset - b95b97177de6
[Not reviewed]
default
0 2 0
Drew Perttula - 8 years ago 2017-05-11 05:30:51
drewp@bigasterisk.com
console time logs
Ignore-this: 2017a9621712d22de1c367c5f1da71f
2 files changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/web/graph.coffee
Show inline comments
 
@@ -70,13 +70,15 @@ class AutoDependencies
 
    
 
  runHandler: (func, label) ->
 
    # what if we have this func already? duplicate is safe?
 

	
 
    h = new Handler(func, label)
 
    @handlerStack[@handlerStack.length - 1].innerHandlers.push(h)
 
    console.time("handler #{label}")
 
    @_rerunHandler(h, null)
 
    console.timeEnd("handler #{label}")
 
    
 
  _rerunHandler: (handler, patch) ->
 
    handler.patterns = []
 
    @handlerStack.push(handler)
 
    try
 
      handler.func(patch)
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -343,12 +343,14 @@ Polymer
 
    'update(song, rowIndex)'
 
    'onZoom(zoomInX)'
 
    ]
 
  onGraph: ->
 
    @graph.runHandler(@update.bind(@), "row notes #{@rowIndex}")
 
  update: (patch) ->
 
    console.time('row update')
 

	
 
    U = (x) -> @graph.Uri(x)
 

	
 
    notesForThisRow = []
 
    i = 0
 
    for n in _.sortBy(@graph.objects(@song, U(':note')))
 
      if (i % ROW_COUNT) == @rowIndex
 
@@ -361,12 +363,13 @@ Polymer
 
      child.dia = @dia
 
      child.uri = newUri
 
      child.setAdjuster = @setAdjuster
 
      child.song = @song # could change, but all the notes will be rebuilt
 
      child.zoomInX = @zoomInX # missing binding; see onZoom
 
      return child      
 
    console.timeEnd('row update')
 

	
 
  onZoom: ->
 
    for e in @children
 
      e.zoomInX = @zoomInX
 

	
 

	
 
@@ -563,12 +566,13 @@ Polymer
 
      @graph.applyAndSendPatch(patch)
 
    
 
  addHandler: ->
 
    @graph.runHandler(@update.bind(@))
 
    
 
  update: ->
 
    console.time('attrs update')
 
    U = (x) -> @graph.Uri(x)
 
    @effect = @graph.uriValue(@uri, U(':effectClass'))
 
    @effectLabel = @effect.replace(/.*\//, '')
 
    @noteLabel = @uri.replace(/.*\//, '')
 

	
 
    @existingColorScaleSetting = null
 
@@ -579,12 +583,13 @@ Polymer
 
        @colorScaleFromGraph = value
 
        @colorScale = value
 
        @existingColorScaleSetting = setting
 
    if @existingColorScaleSetting == null
 
      @colorScaleFromGraph = '#ffffff'
 
      @colorScale = '#ffffff'
 
    console.timeEnd('attrs update')
 

	
 

	
 
  onDel: ->
 
    patch = {delQuads: [{subject: @song, predicate: @graph.Uri(':note'), object: @uri, graph: @song}], addQuads: []}
 
    @graph.applyAndSendPatch(patch)
 

	
0 comments (0 inline, 0 general)