koishi-plugin-chat-analyse 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1771,11 +1771,10 @@ var Renderer = class {
|
|
|
1771
1771
|
const maxWeight = Math.max(...weights, 1);
|
|
1772
1772
|
const minWeight = Math.min(...weights);
|
|
1773
1773
|
const wordCount = words.length;
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
const minFontSize = Math.max(4, Math.round(maxFontSize / 8));
|
|
1774
|
+
let calculatedMaxFontSize = Math.round(1200 / Math.sqrt(wordCount));
|
|
1775
|
+
let calculatedMinFontSize = Math.round(calculatedMaxFontSize / 6);
|
|
1776
|
+
const maxFontSize = Math.max(4, Math.min(128, calculatedMaxFontSize));
|
|
1777
|
+
const minFontSize = Math.max(4, Math.min(maxFontSize, calculatedMinFontSize));
|
|
1779
1778
|
const cardHtml = `
|
|
1780
1779
|
<div class="container" style="width: 600px;">
|
|
1781
1780
|
<div class="header">
|