remove unnecessary types in pieRenderer

This commit is contained in:
Yokozuna59 2023-06-21 00:32:14 +03:00
parent 09c4a26509
commit 796a761a7d

View File

@ -22,7 +22,7 @@ export const draw: DrawDefinition = (txt, id, _version, diagramObject) => {
const globalConfig: MermaidConfig = getConfig(); const globalConfig: MermaidConfig = getConfig();
const config: Required<PieDiagramConfig> = db.getConfig(); const config: Required<PieDiagramConfig> = db.getConfig();
const height: number = 450; const height = 450;
const { securityLevel } = globalConfig; const { securityLevel } = globalConfig;
// handle root and document for when rendering in sandbox mode // handle root and document for when rendering in sandbox mode
let sandboxElement: HTML | undefined; let sandboxElement: HTML | undefined;
@ -48,9 +48,9 @@ export const draw: DrawDefinition = (txt, id, _version, diagramObject) => {
// Set viewBox // Set viewBox
elem?.setAttribute('viewBox', '0 0 ' + width + ' ' + height); elem?.setAttribute('viewBox', '0 0 ' + width + ' ' + height);
const margin: number = 40; const margin = 40;
const legendRectSize: number = 18; const legendRectSize = 18;
const legendSpacing: number = 4; const legendSpacing = 4;
const radius: number = Math.min(width, height) / 2 - margin; const radius: number = Math.min(width, height) / 2 - margin;
@ -59,7 +59,7 @@ export const draw: DrawDefinition = (txt, id, _version, diagramObject) => {
.attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')'); .attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')');
const sections: Sections = db.getSections(); const sections: Sections = db.getSections();
let sum: number = 0; let sum = 1;
Object.keys(sections).forEach((key: string): void => { Object.keys(sections).forEach((key: string): void => {
sum += sections[key]; sum += sections[key];
}); });