{"id":15910487,"url":"https://github.com/yokiyokiyoki/ec-wordcloud","last_synced_at":"2026-01-17T22:52:22.404Z","repository":{"id":43559597,"uuid":"165015558","full_name":"yokiyokiyoki/ec-wordcloud","owner":"yokiyokiyoki","description":":cloud: wordcloud extension based on wordcloud2.js","archived":false,"fork":false,"pushed_at":"2022-12-11T07:22:41.000Z","size":2904,"stargazers_count":0,"open_issues_count":21,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T10:48:48.047Z","etag":null,"topics":["echart-wordcloud","javascript","typescript","wordcloud","wordcloud2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yokiyokiyoki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-10T07:52:52.000Z","updated_at":"2019-09-29T10:21:22.000Z","dependencies_parsed_at":"2023-01-26T18:01:54.450Z","dependency_job_id":null,"html_url":"https://github.com/yokiyokiyoki/ec-wordcloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokiyokiyoki%2Fec-wordcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokiyokiyoki%2Fec-wordcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokiyokiyoki%2Fec-wordcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokiyokiyoki%2Fec-wordcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yokiyokiyoki","download_url":"https://codeload.github.com/yokiyokiyoki/ec-wordcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246917767,"owners_count":20854704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["echart-wordcloud","javascript","typescript","wordcloud","wordcloud2"],"created_at":"2024-10-06T15:06:49.271Z","updated_at":"2026-01-17T22:52:22.372Z","avatar_url":"https://github.com/yokiyokiyoki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ec-wordcloud\n\n[文档](https://yokiyokiyoki.github.io/e-wordcloud/)\n\n## 安装\n\n```html\n\u003c!--可以自己去npm查看版本号，修改之--\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/ec-wordcloud@0.0.3/dist/ec-wordcloud.js\"\u003e\u003c/script\u003e\n\u003c!--ECWordcloud变为全局变量--\u003e\n```\n\nOr\n\n```shell\nnpm install ec-wordcloud -S\n/** 或者推荐 **/\nyarn add ec-wordcloud -S\n```\n\n```js\nimport ECWordcloud from 'ec-wordcloud'\n```\n\n## 使用\n\u003e options更多请参考[wordcloud2](https://github.com/timdream/wordcloud2.js/blob/gh-pages/API.md)\n\n```js\nconst wordcloud = new ECWordcloud(document.querySelector('.wordcloud'));\n\nwordcloud.setOption({\n    // ...\n    maskImage: 'https://example.com/images/shape.png',     // 提供一张图片（链接方式，仅支持jpg/png），根据其形状进行词云渲染\n    fontSizeFactor: 0.1,                                    // 词云权重系数，默认为0.1\n    maxFontSize: 60,                                        // 最大fontSize，用来控制weightFactor，默认60\n    minFontSize: 12,                                        // 最小fontSize，用来控制weightFactor，默认12\n    tooltip: {\n        show: true,                                         // 默认：false\n        backgroundColor: 'rgba(0, 0, 0, 0.701961)',         // 默认：'rgba(0, 0, 0, 0.701961)'\n        formatter: function(item) {                         // 数据格式化函数，item为list的一项\n        }\n    },\n    data:[{\n        name:'测试1',value:11\n    },{\n        name:'测试2',value:11\n    }]\n    // ...其余请参考wordcloud2.js\n});\n```\n\n### methods\n\n#### resize\n\n```js\nwordcloud.resize()\n```\n\n### Notice\n\n更好地支持图片形状，注意点：\n- 请使用图形为纯黑色的白底图片（格式为jpg/png）；\n- 如果形状显示不太完美，请不断调整fontSizeFactor, maxFontSize和minFontSize等参数；\n- 其他格式（SVG、base64等）暂不支持，请先转换为图片；","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyokiyokiyoki%2Fec-wordcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyokiyokiyoki%2Fec-wordcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyokiyokiyoki%2Fec-wordcloud/lists"}