koishi-plugin-chat-analyse 1.5.1 → 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.
Files changed (2) hide show
  1. package/lib/index.js +4 -6
  2. 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
- const area = 600 * 600;
1775
- const avgAreaPerWord = area / wordCount;
1776
- let maxFontSize = Math.round(Math.sqrt(avgAreaPerWord) * 1.8);
1777
- maxFontSize = Math.max(16, Math.min(160, maxFontSize));
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">
@@ -1807,7 +1806,6 @@ var Renderer = class {
1807
1806
  drawOutOfBound: true,
1808
1807
  clearCanvas: false,
1809
1808
  shrinkToFit: true,
1810
- abortThreshold: 1,
1811
1809
  rotateRatio: 1,
1812
1810
  shuffle: true,
1813
1811
  gridSize: 1,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chat-analyse",
3
3
  "description": "强大而全面的聊天数据分析插件。支持多维度统计(命令、发言、消息类型、活跃度),可生成发言排行、词云图,并提供完善的数据管理。",
4
- "version": "1.5.1",
4
+ "version": "1.5.3",
5
5
  "contributors": [
6
6
  "Yis_Rime <yis_rime@outlook.com>"
7
7
  ],