{"id":13425874,"url":"https://github.com/ecomfe/echarts-wordcloud","last_synced_at":"2025-05-14T08:10:07.887Z","repository":{"id":37334273,"uuid":"63254491","full_name":"ecomfe/echarts-wordcloud","owner":"ecomfe","description":"Word Cloud extension based on Apache ECharts and wordcloud2.js","archived":false,"fork":false,"pushed_at":"2024-03-12T02:35:10.000Z","size":1929,"stargazers_count":1743,"open_issues_count":117,"forks_count":707,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-04-30T10:05:19.740Z","etag":null,"topics":["echarts"],"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/ecomfe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-13T14:46:32.000Z","updated_at":"2025-04-28T14:26:21.000Z","dependencies_parsed_at":"2024-06-11T23:30:43.298Z","dependency_job_id":null,"html_url":"https://github.com/ecomfe/echarts-wordcloud","commit_stats":{"total_commits":58,"total_committers":5,"mean_commits":11.6,"dds":0.5,"last_synced_commit":"83b116e2e88a0ea7030f017f40b8b1e2d2ced318"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fecharts-wordcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fecharts-wordcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fecharts-wordcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fecharts-wordcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomfe","download_url":"https://codeload.github.com/ecomfe/echarts-wordcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101559,"owners_count":22014908,"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":["echarts"],"created_at":"2024-07-31T00:01:21.000Z","updated_at":"2025-05-14T08:10:02.878Z","avatar_url":"https://github.com/ecomfe.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Extensions"],"sub_categories":["Videos"],"readme":"# echarts-wordcloud\n\nThird-party Wordcloud extension based on [wordcloud2.js](https://github.com/timdream/wordcloud2.js) for [Apache ECharts](https://github.com/apache/echarts).\n\n![](./example/word-cloud.png)\n\n## Examples\n\n[Google Trends](https://ecomfe.github.io/echarts-wordcloud/example/wordCloud.html)\n\n[ECharts Option Keywords](https://ecomfe.github.io/echarts-wordcloud/example/optionKeywords.html)\n\n## Install\n\n```html\n\u003cscript src=\"echarts.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"echarts-wordcloud.min.js\"\u003e\u003c/script\u003e\n```\n\nOr\n\n```shell\nnpm install echarts\nnpm install echarts-wordcloud\n```\n\n```js\nimport * as echarts from 'echarts';\nimport 'echarts-wordcloud';\n```\n\n⚠️ NOTE:\n\necharts-wordcloud@2 is for echarts@5\n\necharts-wordcloud@1 is for echarts@4\n\n## Usage\n\n```js\nvar chart = echarts.init(document.getElementById('main'));\n\nchart.setOption({\n    ...\n    series: [{\n        type: 'wordCloud',\n\n        // The shape of the \"cloud\" to draw. Can be any polar equation represented as a\n        // callback function, or a keyword present. Available presents are circle (default),\n        // cardioid (apple or heart shape curve, the most known polar equation), diamond (\n        // alias of square), triangle-forward, triangle, (alias of triangle-upright, pentagon, and star.\n\n        shape: 'circle',\n\n        // Keep aspect ratio of maskImage or 1:1 for shapes\n        // This option is supported since echarts-wordcloud@2.1.0\n        keepAspect: false,\n\n        // A silhouette image which the white area will be excluded from drawing texts.\n        // The shape option will continue to apply as the shape of the cloud to grow.\n\n        maskImage: maskImage,\n\n        // Folllowing left/top/width/height/right/bottom are used for positioning the word cloud\n        // Default to be put in the center and has 75% x 80% size.\n\n        left: 'center',\n        top: 'center',\n        width: '70%',\n        height: '80%',\n        right: null,\n        bottom: null,\n\n        // Text size range which the value in data will be mapped to.\n        // Default to have minimum 12px and maximum 60px size.\n\n        sizeRange: [12, 60],\n\n        // Text rotation range and step in degree. Text will be rotated randomly in range [-90, 90] by rotationStep 45\n\n        rotationRange: [-90, 90],\n        rotationStep: 45,\n\n        // size of the grid in pixels for marking the availability of the canvas\n        // the larger the grid size, the bigger the gap between words.\n\n        gridSize: 8,\n\n        // set to true to allow word to be drawn partly outside of the canvas.\n        // Allow word bigger than the size of the canvas to be drawn\n        // This option is supported since echarts-wordcloud@2.1.0\n        drawOutOfBound: false,\n\n        // if the font size is too large for the text to be displayed,\n        // whether to shrink the text. If it is set to false, the text will\n        // not be rendered. If it is set to true, the text will be shrinked.\n        // This option is supported since echarts-wordcloud@2.1.0\n        shrinkToFit: false,\n\n        // If perform layout animation.\n        // NOTE disable it will lead to UI blocking when there is lots of words.\n        layoutAnimation: true,\n\n        // Global text style\n        textStyle: {\n            fontFamily: 'sans-serif',\n            fontWeight: 'bold',\n            // Color can be a callback function or a color string\n            color: function () {\n                // Random color\n                return 'rgb(' + [\n                    Math.round(Math.random() * 160),\n                    Math.round(Math.random() * 160),\n                    Math.round(Math.random() * 160)\n                ].join(',') + ')';\n            }\n        },\n        emphasis: {\n            focus: 'self',\n\n            textStyle: {\n                textShadowBlur: 10,\n                textShadowColor: '#333'\n            }\n        },\n\n        // Data is an array. Each array item must have name and value property.\n        data: [{\n            name: 'Farrah Abraham',\n            value: 366,\n            // Style of single text\n            textStyle: {\n            }\n        }]\n    }]\n});\n```\n\n## Changelog\n\n### 2.1.0\n\n- [chore] Update Apache ECharts version\n- [chore] Sync with the latest wordcloud2.js and use prettier to format the code\n- [feature] Add `keepAspect` option to keep aspect ratio of maskImage or 1:1 for shapes\n- [feature] Add `drawOutOfBound` option to allow words to be drawn partly outside of the canvas\n- [feature] Add `shrinkToFit` option to shrink the text if the font size is too large for the text to be displayed\n\n## Notice\n\nThe Apache Software Foundation [Apache ECharts, ECharts](https://echarts.apache.org/), Apache, the Apache feather, and the Apache ECharts project logo are either registered trademarks or trademarks of the [Apache Software Foundation](https://www.apache.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fecharts-wordcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomfe%2Fecharts-wordcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fecharts-wordcloud/lists"}