mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
Do explicit imports for d3 instead of wildcards
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import graphlib from 'graphlib';
|
||||
import * as d3 from 'd3';
|
||||
import { line, curveBasis, select } from 'd3';
|
||||
import erDb from './erDb';
|
||||
import erParser from './parser/erDiagram';
|
||||
import dagre from 'dagre';
|
||||
@@ -136,15 +136,14 @@ const drawRelationshipFromLayout = function(svg, rel, g, insert) {
|
||||
const edge = g.edge(rel.entityA, rel.entityB, getEdgeName(rel));
|
||||
|
||||
// Get a function that will generate the line path
|
||||
const lineFunction = d3
|
||||
.line()
|
||||
const lineFunction = line()
|
||||
.x(function(d) {
|
||||
return d.x;
|
||||
})
|
||||
.y(function(d) {
|
||||
return d.y;
|
||||
})
|
||||
.curve(d3.curveBasis);
|
||||
.curve(curveBasis);
|
||||
|
||||
// Insert the line at the right place
|
||||
const svgPath = svg
|
||||
@@ -271,7 +270,7 @@ export const draw = function(text, id) {
|
||||
}
|
||||
|
||||
// Get a reference to the svg node that contains the text
|
||||
const svg = d3.select(`[id='${id}']`);
|
||||
const svg = select(`[id='${id}']`);
|
||||
|
||||
// Add cardinality marker definitions to the svg
|
||||
erMarkers.insertMarkers(svg, conf);
|
||||
|
Reference in New Issue
Block a user