koishi-plugin-chat-analyse 1.4.10 → 1.4.11

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 +5 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1719,7 +1719,7 @@ var Renderer = class {
1719
1719
  if (series.length > 1) {
1720
1720
  const legendRows = Math.ceil(series.length / 3);
1721
1721
  legendHeight = 15 + legendRows * 20;
1722
- const LEGEND_START_Y = 285;
1722
+ const LEGEND_START_Y = 300;
1723
1723
  const columnWidth = 560 / 3;
1724
1724
  series.forEach((s, seriesIndex) => {
1725
1725
  const rowIndex = Math.floor(seriesIndex / 3);
@@ -1731,7 +1731,8 @@ var Renderer = class {
1731
1731
  svgElements += `<text x="${legendX + 18}" y="${legendY}" font-size="12" fill="var(--text-color)">${s.name}</text>`;
1732
1732
  });
1733
1733
  }
1734
- const svgHeight = 280 + legendHeight;
1734
+ const totalLegendSpace = legendHeight > 0 ? legendHeight + 15 : 0;
1735
+ const svgHeight = 280 + totalLegendSpace;
1735
1736
  const totalMessages = series.reduce((sum, s) => sum + s.data.reduce((a, b) => a + b, 0), 0);
1736
1737
  const cardHtml = `
1737
1738
  <div class="container" style="width: 600px;">
@@ -1767,8 +1768,8 @@ var Renderer = class {
1767
1768
  const maxWeight = Math.max(...weights, 1);
1768
1769
  const minWeight = Math.min(...weights);
1769
1770
  const wordCount = words.length;
1770
- const maxFontSize = Math.max(20, Math.round(400 / Math.log1p(wordCount)));
1771
- const minFontSize = Math.max(4, Math.round(maxFontSize / 12));
1771
+ const maxFontSize = Math.max(20, Math.round(512 / Math.log1p(wordCount)));
1772
+ const minFontSize = Math.max(6, Math.round(maxFontSize / 10));
1772
1773
  const cardHtml = `
1773
1774
  <div class="container" style="width: 600px;">
1774
1775
  <div class="header">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chat-analyse",
3
3
  "description": "强大而全面的聊天数据分析插件。支持多维度统计(命令、发言、消息类型、活跃度),可生成发言排行、词云图,并提供完善的数据管理。",
4
- "version": "1.4.10",
4
+ "version": "1.4.11",
5
5
  "contributors": [
6
6
  "Yis_Rime <yis_rime@outlook.com>"
7
7
  ],