Skip to content

Commit

Permalink
fix: use .js instead of .ts to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iwestlin committed Jun 26, 2023
1 parent 4937215 commit 184ad50
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/pie/pieRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { log } from '../../logger.js';
import { configureSvgSize } from '../../setupGraphViewbox.js';
import * as configApi from '../../config.js';
import { parseFontSize } from '../../utils.js';
import { getTextWidth } from '../../rendering-util/getTextWidth.ts';
import { getTextWidth } from '../../rendering-util/getTextWidth.js';

let conf = configApi.getConfig();

Expand Down
7 changes: 7 additions & 0 deletions packages/mermaid/src/rendering-util/getTextWidth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// https://stackoverflow.com/a/35373030/3469145
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');

const getTextWidth = (text) => context.measureText(text).width * window.devicePixelRatio;

export { getTextWidth };
7 changes: 0 additions & 7 deletions packages/mermaid/src/rendering-util/getTextWidth.ts

This file was deleted.

0 comments on commit 184ad50

Please sign in to comment.