From fe41f1b5e65b088bb960cc2bb6b7a98e93e2f327 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Mon, 8 Jul 2024 20:06:59 +0530 Subject: [PATCH] use nullish coalescing operator --- .../mermaid/src/diagrams/pie/pieRenderer.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/mermaid/src/diagrams/pie/pieRenderer.ts b/packages/mermaid/src/diagrams/pie/pieRenderer.ts index 16da81173c..cec336db23 100644 --- a/packages/mermaid/src/diagrams/pie/pieRenderer.ts +++ b/packages/mermaid/src/diagrams/pie/pieRenderer.ts @@ -76,18 +76,18 @@ export const draw: DrawDefinition = (text, id, _version, diagObj) => { const arcs: d3.PieArcDatum[] = createPieArcs(sections); const myGeneratedColors = [ - themeVariables?.pie1 || null, - themeVariables?.pie2 || null, - themeVariables?.pie3 || null, - themeVariables?.pie4 || null, - themeVariables?.pie5 || null, - themeVariables?.pie6 || null, - themeVariables?.pie7 || null, - themeVariables?.pie8 || null, - themeVariables?.pie9 || null, - themeVariables?.pie10 || null, - themeVariables?.pie11 || null, - themeVariables?.pie12 || null, + themeVariables?.pie1 ?? null, + themeVariables?.pie2 ?? null, + themeVariables?.pie3 ?? null, + themeVariables?.pie4 ?? null, + themeVariables?.pie5 ?? null, + themeVariables?.pie6 ?? null, + themeVariables?.pie7 ?? null, + themeVariables?.pie8 ?? null, + themeVariables?.pie9 ?? null, + themeVariables?.pie10 ?? null, + themeVariables?.pie11 ?? null, + themeVariables?.pie12 ?? null, ]; // Set the color scale const color: d3.ScaleOrdinal = scaleOrdinal(myGeneratedColors);