mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
Do explicit imports for d3 instead of wildcards
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import * as d3 from 'd3';
|
||||
import { curveBasis, line, select } from 'd3';
|
||||
import _ from 'lodash';
|
||||
|
||||
import db from './gitGraphAst';
|
||||
@@ -54,10 +54,9 @@ function svgCreateDefs(svg) {
|
||||
}
|
||||
|
||||
function svgDrawLine(svg, points, colorIdx, interpolate) {
|
||||
const curve = interpolateToCurve(interpolate, d3.curveBasis);
|
||||
const curve = interpolateToCurve(interpolate, curveBasis);
|
||||
const color = config.branchColors[colorIdx % config.branchColors.length];
|
||||
const lineGen = d3
|
||||
.line()
|
||||
const lineGen = line()
|
||||
.x(function(d) {
|
||||
return Math.round(d.x);
|
||||
})
|
||||
@@ -318,7 +317,7 @@ export const draw = function(txt, id, ver) {
|
||||
config.nodeLabel.width = '100%';
|
||||
config.nodeLabel.y = -1 * 2 * config.nodeRadius;
|
||||
}
|
||||
const svg = d3.select(`[id="${id}"]`);
|
||||
const svg = select(`[id="${id}"]`);
|
||||
svgCreateDefs(svg);
|
||||
branchNum = 1;
|
||||
for (let branch in branches) {
|
||||
|
Reference in New Issue
Block a user