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,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) {