# HG changeset patch # User Drew Perttula # Date 2016-06-04 09:27:38 # Node ID 8406a9fbeb9d918bc0b363fdce5412610d2b9f52 # Parent b355f8089950ca4c01ebf6e85f2bca2469879f18 note shape can be edited Ignore-this: 1d4957c88191336d7b61a7c782897f59 diff --git a/light9/web/graph.coffee b/light9/web/graph.coffee --- a/light9/web/graph.coffee +++ b/light9/web/graph.coffee @@ -15,15 +15,22 @@ class GraphWatchers unsubscribe: (subscription) -> throw Error('not implemented') + + matchingHandlers: (quad) -> + matches = [] + for subjDict in [@handlersSp[quad.subject] || {}, @handlersSp[null] || {}] + for subjPredMatches in [subjDict[quad.predicate] || [], subjDict[null] || []] + matches = matches.concat(subjPredMatches) + return matches graphChanged: (patch) -> for quad in patch.delQuads - for cb in ((@handlersSp[quad.subject] || {})[quad.predicate] || []) + for cb in @matchingHandlers(quad) # currently calls multiple times, which is ok, but we might # group things into fewer patches cb({delQuads: [quad], addQuads: []}) for quad in patch.addQuads - for cb in ((@handlersSp[quad.subject] || {})[quad.predicate] || []) + for cb in @matchingHandlers(quad) cb({delQuads: [], addQuads: [quad]}) diff --git a/light9/web/timeline-elements.html b/light9/web/timeline-elements.html --- a/light9/web/timeline-elements.html +++ b/light9/web/timeline-elements.html @@ -47,7 +47,7 @@ Zoom all .. ctrl+esc --> - +
[[debug]]
@@ -81,7 +81,7 @@ @@ -92,7 +92,9 @@ Polymer.IronResizableBehavior ], properties: { - rows: {value: [0, 1, 2, 3]}, + graph: { type: Object, notify: true }, + zoomInX: { type: Object, notify: true }, + rows: {value: [0]}, zoom: {type: Object, notify: true, observer: 'onZoom'}, zoomFlattened: {type: Object, notify: true} }, @@ -178,8 +180,8 @@ display: flex; } - @@ -194,7 +196,7 @@ :host { display: block; background: green; - outline: 2px solid red; + /* outline: 2px solid red; */ } @@ -228,16 +230,19 @@