Skip to content

Commit

Permalink
#5237 Fixes from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Aug 9, 2024
1 parent c2a479a commit 729080f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
1 change: 0 additions & 1 deletion cypress/platform/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ function b64ToUtf8(str) {

// Adds a rendered flag to window when rendering is done, so cypress can wait for it.
function markRendered() {
console.log('Done rendering');
if (window.Cypress) {
window.rendered = true;
}
Expand Down
13 changes: 0 additions & 13 deletions packages/mermaid/src/diagrams/block/blockRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ import type { BlockDB } from './blockDB.js';
import { layout } from './layout.js';
import { calculateBlockSizes, insertBlocks, insertEdges } from './renderHelpers.js';

/**
* Returns the all the styles from classDef statements in the graph definition.
*
* @param text - The text with the classes
* @param diagObj - The diagram object
* @returns ClassDef - The styles
*/
export const getClasses = function (text: any, diagObj: any) {
return diagObj.db.getClasses();
};
Expand Down Expand Up @@ -45,8 +38,6 @@ export const draw = async function (
const markers = ['point', 'circle', 'cross'];

// Add the marker definitions to the svg as marker tags
// insertMarkers(svg, markers, diagObj.type, diagObj.arrowMarkerAbsolute);
// insertMarkers(svg, markers, diagObj.type, true);
insertMarkers(svg, markers, diagObj.type, id);

const bl = db.getBlocks();
Expand All @@ -59,11 +50,7 @@ export const draw = async function (
await insertBlocks(nodes, bl, db);
await insertEdges(nodes, edges, blArr, db, id);

// log.debug('Here', bl);

// Establish svg dimensions and get width and height
//
// const bounds2 = nodes.node().getBoundingClientRect();
// Why, oh why ????
if (bounds) {
const bounds2 = bounds;
Expand Down
6 changes: 0 additions & 6 deletions packages/mermaid/src/diagrams/state/dataFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ const getDir = (parsedItem, defaultDir = DEFAULT_NESTED_DOC_DIR) => {
return dir;
};

/**
*
* @param nodes
* @param nodeData
* @param classes
*/
function insertOrUpdateNode(nodes, nodeData, classes) {
if (!nodeData.id || nodeData.id === '</join></fork>' || nodeData.id === '</choice>') {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ const rect = async (parent, node) => {
// Create the label and insert it after the rect
const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label ');

// const text = label
// .node()
// .appendChild(createLabel(node.label, node.labelStyle, undefined, true));
const text = await createText(labelEl, node.label, {
style: node.labelStyle,
useHtmlLabels,
Expand All @@ -53,10 +50,7 @@ const rect = async (parent, node) => {
dv.attr('height', bbox.height);
}

const padding = 0 * node.padding;

const width =
(node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width) + padding;
const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
if (node.width <= bbox.width + node.padding) {
node.diff = (width - node.width) / 2 - node.padding;
} else {
Expand All @@ -66,7 +60,6 @@ const rect = async (parent, node) => {
const height = node.height;
const x = node.x - width / 2;
const y = node.y - height / 2;
// console.log('UIO diff 2', node.id, node.diff, 'totalWidth: ', width);

log.trace('Data ', node, JSON.stringify(node));
let rect;
Expand All @@ -82,7 +75,6 @@ const rect = async (parent, node) => {
seed: handdrawnSeed,
});
const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, 0), options);
// console.log('Rough node insert CXC', roughNode);
rect = shapeSvg.insert(() => {
log.debug('Rough node insert CXC', roughNode);
return roughNode;
Expand Down

0 comments on commit 729080f

Please sign in to comment.