mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 14:59:53 +02:00
Merge branch 'develop' into 6584-piechart-zero-negative-values
This commit is contained in:
@@ -8,7 +8,7 @@ export {
|
||||
Architecture,
|
||||
GitGraph,
|
||||
Radar,
|
||||
TreemapDoc,
|
||||
Treemap,
|
||||
Branch,
|
||||
Commit,
|
||||
Merge,
|
||||
@@ -20,7 +20,7 @@ export {
|
||||
isPieSection,
|
||||
isArchitecture,
|
||||
isGitGraph,
|
||||
isTreemapDoc,
|
||||
isTreemap,
|
||||
isBranch,
|
||||
isCommit,
|
||||
isMerge,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import type { ValidationAcceptor, ValidationChecks } from 'langium';
|
||||
import type { MermaidAstType, TreemapDoc } from '../generated/ast.js';
|
||||
import type { MermaidAstType, Treemap } from '../generated/ast.js';
|
||||
import type { TreemapServices } from './module.js';
|
||||
|
||||
/**
|
||||
@@ -9,10 +9,10 @@ export function registerValidationChecks(services: TreemapServices) {
|
||||
const validator = services.validation.TreemapValidator;
|
||||
const registry = services.validation.ValidationRegistry;
|
||||
if (registry) {
|
||||
// Use any to bypass type checking since we know TreemapDoc is part of the AST
|
||||
// Use any to bypass type checking since we know Treemap is part of the AST
|
||||
// but the type system is having trouble with it
|
||||
const checks: ValidationChecks<MermaidAstType> = {
|
||||
TreemapDoc: validator.checkSingleRoot.bind(validator),
|
||||
Treemap: validator.checkSingleRoot.bind(validator),
|
||||
// Remove unused validation for TreemapRow
|
||||
};
|
||||
registry.register(checks, validator);
|
||||
@@ -27,7 +27,7 @@ export class TreemapValidator {
|
||||
* Validates that a treemap has only one root node.
|
||||
* A root node is defined as a node that has no indentation.
|
||||
*/
|
||||
checkSingleRoot(doc: TreemapDoc, accept: ValidationAcceptor): void {
|
||||
checkSingleRoot(doc: Treemap, accept: ValidationAcceptor): void {
|
||||
let rootNodeIndentation;
|
||||
|
||||
for (const row of doc.TreemapRows) {
|
||||
|
@@ -34,14 +34,14 @@ interface ClassDefStatement {
|
||||
className: string
|
||||
styleText: string // Optional style text
|
||||
}
|
||||
interface TreemapDoc {
|
||||
interface Treemap {
|
||||
TreemapRows: TreemapRow[]
|
||||
title?: string
|
||||
accTitle?: string
|
||||
accDescr?: string
|
||||
}
|
||||
|
||||
entry TreemapDoc returns TreemapDoc:
|
||||
entry Treemap returns Treemap:
|
||||
TREEMAP_KEYWORD
|
||||
(
|
||||
TitleAndAccessibilities
|
||||
|
Reference in New Issue
Block a user