diff --git a/src/dagre-wrapper/edges.js b/src/dagre-wrapper/edges.js index 053f9fd61..9ef273f3b 100644 --- a/src/dagre-wrapper/edges.js +++ b/src/dagre-wrapper/edges.js @@ -350,6 +350,15 @@ export const insertEdge = function(elem, e, edge, clusterDb, diagramType, graph) const lineData = points.filter(p => !Number.isNaN(p.y)); // This is the accessor function we talked about above + let curve; + // Currently only flowcharts get the curve from the settings, perhaps this should + // be expanded to a common setting? Restricting it for now in order not to cause side-effects that + // have not been thought through + if (diagramType === 'graph' || diagramType === 'flowchart') { + curve = edge.curve || curveBasis; + } else { + curve = curveBasis; + } const lineFunction = line() .x(function(d) { return d.x; @@ -357,7 +366,7 @@ export const insertEdge = function(elem, e, edge, clusterDb, diagramType, graph) .y(function(d) { return d.y; }) - .curve(curveBasis); + .curve(curve); // Contruct stroke classes based on properties let strokeClasses; diff --git a/src/defaultConfig.js b/src/defaultConfig.js index 5b9b1e02b..ccf4a6257 100644 --- a/src/defaultConfig.js +++ b/src/defaultConfig.js @@ -184,9 +184,9 @@ const config = { *| curve | Defines how mermaid renders curves for flowcharts. | String | Required | Basis, Linear, Cardinal| * ***Notes: - *Default Vaue: Linear** + *Default Vaue: monotoneX** */ - curve: 'linear', + curve: 'monotoneX', // Only used in new experimental rendering // represents the padding between the labels and the shape padding: 15, diff --git a/src/diagrams/flowchart/flowRenderer.js b/src/diagrams/flowchart/flowRenderer.js index 0fb9db297..660e6fe23 100644 --- a/src/diagrams/flowchart/flowRenderer.js +++ b/src/diagrams/flowchart/flowRenderer.js @@ -1,5 +1,5 @@ import graphlib from 'graphlib'; -import { select, curveLinear, selectAll } from 'd3'; +import { select, curveLinear, curveNatural, selectAll } from 'd3'; import flowDb from './flowDb'; import flow from './parser/flow';