mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-20 20:54:27 +01:00
Compare commits
2 Commits
docs/corre
...
fix/7167-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96ca7c090f | ||
|
|
bf7c532e43 |
5
.changeset/chatty-insects-dream.md
Normal file
5
.changeset/chatty-insects-dream.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'mermaid': patch
|
||||
---
|
||||
|
||||
fix(treemap): Fixed treemap classDef style application to properly apply user-defined styles
|
||||
@@ -402,7 +402,7 @@ block
|
||||
blockArrowId4<["Label"]>(down)
|
||||
blockArrowId5<["Label"]>(x)
|
||||
blockArrowId6<["Label"]>(y)
|
||||
blockArrowId7<["Label"]>(x, down)
|
||||
blockArrowId6<["Label"]>(x, down)
|
||||
```
|
||||
|
||||
```mermaid
|
||||
@@ -413,7 +413,7 @@ block
|
||||
blockArrowId4<["Label"]>(down)
|
||||
blockArrowId5<["Label"]>(x)
|
||||
blockArrowId6<["Label"]>(y)
|
||||
blockArrowId7<["Label"]>(x, down)
|
||||
blockArrowId6<["Label"]>(x, down)
|
||||
```
|
||||
|
||||
#### Example - Space Blocks
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -283,7 +283,7 @@ block
|
||||
blockArrowId4<["Label"]>(down)
|
||||
blockArrowId5<["Label"]>(x)
|
||||
blockArrowId6<["Label"]>(y)
|
||||
blockArrowId7<["Label"]>(x, down)
|
||||
blockArrowId6<["Label"]>(x, down)
|
||||
```
|
||||
|
||||
#### Example - Space Blocks
|
||||
|
||||
Reference in New Issue
Block a user