mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-20 20:54:27 +01:00
7167 : fix classDef style application for treemap diagramtype
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user