koishi-plugin-chat-analyse 1.2.4 → 1.2.6
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 +6 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1736,8 +1736,8 @@ var Renderer = class {
|
|
|
1736
1736
|
const weights = words.map((w) => w[1]);
|
|
1737
1737
|
const maxWeight = Math.max(...weights, 1);
|
|
1738
1738
|
const minWeight = Math.min(...weights);
|
|
1739
|
-
const MAX_FONT_SIZE =
|
|
1740
|
-
const MIN_FONT_SIZE =
|
|
1739
|
+
const MAX_FONT_SIZE = 64;
|
|
1740
|
+
const MIN_FONT_SIZE = 4;
|
|
1741
1741
|
const cardHtml = `
|
|
1742
1742
|
<div class="container">
|
|
1743
1743
|
<div class="header">
|
|
@@ -1750,7 +1750,6 @@ var Renderer = class {
|
|
|
1750
1750
|
<script>
|
|
1751
1751
|
const palette = ${JSON.stringify(selectedPalette)};
|
|
1752
1752
|
WordCloud(document.getElementById('wordcloud-container'), {
|
|
1753
|
-
list: ${wordsJson},
|
|
1754
1753
|
fontFamily: '"Noto Sans CJK SC", "Arial", sans-serif',
|
|
1755
1754
|
weightFactor: (size) => {
|
|
1756
1755
|
if (${maxWeight} === ${minWeight}) return (${MIN_FONT_SIZE} + ${MAX_FONT_SIZE}) / 2;
|
|
@@ -1760,14 +1759,15 @@ var Renderer = class {
|
|
|
1760
1759
|
color: (word, weight, fontSize, distance, theta) => {
|
|
1761
1760
|
return palette[Math.floor(Math.random() * palette.length)];
|
|
1762
1761
|
},
|
|
1763
|
-
|
|
1764
|
-
clearCanvas: true,
|
|
1762
|
+
list: ${wordsJson},
|
|
1765
1763
|
shape: 'square',
|
|
1766
|
-
ellipticity: 1,
|
|
1767
1764
|
gridSize: 1,
|
|
1765
|
+
ellipticity: 1,
|
|
1768
1766
|
rotateRatio: 1,
|
|
1769
1767
|
minRotation: -Math.PI / 4,
|
|
1770
1768
|
maxRotation: Math.PI / 4,
|
|
1769
|
+
backgroundColor: 'transparent',
|
|
1770
|
+
clearCanvas: true,
|
|
1771
1771
|
shuffle: true,
|
|
1772
1772
|
});
|
|
1773
1773
|
</script>
|