diff --git a/.eslintrc.json b/.eslintrc.json index 0da42ae61..02753280c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -63,6 +63,13 @@ "rules": { "no-console": "off" } + }, + { + "files": ["./**/*.spec.{ts,js}", "./cypress/**", "./demos/**", "./**/docs/**"], + "rules": { + "jsdoc/require-jsdoc": "off", + "@typescript-eslint/no-unused-vars": "off" + } } ] } diff --git a/package.json b/package.json index dba242133..09da30b01 100644 --- a/package.json +++ b/package.json @@ -69,14 +69,14 @@ "d3": "^7.0.0", "dagre": "^0.8.5", "dagre-d3": "^0.6.4", - "dompurify": "2.3.10", + "dompurify": "2.4.0", "fast-clone": "^1.5.13", "graphlib": "^2.1.8", "khroma": "^2.0.0", "lodash": "^4.17.21", "moment-mini": "^2.24.0", "non-layered-tidy-tree-layout": "^2.0.2", - "stylis": "^4.0.10" + "stylis": "^4.1.2" }, "devDependencies": { "@applitools/eyes-cypress": "^3.25.7", diff --git a/src/dagre-wrapper/createLabel.js b/src/dagre-wrapper/createLabel.js index 631fb7645..ba0ce4a5d 100644 --- a/src/dagre-wrapper/createLabel.js +++ b/src/dagre-wrapper/createLabel.js @@ -1,11 +1,9 @@ import { select } from 'd3'; import { log } from '../logger'; import { getConfig } from '../config'; -import { sanitizeText, evaluate } from '../diagrams/common/common'; +import { evaluate } from '../diagrams/common/common'; import { decodeEntities } from '../mermaidAPI'; -const sanitizeTxt = (txt) => sanitizeText(txt, getConfig()); - /** * @param dom * @param styleFn diff --git a/src/dagre-wrapper/nodes.js b/src/dagre-wrapper/nodes.js index 344210e93..f25eb2e86 100644 --- a/src/dagre-wrapper/nodes.js +++ b/src/dagre-wrapper/nodes.js @@ -6,9 +6,7 @@ import intersect from './intersect/index.js'; import createLabel from './createLabel'; import note from './shapes/note'; import { parseMember } from '../diagrams/class/svgDraw'; -import { evaluate, sanitizeText as sanitize } from '../diagrams/common/common'; - -const sanitizeText = (txt) => sanitize(txt, getConfig()); +import { evaluate } from '../diagrams/common/common'; const question = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true); @@ -348,7 +346,7 @@ const rect = (parent, node) => { }; const labelRect = (parent, node) => { - const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'label', true); + const { shapeSvg } = labelHelper(parent, node, 'label', true); log.trace('Classes = ', node.classes); // add the rect diff --git a/src/diagrams/c4/c4Db.js b/src/diagrams/c4/c4Db.js index d53d6d31f..79028a0c5 100644 --- a/src/diagrams/c4/c4Db.js +++ b/src/diagrams/c4/c4Db.js @@ -1,6 +1,5 @@ import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; -import { log } from '../../logger'; import { sanitizeText } from '../common/common'; import { setAccTitle, getAccTitle, getAccDescription, setAccDescription } from '../../commonDb'; @@ -21,7 +20,6 @@ let boundarys = [ let rels = []; let title = ''; let wrapEnabled = false; -let description = ''; let c4ShapeInRow = 4; let c4BoundaryInRow = 2; var c4Type; @@ -636,13 +634,13 @@ export const updateLayoutConfig = function (typeC4Shape, c4ShapeInRowParam, c4Bo let c4BoundaryInRowValue = c4BoundaryInRow; if (typeof c4ShapeInRowParam === 'object') { - let [key, value] = Object.entries(c4ShapeInRowParam)[0]; + const value = Object.values(c4ShapeInRowParam)[0]; c4ShapeInRowValue = parseInt(value); } else { c4ShapeInRowValue = parseInt(c4ShapeInRowParam); } if (typeof c4BoundaryInRowParam === 'object') { - let [key, value] = Object.entries(c4BoundaryInRowParam)[0]; + const value = Object.values(c4BoundaryInRowParam)[0]; c4BoundaryInRowValue = parseInt(value); } else { c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); @@ -721,7 +719,6 @@ export const clear = function () { boundaryParseStack = ['']; title = ''; wrapEnabled = false; - description = ''; c4ShapeInRow = 4; c4BoundaryInRow = 2; }; diff --git a/src/diagrams/c4/c4Renderer.js b/src/diagrams/c4/c4Renderer.js index 409f38cbb..dceca2887 100644 --- a/src/diagrams/c4/c4Renderer.js +++ b/src/diagrams/c4/c4Renderer.js @@ -298,7 +298,7 @@ export const drawC4ShapeArray = function (currentBounds, diagram, c4ShapeArray, currentBounds.insert(c4Shape); - const height = svgDraw.drawC4Shape(diagram, c4Shape, conf); + svgDraw.drawC4Shape(diagram, c4Shape, conf); } currentBounds.bumpLastMargin(conf.c4ShapeMargin); @@ -616,7 +616,6 @@ export const draw = function (_text, id, _version, diagObj) { globalBoundaryMaxY = conf.diagramMarginY; const title = diagObj.db.getTitle(); - const c4type = diagObj.db.getC4Type(); let currentBoundarys = diagObj.db.getBoundarys(''); // switch (c4type) { // case 'C4Context': diff --git a/src/diagrams/c4/svgDraw.js b/src/diagrams/c4/svgDraw.js index c67fb2649..5666d9f84 100644 --- a/src/diagrams/c4/svgDraw.js +++ b/src/diagrams/c4/svgDraw.js @@ -1,5 +1,4 @@ import common from '../common/common'; -import { addFunction } from '../../interactionDb'; import { sanitizeUrl } from '@braintree/sanitize-url'; export const drawRect = function (elem, rectData) { diff --git a/src/diagrams/class/classRenderer-v2.js b/src/diagrams/class/classRenderer-v2.js index a211ab552..20722e6d0 100644 --- a/src/diagrams/class/classRenderer-v2.js +++ b/src/diagrams/class/classRenderer-v2.js @@ -3,7 +3,6 @@ import graphlib from 'graphlib'; import { log } from '../../logger'; import { getConfig } from '../../config'; import { render } from '../../dagre-wrapper/index.js'; -// import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js'; import { curveLinear } from 'd3'; import { interpolateToCurve, getStylesFromArray } from '../../utils'; import { setupGraphViewbox } from '../../setupGraphViewbox'; @@ -11,7 +10,6 @@ import common from '../common/common'; import addSVGAccessibilityFields from '../../accessibility'; let idCache = {}; -const padding = 20; const sanitizeText = (txt) => common.sanitizeText(txt, getConfig()); @@ -235,20 +233,6 @@ export const addRelations = function (relations, g) { }); }; -/** - * Gets the ID with the same label as in the cache - * - * @param {string} label The label to look for - * @returns {string} The resulting ID - */ -const getGraphId = function (label) { - const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label); - - if (foundEntry) { - return foundEntry[0]; - } -}; - /** * Merges the value of `conf` with the passed `cnf` * diff --git a/src/diagrams/class/classRenderer.js b/src/diagrams/class/classRenderer.js index 6536cb5a1..c1236afea 100644 --- a/src/diagrams/class/classRenderer.js +++ b/src/diagrams/class/classRenderer.js @@ -10,12 +10,6 @@ import addSVGAccessibilityFields from '../../accessibility'; let idCache = {}; const padding = 20; -const confa = { - dividerMargin: 10, - padding: 5, - textHeight: 10, -}; - /** * Gets the ID with the same label as in the cache * @@ -163,7 +157,6 @@ export const draw = function (text, id, _version, diagObj) { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Fetch the default direction, use TD if none was found const diagram = root.select(`[id='${id}']`); diff --git a/src/diagrams/er/erDb.js b/src/diagrams/er/erDb.js index 856d54979..ad3454f84 100644 --- a/src/diagrams/er/erDb.js +++ b/src/diagrams/er/erDb.js @@ -1,7 +1,7 @@ import { log } from '../../logger'; import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; -import common from '../common/common'; + import { setAccTitle, getAccTitle, @@ -12,8 +12,6 @@ import { let entities = {}; let relationships = []; -let title = ''; -let description = ''; const Cardinality = { ZERO_OR_ONE: 'ZERO_OR_ONE', @@ -78,7 +76,6 @@ const getRelationships = () => relationships; const clear = function () { entities = {}; relationships = []; - title = ''; commonClear(); }; diff --git a/src/diagrams/flowchart/flowRenderer.js b/src/diagrams/flowchart/flowRenderer.js index 5b14330dd..0c3aa3623 100644 --- a/src/diagrams/flowchart/flowRenderer.js +++ b/src/diagrams/flowchart/flowRenderer.js @@ -29,8 +29,6 @@ export const setConf = function (cnf) { * @param diagObj */ export const addVertices = function (vert, g, svgId, root, _doc, diagObj) { - const securityLevel = getConfig().securityLevel; - const svg = !root ? select(`[id="${svgId}"]`) : root.select(`[id="${svgId}"]`); const doc = !_doc ? document : _doc; const keys = Object.keys(vert); diff --git a/src/diagrams/gantt/ganttDb.js b/src/diagrams/gantt/ganttDb.js index f6a526759..5d072b903 100644 --- a/src/diagrams/gantt/ganttDb.js +++ b/src/diagrams/gantt/ganttDb.js @@ -4,7 +4,7 @@ import { log } from '../../logger'; import * as configApi from '../../config'; import utils from '../../utils'; import mermaidAPI from '../../mermaidAPI'; -import common from '../common/common'; + import { setAccTitle, getAccTitle, @@ -21,8 +21,6 @@ let todayMarker = ''; let includes = []; let excludes = []; let links = {}; -let title = ''; -let accDescription = ''; let sections = []; let tasks = []; let currentSection = ''; @@ -34,10 +32,6 @@ let topAxis = false; // The serial order of the task in the script let lastOrder = 0; -const sanitizeText = function (txt) { - return common.sanitizeText(txt, configApi.getConfig()); -}; - export const parseDirective = function (statement, context, type) { mermaidAPI.parseDirective(this, statement, context, type); }; @@ -47,7 +41,6 @@ export const clear = function () { tasks = []; currentSection = ''; funs = []; - title = ''; taskCnt = 0; lastTask = undefined; lastTaskID = undefined; @@ -247,7 +240,8 @@ const getStartDate = function (prevTime, dateFormat, str) { * - `ms` for milliseconds * * @param {string} str - A string representing the duration. - * @returns {moment.Duration} A moment duration, including an invalid moment for invalid input string. + * @returns {moment.Duration} A moment duration, including an invalid moment for invalid input + * string. */ const parseDuration = function (str) { const statement = /^(\d+(?:\.\d+)?)([yMwdhms]|ms)$/.exec(str.trim()); diff --git a/src/diagrams/gantt/ganttRenderer.js b/src/diagrams/gantt/ganttRenderer.js index 5a24d6d3f..3b12bc191 100644 --- a/src/diagrams/gantt/ganttRenderer.js +++ b/src/diagrams/gantt/ganttRenderer.js @@ -391,7 +391,6 @@ export const draw = function (text, id, version, diagObj) { if (securityLevel === 'sandbox') { let sandboxElement; sandboxElement = select('#i' + id); - const root = select(sandboxElement.nodes()[0].contentDocument.body); const doc = sandboxElement.nodes()[0].contentDocument; rectangles diff --git a/src/diagrams/git/gitGraphRenderer.js b/src/diagrams/git/gitGraphRenderer.js index aa8c76d29..68905c0d2 100644 --- a/src/diagrams/git/gitGraphRenderer.js +++ b/src/diagrams/git/gitGraphRenderer.js @@ -5,7 +5,6 @@ import { getConfig } from '../../config'; import addSVGAccessibilityFields from '../../accessibility'; let allCommitsDict = {}; -let branchNum; const commitType = { NORMAL: 0, @@ -83,7 +82,7 @@ const drawCommits = (svg, commits, modifyGraph) => { const sortedKeys = keys.sort((a, b) => { return commits[a].seq - commits[b].seq; }); - sortedKeys.forEach((key, index) => { + sortedKeys.forEach((key) => { const commit = commits[key]; const y = branchPos[commit.branch].pos; @@ -292,18 +291,15 @@ const drawCommits = (svg, commits, modifyGraph) => { }; /** - * Detect if there are other commits between commit1's x-position and commit2's x-position on the same - * branch as commit2. + * Detect if there are other commits between commit1's x-position and commit2's x-position on the + * same branch as commit2. * * @param {any} commit1 * @param {any} commit2 * @param allCommits - * @returns {boolean} if there are commits between commit1's x-position and commit2's x-position + * @returns {boolean} If there are commits between commit1's x-position and commit2's x-position */ const hasOverlappingCommits = (commit1, commit2, allCommits) => { - const commit1Pos = commitPos[commit2.id]; - const commit2Pos = commitPos[commit1.id]; - // Find commits on the same branch as commit2 const keys = Object.keys(allCommits); const overlappingComits = keys.filter((key) => { @@ -324,7 +320,7 @@ const hasOverlappingCommits = (commit1, commit2, allCommits) => { * @param {any} y1 * @param {any} y2 * @param {any} _depth - * @returns {number} y value between y1 and y2 + * @returns {number} Y value between y1 and y2 */ const findLane = (y1, y2, _depth) => { const depth = _depth || 0; @@ -357,25 +353,11 @@ const findLane = (y1, y2, _depth) => { * @param {any} allCommits */ const drawArrow = (svg, commit1, commit2, allCommits) => { - const conf = getConfig(); - const p1 = commitPos[commit1.id]; const p2 = commitPos[commit2.id]; const overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits); // log.debug('drawArrow', p1, p2, overlappingCommits, commit1.id, commit2.id); - let url = ''; - if (conf.arrowMarkerAbsolute) { - url = - window.location.protocol + - '//' + - window.location.host + - window.location.pathname + - window.location.search; - url = url.replace(/\(/g, '\\('); - url = url.replace(/\)/g, '\\)'); - } - let arc = ''; let arc2 = ''; let radius = 0; @@ -433,7 +415,7 @@ const drawArrow = (svg, commit1, commit2, allCommits) => { } ${p2.y}`; } } - const arrow = svg + svg .append('path') .attr('d', lineDef) .attr('class', 'arrow arrow' + (colorClassNum % THEME_COLOR_LIMIT)); @@ -441,10 +423,7 @@ const drawArrow = (svg, commit1, commit2, allCommits) => { const drawArrows = (svg, commits) => { const gArrows = svg.append('g').attr('class', 'commit-arrows'); - let pos = 0; - - const k = Object.keys(commits); - k.forEach((key, index) => { + Object.keys(commits).forEach((key) => { const commit = commits[key]; if (commit.parents && commit.parents.length > 0) { commit.parents.forEach((parent) => { diff --git a/src/diagrams/info/infoRenderer.js b/src/diagrams/info/infoRenderer.js index 9e81b9ffb..b50178481 100644 --- a/src/diagrams/info/infoRenderer.js +++ b/src/diagrams/info/infoRenderer.js @@ -27,7 +27,6 @@ export const draw = (text, id, version, diagObj) => { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Parse the graph definition // parser.parse(text); diff --git a/src/diagrams/mindmap/mindmapRenderer.js b/src/diagrams/mindmap/mindmapRenderer.js index caa8baedb..1519dc406 100644 --- a/src/diagrams/mindmap/mindmapRenderer.js +++ b/src/diagrams/mindmap/mindmapRenderer.js @@ -2,7 +2,7 @@ import { select } from 'd3'; import { log, getConfig, setupGraphViewbox } from '../../diagram-api/diagramAPI'; import svgDraw from './svgDraw'; -import { BoundingBox, Layout, Tree } from 'non-layered-tidy-tree-layout'; +import { BoundingBox, Layout } from 'non-layered-tidy-tree-layout'; import clone from 'fast-clone'; import * as db from './mindmapDb'; @@ -192,8 +192,7 @@ function layoutMindmap(node, conf) { }); // Merge the trees into a single tree - const result = mergeTrees(node, trees); - eachNode; + mergeTrees(node, trees); return node; } /** @@ -232,13 +231,11 @@ export const draw = (text, id, version, diagObj) => { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; - // Parse the graph definition const svg = root.select('#' + id); - const g = svg.append('g'); + svg.append('g'); const mm = diagObj.db.getMindmap(); // Draw the graph and start with drawing the nodes without proper position diff --git a/src/diagrams/mindmap/styles.js b/src/diagrams/mindmap/styles.js index 76d6a9c1b..f6afaa612 100644 --- a/src/diagrams/mindmap/styles.js +++ b/src/diagrams/mindmap/styles.js @@ -1,4 +1,4 @@ -import { darken, lighten, adjust, invert, isDark } from 'khroma'; +import { darken, lighten, isDark } from 'khroma'; const genSections = (options) => { let sections = ''; diff --git a/src/diagrams/pie/pieDb.js b/src/diagrams/pie/pieDb.js index def0242a3..8ef4d9efc 100644 --- a/src/diagrams/pie/pieDb.js +++ b/src/diagrams/pie/pieDb.js @@ -13,8 +13,6 @@ import { } from '../../commonDb'; let sections = {}; -let title = ''; -let description = ''; let showData = false; export const parseDirective = function (statement, context, type) { @@ -49,7 +47,6 @@ const cleanupValue = function (value) { const clear = function () { sections = {}; - title = ''; showData = false; commonClear(); }; diff --git a/src/diagrams/requirement/requirementDb.js b/src/diagrams/requirement/requirementDb.js index f78bd5509..9d48f0b2d 100644 --- a/src/diagrams/requirement/requirementDb.js +++ b/src/diagrams/requirement/requirementDb.js @@ -1,7 +1,7 @@ import * as configApi from '../../config'; import { log } from '../../logger'; import mermaidAPI from '../../mermaidAPI'; -import common from '../common/common'; + import { setAccTitle, getAccTitle, @@ -15,10 +15,6 @@ let latestRequirement = {}; let requirements = {}; let latestElement = {}; let elements = {}; -let title = ''; -let accDescription = ''; - -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); const RequirementType = { REQUIREMENT: 'Requirement', diff --git a/src/diagrams/requirement/requirementRenderer.js b/src/diagrams/requirement/requirementRenderer.js index 7a43edaee..d10c43066 100644 --- a/src/diagrams/requirement/requirementRenderer.js +++ b/src/diagrams/requirement/requirementRenderer.js @@ -320,7 +320,6 @@ export const draw = (text, id, _version, diagObj) => { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; const svg = root.select(`[id='${id}']`); markers.insertLineEndings(svg, conf); diff --git a/src/diagrams/sequence/sequenceDb.js b/src/diagrams/sequence/sequenceDb.js index 7d0309127..6c863e204 100644 --- a/src/diagrams/sequence/sequenceDb.js +++ b/src/diagrams/sequence/sequenceDb.js @@ -16,8 +16,6 @@ let prevActor = undefined; let actors = {}; let messages = []; const notes = []; -let diagramTitle = ''; -let description = ''; let sequenceNumbersEnabled = false; let wrapEnabled; @@ -153,7 +151,6 @@ export const clear = function () { actors = {}; messages = []; sequenceNumbersEnabled = false; - diagramTitle = ''; commonClear(); }; diff --git a/src/diagrams/state/stateDb.js b/src/diagrams/state/stateDb.js index 7092cf1d6..96f92af8a 100644 --- a/src/diagrams/state/stateDb.js +++ b/src/diagrams/state/stateDb.js @@ -11,8 +11,6 @@ import { clear as commonClear, } from '../../commonDb'; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); - const clone = (o) => JSON.parse(JSON.stringify(o)); let rootDoc = []; @@ -121,10 +119,6 @@ let documents = { let currentDocument = documents.root; let startCnt = 0; -let endCnt = 0; // let stateCnt = 0; - -let title = 'State diagram'; -let description = ''; /** * Function called by parser when a node definition has been found. @@ -179,7 +173,6 @@ export const clear = function (saveCommon) { currentDocument = documents.root; startCnt = 0; - endCnt = 0; classes = []; if (!saveCommon) { commonClear(); @@ -211,7 +204,6 @@ export const addRelation = function (_id1, _id2, title) { type1 = 'start'; } if (_id2 === '[*]') { - endCnt++; id2 = 'end' + startCnt; type2 = 'end'; } diff --git a/src/diagrams/state/stateRenderer-v2.js b/src/diagrams/state/stateRenderer-v2.js index 4452f9491..13c474b5e 100644 --- a/src/diagrams/state/stateRenderer-v2.js +++ b/src/diagrams/state/stateRenderer-v2.js @@ -283,7 +283,6 @@ export const draw = function (text, id, _version, diag) { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; const svg = root.select(`[id="${id}"]`); // Run the renderer. This is what draws the final graph. diff --git a/src/diagrams/user-journey/journeyDb.js b/src/diagrams/user-journey/journeyDb.js index d8f27b93c..0707636f5 100644 --- a/src/diagrams/user-journey/journeyDb.js +++ b/src/diagrams/user-journey/journeyDb.js @@ -1,6 +1,5 @@ import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; -import common from '../common/common'; import { setAccTitle, getAccTitle, @@ -11,10 +10,6 @@ import { clear as commonClear, } from '../../commonDb'; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); - -let title = ''; -let description = ''; let currentSection = ''; const sections = []; @@ -29,8 +24,6 @@ export const clear = function () { sections.length = 0; tasks.length = 0; currentSection = ''; - title = ''; - description = ''; rawTasks.length = 0; commonClear(); }; diff --git a/src/utils.ts b/src/utils.ts index 097980d8c..2ce56ab49 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -40,7 +40,6 @@ const directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; const directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; -const anyComment = /\s*%%.*\n/gm; /** * @function detectInit Detects the init config object from the text @@ -308,7 +307,6 @@ const calcLabelPosition = (points) => { const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => { let prevPoint; - let totalDistance = 0; log.info('our points', points); if (points[0] !== initialPosition) { points = points.reverse(); @@ -368,7 +366,6 @@ const calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => { // Todo looking to faster cloning method let points = JSON.parse(JSON.stringify(_points)); let prevPoint; - let totalDistance = 0; log.info('our points', points); if (position !== 'start_left' && position !== 'start_right') { points = points.reverse(); @@ -707,19 +704,6 @@ export const calculateTextDimensions = memoize( (text, config) => `${text}${config.fontSize}${config.fontWeight}${config.fontFamily}` ); -/** - * Applys d3 attributes - * - * @param {any} d3Elem D3 Element to apply the attributes onto - * @param {[string, string][]} attrs Object.keys equivalent format of key to value mapping of - * attributes - */ -const d3Attrs = function (d3Elem, attrs) { - for (const attr of attrs) { - d3Elem.attr(attr[0], attr[1]); - } -}; - export const initIdGenerator = class iterator { constructor(deterministic, seed) { this.deterministic = deterministic; diff --git a/yarn.lock b/yarn.lock index 82e7fd706..4488e6c4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4955,10 +4955,10 @@ domhandler@^5.0.1, domhandler@^5.0.2: dependencies: domelementtype "^2.3.0" -dompurify@2.3.10: - version "2.3.10" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.10.tgz#901f7390ffe16a91a5a556b94043314cd4850385" - integrity sha512-o7Fg/AgC7p/XpKjf/+RC3Ok6k4St5F7Q6q6+Nnm3p2zGWioAY6dh0CbbuwOhH2UcSzKsdniE/YnE2/92JcsA+g== +dompurify@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.0.tgz#c9c88390f024c2823332615c9e20a453cf3825dd" + integrity sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA== domutils@^3.0.1: version "3.0.1" @@ -10789,10 +10789,10 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -stylis@^4.0.10: - version "4.1.1" - resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.1.tgz#e46c6a9bbf7c58db1e65bb730be157311ae1fe12" - integrity sha512-lVrM/bNdhVX2OgBFNa2YJ9Lxj7kPzylieHd3TNjuGE0Re9JB7joL5VUKOVH1kdNNJTgGPpT8hmwIAPLaSyEVFQ== +stylis@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.2.tgz#870b3c1c2275f51b702bb3da9e94eedad87bba41" + integrity sha512-Nn2CCrG2ZaFziDxaZPN43CXqn+j7tcdjPFCkRBkFue8QYXC2HdEwnw5TCBo4yQZ2WxKYeSi0fdoOrtEqgDrXbA== subarg@^1.0.0: version "1.0.0"