Do explicit imports for d3 instead of wildcards

This commit is contained in:
Adrian Hall
2020-05-11 07:10:04 +01:00
parent 8ef3aee7e7
commit 053a86c0d4
20 changed files with 136 additions and 118 deletions

View File

@@ -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);