chore: Minor fixes

This commit is contained in:
Sidharth Vinod 2024-05-15 21:23:33 +05:30
parent 9fc17f67c6
commit 2d241808e9
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
3 changed files with 9 additions and 8 deletions

View File

@ -54,6 +54,7 @@ presetAttributify
pyplot pyplot
redmine redmine
rehype rehype
roughjs
rscratch rscratch
sparkline sparkline
sphinxcontrib sphinxcontrib

View File

@ -1,12 +1,12 @@
import intersectRect from '../rendering-elements/intersect/intersect-rect.js';
import { log } from '$root/logger.js';
import createLabel from './createLabel.js';
import { createText } from '../createText.ts';
import { select } from 'd3';
import { getConfig } from '$root/diagram-api/diagramAPI.js'; import { getConfig } from '$root/diagram-api/diagramAPI.js';
import { evaluate } from '$root/diagrams/common/common.js'; import { evaluate } from '$root/diagrams/common/common.js';
import { log } from '$root/logger.js';
import { getSubGraphTitleMargins } from '$root/utils/subGraphTitleMargins.js'; import { getSubGraphTitleMargins } from '$root/utils/subGraphTitleMargins.js';
import { select } from 'd3';
import rough from 'roughjs'; import rough from 'roughjs';
import { createText } from '../createText.ts';
import intersectRect from '../rendering-elements/intersect/intersect-rect.js';
import createLabel from './createLabel.js';
import { createRoundedRectPathD } from './shapes/roundedRectPath.ts'; import { createRoundedRectPathD } from './shapes/roundedRectPath.ts';
const rect = (parent, node) => { const rect = (parent, node) => {
@ -71,13 +71,13 @@ const rect = (parent, node) => {
if (useHtmlLabels) { if (useHtmlLabels) {
label.attr( label.attr(
'transform', 'transform',
// This puts the labal on top of the box instead of inside it // This puts the label on top of the box instead of inside it
`translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})` `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`
); );
} else { } else {
label.attr( label.attr(
'transform', 'transform',
// This puts the labal on top of the box instead of inside it // This puts the label on top of the box instead of inside it
`translate(${node.x}, ${node.y - node.height / 2 + subGraphTitleTopMargin})` `translate(${node.x}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`
); );
} }

View File

@ -1,5 +1,5 @@
import type { SVG } from '$root/diagram-api/types.js';
import type { Mocked } from 'vitest'; import type { Mocked } from 'vitest';
import type { SVG } from '../diagram-api/types.js';
import { addEdgeMarkers } from './edgeMarker.js'; import { addEdgeMarkers } from './edgeMarker.js';
describe('addEdgeMarker', () => { describe('addEdgeMarker', () => {