Skip to content

Commit

Permalink
fix for kanban section shape
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjain0512 committed Oct 29, 2024
1 parent 9168d5d commit dffaf9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/mermaid/src/diagrams/kanban/kanbanDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ const addNode = (level: number, id: string, descr: string, type: number, shapeDa
throw new Error(`No such shape: ${doc.shape}. Shape names should be lowercase.`);
}

if (doc?.shape) {
// if shape is defined in the yaml data, use it if it is a valid shape kanbanItem or kanbanSection
if (doc?.shape && (doc.shape === 'kanbanItem' || doc.shape === 'kanbanSection')) {
node.shape = doc?.shape;
}
if (doc?.label) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ const roundedWithTitle = async (parent, node) => {

return { cluster: shapeSvg, labelBBox: bbox };
};
const kanbanSection = async (parent, node) => {
export const kanbanSection = async (parent, node) => {
log.info('Creating subgraph rect for ', node.id, node);
const siteConfig = getConfig();
const { themeVariables, handDrawnSeed } = siteConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import { waveRectangle } from './shapes/waveRectangle.js';
import { windowPane } from './shapes/windowPane.js';
import { classBox } from './shapes/classBox.js';
import { kanbanItem } from './shapes/kanbanItem.js';
import { kanbanSection } from './clusters.js';

type ShapeHandler = <T extends SVGGraphicsElement>(
parent: D3Selection<T>,
Expand Down Expand Up @@ -478,6 +479,7 @@ const generateShapeMap = () => {
iconRounded,
imageSquare,
kanbanItem,
kanbanSection,
anchor,
} as const;

Expand Down

0 comments on commit dffaf9f

Please sign in to comment.