koishi-plugin-chat-analyse 1.1.3 → 1.1.4
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 +7 -7
- 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 <=
|
|
1742
|
+
if (count <= 32) {
|
|
1743
|
+
weightFactor = 64;
|
|
1744
|
+
} else if (count <= 64) {
|
|
1743
1745
|
weightFactor = 48;
|
|
1744
|
-
} else if (count <=
|
|
1745
|
-
weightFactor =
|
|
1746
|
-
} else if (count <=
|
|
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
|
}
|
|
@@ -1764,7 +1764,7 @@ var Renderer = class {
|
|
|
1764
1764
|
WordCloud(document.getElementById('wordcloud-container'), {
|
|
1765
1765
|
list: ${wordListJson},
|
|
1766
1766
|
fontFamily: '"Noto Sans CJK SC", "Helvetica Neue", "Arial", sans-serif',
|
|
1767
|
-
weightFactor: (size) => Math.log(size) * ${weightFactor},
|
|
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
|
},
|