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.
- package/lib/index.js +5 -4
- 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 =
|
|
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
|
|
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(
|
|
1771
|
-
const minFontSize = Math.max(
|
|
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">
|