|
|
@@ -22,7 +22,7 @@ export function deltaGraphReducer(prevState: DeltaGraphState, action: DeltaGraph
|
|
|
links: prevState.links.map(l => {
|
|
|
if (l.source.id === deltaId || l.target.id === deltaId) {
|
|
|
if (l.bidirectional) {
|
|
|
- return conflictToDepGraphLink(l.source.obj, l.target.obj);
|
|
|
+ return conflictToDepGraphLink(l.source.obj, l.target.obj, l.label);
|
|
|
} else {
|
|
|
return dependencyToDepGraphLink(l.source.obj, l.target.obj, l.label);
|
|
|
}
|
|
|
@@ -39,7 +39,7 @@ export function deltaGraphReducer(prevState: DeltaGraphState, action: DeltaGraph
|
|
|
links: prevState.links.map(l => {
|
|
|
if (l.source.id === deltaId || l.target.id === deltaId) {
|
|
|
if (l.bidirectional) {
|
|
|
- return conflictToDepGraphLink(l.source.obj, l.target.obj);
|
|
|
+ return conflictToDepGraphLink(l.source.obj, l.target.obj, l.label);
|
|
|
} else {
|
|
|
return dependencyToDepGraphLink(l.source.obj, l.target.obj, l.label);
|
|
|
}
|
|
|
@@ -60,7 +60,9 @@ export function deltaGraphReducer(prevState: DeltaGraphState, action: DeltaGraph
|
|
|
// for every dependency and conflict, add a link:
|
|
|
links: prevState.links.concat(
|
|
|
...delta.getDependencies().map(([dep,depSummary]) => dependencyToDepGraphLink(delta, dep, depSummary)),
|
|
|
- ...delta.conflictsWith.filter(([conflictingDelta]) => prevState.nodes.some(n => n.id === fullDeltaId(conflictingDelta))).map(([conflictingDelta]) => conflictToDepGraphLink(delta, conflictingDelta)),
|
|
|
+ ...delta.conflictsWith
|
|
|
+ .filter(([conflictingDelta]) => prevState.nodes.some(n => n.id === fullDeltaId(conflictingDelta)))
|
|
|
+ .map(([conflictingDelta, kind]) => conflictToDepGraphLink(delta, conflictingDelta, kind)),
|
|
|
),
|
|
|
};
|
|
|
}
|
|
|
@@ -92,10 +94,10 @@ function dependencyToDepGraphLink(fromDelta: Delta, toDelta: Delta, label: strin
|
|
|
obj: null,
|
|
|
};
|
|
|
}
|
|
|
-function conflictToDepGraphLink(fromDelta: Delta, toDelta: Delta): D3LinkData<null> {
|
|
|
+function conflictToDepGraphLink(fromDelta: Delta, toDelta: Delta, kind: string): D3LinkData<null> {
|
|
|
return {
|
|
|
source: fullDeltaId(fromDelta),
|
|
|
- label: "",
|
|
|
+ label: kind,
|
|
|
color: 'red',
|
|
|
bidirectional: true,
|
|
|
target: fullDeltaId(toDelta),
|