koishi-plugin-chat-analyse 1.1.3 → 1.2.0

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 +10 -8
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1739,14 +1739,14 @@ var Renderer = class {
1739
1739
  const selectedPalette = this.COLOR_PALETTES[Math.floor(Math.random() * this.COLOR_PALETTES.length)];
1740
1740
  let weightFactor = 64;
1741
1741
  const count = words.length;
1742
- if (count <= 16) {
1742
+ if (count <= 32) {
1743
+ weightFactor = 64;
1744
+ } else if (count <= 64) {
1743
1745
  weightFactor = 48;
1744
- } else if (count <= 48) {
1745
- weightFactor = 36;
1746
- } else if (count <= 96) {
1746
+ } else if (count <= 128) {
1747
+ weightFactor = 32;
1748
+ } else if (count <= 256) {
1747
1749
  weightFactor = 24;
1748
- } else if (count <= 192) {
1749
- weightFactor = 20;
1750
1750
  } else {
1751
1751
  weightFactor = 12;
1752
1752
  }
@@ -1763,12 +1763,14 @@ var Renderer = class {
1763
1763
  const palette = ${JSON.stringify(selectedPalette)};
1764
1764
  WordCloud(document.getElementById('wordcloud-container'), {
1765
1765
  list: ${wordListJson},
1766
- fontFamily: '"Noto Sans CJK SC", "Helvetica Neue", "Arial", sans-serif',
1767
- weightFactor: (size) => Math.log(size) * ${weightFactor},
1766
+ fontFamily: '"Noto Sans CJK SC", "Arial", sans-serif',
1767
+ weightFactor: (size) => (Math.log(size) + 1) * ${weightFactor},
1768
1768
  color: (word, weight, fontSize, distance, theta) => {
1769
1769
  return palette[Math.floor(Math.random() * palette.length)];
1770
1770
  },
1771
1771
  backgroundColor: 'transparent',
1772
+ shape: 'square',
1773
+ ellipticity: 0.6,
1772
1774
  gridSize: 8,
1773
1775
  rotateRatio: 1,
1774
1776
  minRotation: -Math.PI / 4,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-chat-analyse",
3
3
  "description": "强大而全面的聊天数据分析,支持统计命令,发言,消息类型,活跃度,支持发言排行和生成词云",
4
- "version": "1.1.3",
4
+ "version": "1.2.0",
5
5
  "contributors": [
6
6
  "Yis_Rime <yis_rime@outlook.com>"
7
7
  ],