From 0d1738eda09d5988f06f2918ff363246531bb2b3 Mon Sep 17 00:00:00 2001 From: nglgzz Date: Mon, 17 Jul 2017 18:22:27 +0200 Subject: [PATCH] --amend --no-edit --- d3.bundle.js | 1 - src/parser/index.js | 5 +++-- src/utils/d3.js | 5 +++-- src/utils/subnodesToHTML.js | 4 ++-- webpack.config.js | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/d3.bundle.js b/d3.bundle.js index 832f888..60c0963 100644 --- a/d3.bundle.js +++ b/d3.bundle.js @@ -6,7 +6,6 @@ export { select, drag, event, - nest, zoom, zoomIdentity, } from 'd3'; diff --git a/src/parser/index.js b/src/parser/index.js index e104218..77402b7 100755 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -73,6 +73,7 @@ const parseNode = (node) => { url: getURL(node.title.text), fx: node.location.x, fy: node.location.y, + // eslint-disable-next-line no-use-before-define nodes: parseSubnodes(node.nodes), }; @@ -102,7 +103,7 @@ const parseNode = (node) => { * subnodes will be the same. The only difference is a color attribute on * subnodes, which has a string with a valid CSS color format. */ -const parseSubnodes = (subnodes) => ( +const parseSubnodes = subnodes => ( subnodes.map((subnode) => { const parsedSub = parseNode(subnode); @@ -165,7 +166,7 @@ walkDir(input, (map, filename) => { let trigger = map.trigger; if (splitTitle[splitTitle.length - 1].trim(' ') === trigger) { - trigger = '' + trigger = ''; } const parsedMap = { diff --git a/src/utils/d3.js b/src/utils/d3.js index 758dfb5..e51f76f 100644 --- a/src/utils/d3.js +++ b/src/utils/d3.js @@ -1,5 +1,5 @@ -import { drag, event, nest, select, zoom } from 'd3'; -import { getDimensions, getViewBox } from './dimensions'; +import { drag, event, zoom } from 'd3'; +import { getViewBox } from './dimensions'; /* * Bind data to a tag, inside a G element, inside the given root element. @@ -21,6 +21,7 @@ export const d3Connections = (svg, connections) => ( .attr('class', 'mindmap-connection') ); +/* eslint-disable no-param-reassign */ /* * Bind nodes to FOREIGNOBJECT tags on the given SVG, * and set dimensions and html. diff --git a/src/utils/subnodesToHTML.js b/src/utils/subnodesToHTML.js index 9e2ed1d..07f30b3 100644 --- a/src/utils/subnodesToHTML.js +++ b/src/utils/subnodesToHTML.js @@ -12,7 +12,7 @@ const subnodesToHTML = (subnodes, fcolor) => { color = `style="border-left-color: ${subnodes[0].color}"`; } - return subnodes.map(subnode => { + return subnodes.map((subnode) => { let href = `href="${subnode.url}"`; let emoji = categoryToIMG(subnode.category); @@ -24,7 +24,7 @@ const subnodesToHTML = (subnodes, fcolor) => { return `
${subnode.text || ''} ${emoji}
${subnodesToHTML(subnode.nodes, color)}
-
` + `; }).join(''); }; diff --git a/webpack.config.js b/webpack.config.js index c2d724c..aca6d95 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,7 +31,7 @@ module.exports = { }, resolve: { - alias: { 'd3': path.resolve(__dirname, 'dist/d3.min.js') }, + alias: { d3: path.resolve(__dirname, 'dist/d3.min.js') }, }, externals: {