Bug fixes in new functionality, intersections not taken into account in nodes used by new graph engine. Graph flowchart not usable when integrating using mermaid.core. Incorrect flwochart docs

This commit is contained in:
Knut Sveidqvist
2020-05-16 19:58:22 +02:00
parent 0ac48a431a
commit c21b61bbd2
6 changed files with 70 additions and 54 deletions

View File

@@ -1,6 +1,6 @@
import { logger } from '../logger'; // eslint-disable-line
import createLabel from './createLabel';
import { line, curveBasis } from 'd3';
import { line, svg, curveBasis } from 'd3';
import { getConfig } from '../config';
let edgeLabels = {};
@@ -100,8 +100,19 @@ const intersection = (node, outsidePoint, insidePoint) => {
}
};
export const insertEdge = function(elem, edge, clusterDb, diagramType) {
//(edgePaths, e, edge, clusterDb, diagramtype, graph)
export const insertEdge = function(elem, e, edge, clusterDb, diagramType, graph) {
let points = edge.points;
const tail = graph.node(e.v);
var head = graph.node(e.w);
if (head.intersect && tail.intersect) {
points = points.slice(1, edge.points.length - 1);
points.unshift(tail.intersect(points[0]));
points.push(head.intersect(points[points.length - 1]));
}
if (edge.toCluster) {
logger.trace('edge', edge);
logger.trace('to cluster', clusterDb[edge.toCluster]);