koishi-plugin-chat-analyse 1.4.13 → 1.4.15
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 -5
- package/package.json +1 -1
- package/readme.md +0 -2
package/lib/index.js
CHANGED
|
@@ -1709,11 +1709,11 @@ var Renderer = class {
|
|
|
1709
1709
|
svgElements += `<polyline points="${points}" fill="none" stroke="${color}" stroke-width="2"/>`;
|
|
1710
1710
|
});
|
|
1711
1711
|
const chartAreaHeight = 280;
|
|
1712
|
-
const legendMargin =
|
|
1712
|
+
const legendMargin = 20;
|
|
1713
1713
|
let legendBlockHeight = 0;
|
|
1714
1714
|
if (series.length > 1) {
|
|
1715
1715
|
const legendRows = Math.ceil(series.length / 3);
|
|
1716
|
-
const legendRowHeight =
|
|
1716
|
+
const legendRowHeight = 15;
|
|
1717
1717
|
legendBlockHeight = legendRows * legendRowHeight;
|
|
1718
1718
|
const LEGEND_START_Y = chartAreaHeight + legendMargin;
|
|
1719
1719
|
const columnWidth = 560 / 3;
|
|
@@ -1727,7 +1727,7 @@ var Renderer = class {
|
|
|
1727
1727
|
svgElements += `<text x="${legendX + 18}" y="${legendY}" font-size="12" fill="var(--text-color)">${s.name}</text>`;
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
|
-
const totalLegendSpace = legendBlockHeight > 0 ? legendMargin + legendBlockHeight
|
|
1730
|
+
const totalLegendSpace = legendBlockHeight > 0 ? legendMargin + legendBlockHeight : 0;
|
|
1731
1731
|
const svgHeight = chartAreaHeight + totalLegendSpace;
|
|
1732
1732
|
const totalMessages = series.reduce((sum, s) => sum + s.data.reduce((a, b) => a + b, 0), 0);
|
|
1733
1733
|
const cardHtml = `
|
|
@@ -2431,7 +2431,7 @@ var Analyse = class {
|
|
|
2431
2431
|
let analysisConfig;
|
|
2432
2432
|
if (options.separate) {
|
|
2433
2433
|
const { hours } = options;
|
|
2434
|
-
const title = await generateTitle(this.ctx, scopeDesc, { main: "
|
|
2434
|
+
const title = await generateTitle(this.ctx, scopeDesc, { main: "相似活跃", timeRange: hours, timeUnit: "小时" });
|
|
2435
2435
|
analysisConfig = {
|
|
2436
2436
|
points: hours,
|
|
2437
2437
|
since: new Date(until.getTime() - hours * import_koishi6.Time.hour),
|
|
@@ -2450,7 +2450,7 @@ var Analyse = class {
|
|
|
2450
2450
|
const hoursToAnalyse = daysToAnalyse * 24;
|
|
2451
2451
|
const currentHour = until.getHours();
|
|
2452
2452
|
const labels = Array.from({ length: 24 }, (_, i) => String((currentHour - (23 - i) + 24) % 24));
|
|
2453
|
-
const title = await generateTitle(this.ctx, scopeDesc, { main: "
|
|
2453
|
+
const title = await generateTitle(this.ctx, scopeDesc, { main: "相似活跃", timeRange: daysToAnalyse, timeUnit: "天" });
|
|
2454
2454
|
analysisConfig = {
|
|
2455
2455
|
points: 24,
|
|
2456
2456
|
since: new Date(until.getTime() - hoursToAnalyse * import_koishi6.Time.hour),
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -164,8 +164,6 @@
|
|
|
164
164
|
| `shape` | **词云形状**:预设值包括 `circle`, `cardioid`, `diamond`, `square`, `triangle`, `pentagon`, `star`。 | `square` |
|
|
165
165
|
| `maskImage` | **蒙版图片**:提供一个图片的URL作为词云的形状蒙版。**注意:这会覆盖“词云形状”选项。** | (空) |
|
|
166
166
|
| `fontFamily` | **词云字体**:用于渲染词云的字体列表。 | `"Noto Sans CJK SC", "Arial", sans-serif` |
|
|
167
|
-
| `minFontSize` | **最小字号**:权重最小的单词所使用的字号(px)。 | `4` |
|
|
168
|
-
| `maxFontSize` | **最大字号**:权重最大的单词所使用的字号(px)。 | `64` |
|
|
169
167
|
| `ellipticity` | **长宽比**:形状的扁平程度(0-1),仅对非方形形状有效。 | `1` |
|
|
170
168
|
| `minRotation` | **最小旋转角**:单词随机旋转的最小角度(弧度)。 | `-1.570796` (-π/2) |
|
|
171
169
|
| `maxRotation` | **最大旋转角**:单词随机旋转的最大角度(弧度)。 | `1.570796` (π/2) |
|