koishi-plugin-chat-analyse 1.4.7 → 1.4.8
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 +4 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1582,13 +1582,13 @@ var Renderer = class {
|
|
|
1582
1582
|
async htmlToImage(fullHtmlContent) {
|
|
1583
1583
|
const page = await this.ctx.puppeteer.page();
|
|
1584
1584
|
try {
|
|
1585
|
-
await page.setViewport({ width:
|
|
1585
|
+
await page.setViewport({ width: 1080, height: 720, deviceScaleFactor: 1 });
|
|
1586
1586
|
await page.setContent(fullHtmlContent, { waitUntil: "networkidle0" });
|
|
1587
1587
|
const { width, height } = await page.evaluate(() => ({
|
|
1588
1588
|
width: document.body.scrollWidth,
|
|
1589
1589
|
height: document.body.scrollHeight
|
|
1590
1590
|
}));
|
|
1591
|
-
await page.setViewport({ width, height, deviceScaleFactor:
|
|
1591
|
+
await page.setViewport({ width, height, deviceScaleFactor: 1 });
|
|
1592
1592
|
return await page.screenshot({ type: "png", omitBackground: true });
|
|
1593
1593
|
} catch (error) {
|
|
1594
1594
|
this.ctx.logger.error("图片渲染失败:", error);
|
|
@@ -1794,8 +1794,8 @@ var Renderer = class {
|
|
|
1794
1794
|
<h1 class="title-text">${title}</h1>
|
|
1795
1795
|
<div class="time-label">${time.toLocaleString("zh-CN", { hour12: false })}</div>
|
|
1796
1796
|
</div>
|
|
1797
|
-
<div style="width:
|
|
1798
|
-
<canvas id="wordcloud-container" width="
|
|
1797
|
+
<div style="width: 600px; height: 600px; margin: auto;">
|
|
1798
|
+
<canvas id="wordcloud-container" width="600" height="600"></canvas>
|
|
1799
1799
|
</div>
|
|
1800
1800
|
<script>${wordCloudScript}</script>
|
|
1801
1801
|
<script>
|