mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-08 14:54:08 +01:00
chore: Fix typos, remove unused docs
This commit is contained in:
@@ -1,25 +1,14 @@
|
|||||||
import { log } from '$root/logger.js';
|
|
||||||
import createLabel from './createLabel.js';
|
|
||||||
import { createText } from '$root/rendering-util/createText.ts';
|
|
||||||
import {
|
|
||||||
line,
|
|
||||||
curveBasis,
|
|
||||||
curveLinear,
|
|
||||||
curveNatural,
|
|
||||||
curveCardinal,
|
|
||||||
curveStep,
|
|
||||||
select,
|
|
||||||
curveMonotoneX,
|
|
||||||
curveMonotoneY,
|
|
||||||
curveCatmullRom,
|
|
||||||
} from 'd3';
|
|
||||||
import { getConfig } from '$root/diagram-api/diagramAPI.js';
|
import { getConfig } from '$root/diagram-api/diagramAPI.js';
|
||||||
import utils from '$root/utils.js';
|
|
||||||
import { evaluate } from '$root/diagrams/common/common.js';
|
import { evaluate } from '$root/diagrams/common/common.js';
|
||||||
|
import { log } from '$root/logger.js';
|
||||||
|
import { createText } from '$root/rendering-util/createText.ts';
|
||||||
|
import utils from '$root/utils.js';
|
||||||
import { getLineFunctionsWithOffset } from '$root/utils/lineWithOffset.js';
|
import { getLineFunctionsWithOffset } from '$root/utils/lineWithOffset.js';
|
||||||
import { getSubGraphTitleMargins } from '$root/utils/subGraphTitleMargins.js';
|
import { getSubGraphTitleMargins } from '$root/utils/subGraphTitleMargins.js';
|
||||||
import { addEdgeMarkers } from './edgeMarker.ts';
|
import { curveBasis, line, select } from 'd3';
|
||||||
import rough from 'roughjs';
|
import rough from 'roughjs';
|
||||||
|
import createLabel from './createLabel.js';
|
||||||
|
import { addEdgeMarkers } from './edgeMarker.ts';
|
||||||
//import type { Edge } from '$root/rendering-util/types.d.ts';
|
//import type { Edge } from '$root/rendering-util/types.d.ts';
|
||||||
|
|
||||||
let edgeLabels = {};
|
let edgeLabels = {};
|
||||||
@@ -339,23 +328,23 @@ export const intersection = (node, outsidePoint, insidePoint) => {
|
|||||||
* and return an update path ending by the border of the node.
|
* and return an update path ending by the border of the node.
|
||||||
*
|
*
|
||||||
* @param {Array} _points
|
* @param {Array} _points
|
||||||
* @param {any} boundryNode
|
* @param {any} boundaryNode
|
||||||
* @returns {Array} Points
|
* @returns {Array} Points
|
||||||
*/
|
*/
|
||||||
const cutPathAtIntersect = (_points, boundryNode) => {
|
const cutPathAtIntersect = (_points, boundaryNode) => {
|
||||||
log.warn('abc88 cutPathAtIntersect', _points, boundryNode);
|
log.warn('abc88 cutPathAtIntersect', _points, boundaryNode);
|
||||||
let points = [];
|
let points = [];
|
||||||
let lastPointOutside = _points[0];
|
let lastPointOutside = _points[0];
|
||||||
let isInside = false;
|
let isInside = false;
|
||||||
_points.forEach((point) => {
|
_points.forEach((point) => {
|
||||||
// const node = clusterDb[edge.toCluster].node;
|
// const node = clusterDb[edge.toCluster].node;
|
||||||
log.info('abc88 checking point', point, boundryNode);
|
log.info('abc88 checking point', point, boundaryNode);
|
||||||
|
|
||||||
// check if point is inside the boundary rect
|
// check if point is inside the boundary rect
|
||||||
if (!outsideNode(boundryNode, point) && !isInside) {
|
if (!outsideNode(boundaryNode, point) && !isInside) {
|
||||||
// First point inside the rect found
|
// First point inside the rect found
|
||||||
// Calc the intersection coord between the point anf the last point outside the rect
|
// Calc the intersection coord between the point anf the last point outside the rect
|
||||||
const inter = intersection(boundryNode, lastPointOutside, point);
|
const inter = intersection(boundaryNode, lastPointOutside, point);
|
||||||
log.warn('abc88 inside', point, lastPointOutside, inter);
|
log.warn('abc88 inside', point, lastPointOutside, inter);
|
||||||
log.warn('abc88 intersection', inter);
|
log.warn('abc88 intersection', inter);
|
||||||
|
|
||||||
@@ -450,7 +439,7 @@ const findAdjacentPoint = function (pointA, pointB, distance) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given an array of points, this function will return a new array of points where the cornershave been removed and replaced with
|
* Given an array of points, this function will return a new array of points where the corners have been removed and replaced with
|
||||||
* adjacent points in each direction. SO a corder will be replaced with a point before and the point after the corner.
|
* adjacent points in each direction. SO a corder will be replaced with a point before and the point after the corner.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -7,56 +7,49 @@ import { getConfig } from '$root/diagram-api/diagramAPI.js';
|
|||||||
import { userNodeOverrides } from '$root/rendering-util/rendering-elements/shapes/handdrawnStyles.js';
|
import { userNodeOverrides } from '$root/rendering-util/rendering-elements/shapes/handdrawnStyles.js';
|
||||||
import rough from 'roughjs';
|
import rough from 'roughjs';
|
||||||
|
|
||||||
/**
|
// function applyNodePropertyBorders(
|
||||||
*
|
// rect: d3.Selection<SVGRectElement, unknown, null, undefined>,
|
||||||
* @param rect
|
// borders: string | undefined,
|
||||||
* @param borders
|
// totalWidth: number,
|
||||||
* @param totalWidth
|
// totalHeight: number
|
||||||
* @param totalHeight
|
// ) {
|
||||||
*/
|
// if (!borders) {
|
||||||
function applyNodePropertyBorders(
|
// return;
|
||||||
rect: d3.Selection<SVGRectElement, unknown, null, undefined>,
|
// }
|
||||||
borders: string | undefined,
|
// const strokeDashArray: number[] = [];
|
||||||
totalWidth: number,
|
// const addBorder = (length: number) => {
|
||||||
totalHeight: number
|
// strokeDashArray.push(length, 0);
|
||||||
) {
|
// };
|
||||||
if (!borders) {
|
// const skipBorder = (length: number) => {
|
||||||
return;
|
// strokeDashArray.push(0, length);
|
||||||
}
|
// };
|
||||||
const strokeDashArray: number[] = [];
|
// if (borders.includes('t')) {
|
||||||
const addBorder = (length: number) => {
|
// log.debug('add top border');
|
||||||
strokeDashArray.push(length, 0);
|
// addBorder(totalWidth);
|
||||||
};
|
// } else {
|
||||||
const skipBorder = (length: number) => {
|
// skipBorder(totalWidth);
|
||||||
strokeDashArray.push(0, length);
|
// }
|
||||||
};
|
// if (borders.includes('r')) {
|
||||||
if (borders.includes('t')) {
|
// log.debug('add right border');
|
||||||
log.debug('add top border');
|
// addBorder(totalHeight);
|
||||||
addBorder(totalWidth);
|
// } else {
|
||||||
} else {
|
// skipBorder(totalHeight);
|
||||||
skipBorder(totalWidth);
|
// }
|
||||||
}
|
// if (borders.includes('b')) {
|
||||||
if (borders.includes('r')) {
|
// log.debug('add bottom border');
|
||||||
log.debug('add right border');
|
// addBorder(totalWidth);
|
||||||
addBorder(totalHeight);
|
// } else {
|
||||||
} else {
|
// skipBorder(totalWidth);
|
||||||
skipBorder(totalHeight);
|
// }
|
||||||
}
|
// if (borders.includes('l')) {
|
||||||
if (borders.includes('b')) {
|
// log.debug('add left border');
|
||||||
log.debug('add bottom border');
|
// addBorder(totalHeight);
|
||||||
addBorder(totalWidth);
|
// } else {
|
||||||
} else {
|
// skipBorder(totalHeight);
|
||||||
skipBorder(totalWidth);
|
// }
|
||||||
}
|
|
||||||
if (borders.includes('l')) {
|
|
||||||
log.debug('add left border');
|
|
||||||
addBorder(totalHeight);
|
|
||||||
} else {
|
|
||||||
skipBorder(totalHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
rect.attr('stroke-dasharray', strokeDashArray.join(' '));
|
// rect.attr('stroke-dasharray', strokeDashArray.join(' '));
|
||||||
}
|
// }
|
||||||
|
|
||||||
export const rect = async (parent: SVGAElement, node: Node) => {
|
export const rect = async (parent: SVGAElement, node: Node) => {
|
||||||
const { themeVariables, handdrawnSeed } = getConfig();
|
const { themeVariables, handdrawnSeed } = getConfig();
|
||||||
|
|||||||
Reference in New Issue
Block a user