{"id":40882422,"url":"https://github.com/liangbizhi/js2wordcloud","last_synced_at":"2026-01-22T01:16:38.954Z","repository":{"id":57160626,"uuid":"74341193","full_name":"liangbizhi/js2wordcloud","owner":"liangbizhi","description":"javascript wordcloud, based on wordcloud2.js. js词云，增强特性","archived":false,"fork":false,"pushed_at":"2018-09-01T06:47:17.000Z","size":140,"stargazers_count":155,"open_issues_count":11,"forks_count":83,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-23T15:49:03.920Z","etag":null,"topics":["javascript","wordcloud"],"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/liangbizhi.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":"2016-11-21T08:15:23.000Z","updated_at":"2025-09-05T10:34:04.000Z","dependencies_parsed_at":"2022-09-09T07:00:48.071Z","dependency_job_id":null,"html_url":"https://github.com/liangbizhi/js2wordcloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liangbizhi/js2wordcloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangbizhi%2Fjs2wordcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangbizhi%2Fjs2wordcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangbizhi%2Fjs2wordcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangbizhi%2Fjs2wordcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liangbizhi","download_url":"https://codeload.github.com/liangbizhi/js2wordcloud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangbizhi%2Fjs2wordcloud/sbom","scorecard":{"id":587567,"data":{"date":"2025-08-11","repo":{"name":"github.com/liangbizhi/js2wordcloud","commit":"97aefea99551fef42626b51e0593897d856f0cd3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T20:57:39.387Z","repository_id":57160626,"created_at":"2025-08-20T20:57:39.387Z","updated_at":"2025-08-20T20:57:39.387Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["javascript","wordcloud"],"created_at":"2026-01-22T01:16:38.383Z","updated_at":"2026-01-22T01:16:38.948Z","avatar_url":"https://github.com/liangbizhi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js2wordcloud.js\n\n[![Build](https://img.shields.io/travis/liangbizhi/js2wordcloud.svg)](https://travis-ci.org/liangbizhi/js2wordcloud)\n[![Github Releases](https://img.shields.io/github/downloads/liangbizhi/js2wordcloud/latest/total.svg)]()\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)\n\n[![NPM](https://nodei.co/npm/js2wordcloud.png)](https://nodei.co/npm/js2wordcloud/)\n\n![js2wordcloud](./shape/sample.png)\n\nJavaScript生成词云图。基于[wordcloud2.js](https://github.com/timdream/wordcloud2.js)\n\n由于Baidu Echarts 2的词云图在设置值较小、值相同的词语时，会出现字符重叠的问题；而又在不能使用Ecahrts 3的情况下……\n\nwordcloud2.js能较好解决这个问题，但某些功能仍未能满足项目需求，故在此进行二次封装，做一些微小的工作。\n\n## Installation\n\n* 通过`script`标签引入：\n\n```html\n\u003cscript src=\"dist/js2wordcloud.min.js\"\u003e\u003c/script\u003e\n```\n\n* npm安装：\n\n```bash\nnpm install js2wordcloud --save\n```\n\n## Usage\n\n```javascript\nvar wc = new Js2WordCloud(document.getElementById('container'))\nwc.setOption({\n    tooltip: {\n        show: true\n    },\n    list: [['谈笑风生', 80], ['谈笑风生', 80], ['谈笑风生', 70], ['谈笑风生', 70], ['谈笑风生', 60], ['谈笑风生', 60]],\n    color: '#15a4fa'\n})\n```\n\n一般用法请看`index.html`。点击[demo](http://liangbizhi.github.io/js2wordcloud)\n\n图片形状用法请看`index-shape.html`。点击[demo](http://liangbizhi.github.io/js2wordcloud/index-shape.html)\n\n## Features\n\n* 支持tooltip。包括tooltip的开关和数据格式化formatter；\n* 支持showLoading和hideLoading加载数据loading；\n* 支持resize；\n* 当词云数值相差过大时，对字体大小范围进行约束；\n* 更好地支持图片形状，注意点：\n    * 请使用图形为纯黑色的白底图片（格式为jpg/png）；\n    * 如果形状显示不太完美，请不断调整`fontSizeFactor`, `maxFontSize`和`minFontSize`等参数；\n    * 其他格式（SVG、base64等）暂不支持，请先转换为图片；\n\n## Document\n\n### API\n\n* setOption(options)\n\n    options必须通过此API进行设置，才能显示词云\n\n    **在wordcloud2.js原options基础上增加：**\n\n    ```javascript\n    {\n        // ...\n        imageShape: 'https://example.com/images/shape.png',     // 提供一张图片（链接方式，仅支持jpg/png），根据其形状进行词云渲染，默认为null\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        noDataLoadingOption: {                                  // 无数据提示。\n            backgroundColor: '#eee',\n            text: '暂无数据',\n            textStyle: {\n                color: '#888',\n                fontSize: 14\n            }\n        }\n        // ...\n    }\n    ```\n\n* showLoading([loadingOption])\n\n    过渡控制，显示loading（读取中）。可选。\n\n    `loadingOption`:\n\n    ```javascript\n    {\n        backgroundColor: '#eee',\n        text: '正在加载...',\n        effect: 'spin'                      // 默认：null, { String | Function } 可选：'spin|normal'；也可为回调函数，回调函数生成HTML\n    }\n    ```\n\n* hideLoading()\n\n    隐藏loading\n\n* resize()\n\n    当容器大小变化时，调用此方法进行重绘\n\n## Licence\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangbizhi%2Fjs2wordcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliangbizhi%2Fjs2wordcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangbizhi%2Fjs2wordcloud/lists"}