diff --git a/packages/mermaid/src/diagrams/treemap/parser.ts b/packages/mermaid/src/diagrams/treemap/parser.ts index 4d71ff470..9bf4c5b10 100644 --- a/packages/mermaid/src/diagrams/treemap/parser.ts +++ b/packages/mermaid/src/diagrams/treemap/parser.ts @@ -21,7 +21,7 @@ const populate = (ast: TreemapAst, db: TreemapDB) => { type: string; value?: number; classSelector?: string; - cssCompiledStyles?: string; + cssCompiledStyles?: string[]; }[] = []; // Extract classes and styles from the treemap @@ -44,7 +44,7 @@ const populate = (ast: TreemapAst, db: TreemapDB) => { // Get styles as a string if they exist const styles = item.classSelector ? db.getStylesForClass(item.classSelector) : []; - const cssCompiledStyles = styles.length > 0 ? styles.join(';') : undefined; + const cssCompiledStyles = styles.length > 0 ? styles : undefined; const itemData = { level, diff --git a/packages/mermaid/src/diagrams/treemap/utils.ts b/packages/mermaid/src/diagrams/treemap/utils.ts index e7e7fcc5c..07c7b0140 100644 --- a/packages/mermaid/src/diagrams/treemap/utils.ts +++ b/packages/mermaid/src/diagrams/treemap/utils.ts @@ -12,7 +12,7 @@ export function buildHierarchy( type: string; value?: number; classSelector?: string; - cssCompiledStyles?: string; + cssCompiledStyles?: string[]; }[] ): TreemapNode[] { if (!items.length) { @@ -29,7 +29,7 @@ export function buildHierarchy( }; node.classSelector = item?.classSelector; if (item?.cssCompiledStyles) { - node.cssCompiledStyles = [item.cssCompiledStyles]; + node.cssCompiledStyles = item.cssCompiledStyles; } if (item.type === 'Leaf' && item.value !== undefined) {