{"id":13675264,"url":"https://github.com/maptalks/maptalks.heatmap","last_synced_at":"2025-04-12T00:10:01.105Z","repository":{"id":46028376,"uuid":"79466055","full_name":"maptalks/maptalks.heatmap","owner":"maptalks","description":"A heatmap layer plugin for maptalks.js","archived":false,"fork":false,"pushed_at":"2022-11-30T02:33:35.000Z","size":452,"stargazers_count":49,"open_issues_count":8,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-16T01:08:45.256Z","etag":null,"topics":["heatmap","map","mapping","maptalks","maptalks-plugins"],"latest_commit_sha":null,"homepage":"https://maptalks.github.io/maptalks.heatmap/demo/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maptalks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-19T15:20:19.000Z","updated_at":"2024-08-12T20:12:23.000Z","dependencies_parsed_at":"2023-01-23T11:31:30.587Z","dependency_job_id":null,"html_url":"https://github.com/maptalks/maptalks.heatmap","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.heatmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.heatmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.heatmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.heatmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maptalks","download_url":"https://codeload.github.com/maptalks/maptalks.heatmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237111680,"owners_count":19257389,"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":["heatmap","map","mapping","maptalks","maptalks-plugins"],"created_at":"2024-08-02T12:00:37.076Z","updated_at":"2025-02-04T12:05:08.828Z","avatar_url":"https://github.com/maptalks.png","language":"JavaScript","readme":"# maptalks.heatmap\n\n[![CircleCI](https://circleci.com/gh/maptalks/maptalks.heatmap/tree/master.svg?style=shield)](https://circleci.com/gh/maptalks/maptalks.heatmap)\n[![NPM Version](https://img.shields.io/npm/v/maptalks.heatmap.svg)](https://github.com/maptalks/maptalks.heatmap)\n\nA plugin of [maptalks.js](https://github.com/maptalks/maptalks.js) to draw heatmap on maps, based on mourner's [simpleheat](https://github.com/mourner/simpleheat).\n\n![screenshot](https://cloud.githubusercontent.com/assets/13678919/25303099/98ad71fa-277e-11e7-8722-a3435d11e1f5.jpg)\n\n## Examples\n\n* A heatmap of [50000 points](https://maptalks.github.io/maptalks.heatmap/demo/). (data from [Leaflet.Heat](https://github.com/Leaflet/Leaflet.heat))\n\n## Install\n  \n* Install with npm: ```npm install maptalks.heatmap```. \n* Download from [dist directory](https://github.com/maptalks/maptalks.heatmap/tree/gh-pages/dist).\n* Use unpkg CDN: ```https://unpkg.com/maptalks.heatmap/dist/maptalks.heatmap.min.js```\n\n## Usage\n\nAs a plugin, ```maptalks.heatmap``` must be loaded after ```maptalks.js``` in browsers.\n\n### Vanilla Javascript\n```html\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/maptalks/dist/maptalks.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/maptalks.heatmap/dist/maptalks.heatmap.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nvar data = [[0, 0, 0.3], [0, 0, 0.4], [0, 0, 0.4]];\nvar heatLayer = new maptalks.HeatLayer('heat', data).addTo(map);\n\u003c/script\u003e\n```\n\n### ES6\n\n```javascript\nimport { HeatLayer } from 'maptalks.heatmap';\nconst data = [[0, 0, 0.3], [0, 0, 0.4], [0, 0, 0.4]];\nconst heatLayer = new HeatLayer('heat', data).addTo(map);\n```\n\n## Supported Browsers\n\nIE 9-11, Chrome, Firefox, other modern and mobile browsers.\n\n## API Reference\n\n### `Constructor`\n\n```HeatmapLayer``` is a subclass of [maptalks.Layer](https://maptalks.github.io/maptalks.js/api/0.x/Layer.html) and inherits all the methods of its parent.\n\n```javascript\nnew maptalks.HeatmapLayer(id, data, options)\n```\n\n* id **String** layer id\n* data **Array[]** layer data: [[x, y, value], [x, y, value]..]\n* options **Object** options\n    * max **Number** max data value (1 by default) \n    * radius **Number** point radius(25 by default)\n    * blur **Number**  blur radius(15 by default)\n    * minOpacity **Number** minimum point opacity (0.05 by default)\n    * heatValueScale **Number** the scale value to multiply with heat data (1 by default)\n    * gradient **Object** set gradient colors as {\\\u003cstop\\\u003e: '\\\u003ccolor\\\u003e'}, default by { 0.4: 'blue', 0.6: 'cyan', 0.7: 'lime', 0.8: 'yellow', 1.0: 'red' }\n    * Other options defined in [maptalks.Layer](https://maptalks.github.io/maptalks.js/api/0.x/Layer.html)\n\n### `config(key, value)`\n\nconfig layer's options and redraw the layer if necessary\n\n```javascript\nheatLayer.config('max', 10);\nheatLayer.config({\n    'radius' : 80,\n    'blur' : 30,\n    'gradient' : {0.4: 'blue', 0.65: 'lime', 1: 'red'}\n});\n```\n\n**Returns** `this`\n\n### `getData`\n\nget layer's data\n\n**Returns** `Array[]`\n\n### `setData(data)`\n\nset new data\n\n* data **Array[]** data to set\n\n**Returns** `this`\n\n### `addPoint(point)`\n\nadd more points\n\n* point **Array[]** points to add, [[x, y, value], [x, y, value]..]\n\n**Returns** `this`\n\n### `redraw()`\n\n**Returns** `this`\n\n### `isEmpty()`\n\n**Returns** `Boolean`\n\n### `clear()`\n\n**Returns** `this`\n\n### `toJSON(options)`\n\nexport the layer's JSON.\n\n* options **Object** options\n    * clipExtent **maptalks.Extent** the extent to clip\n\n```javascript\n// only export points in map's current extent.\nheatLayer.toJSON({\n    'clipExtent' : map.getExtent()\n});\n```\n\n**Returns** `Object`\n\n## Contributing\n\nWe welcome any kind of contributions including issue reportings, pull requests, documentation corrections, feature requests and any other helps.\n\n## Develop\n\nThe only source file is ```index.js```.\n\nIt is written in ES6, transpiled by [babel](https://babeljs.io/) and tested with [mocha](https://mochajs.org) and [expect.js](https://github.com/Automattic/expect.js).\n\n### Scripts\n\n* Install dependencies\n```shell\n$ npm install\n```\n\n* Watch source changes and generate runnable bundle repeatedly\n```shell\n$ gulp watch\n```\n\n* Tests\n```shell\n$ npm test\n```\n\n* Watch source changes and run tests repeatedly\n```shell\n$ gulp tdd\n```\n\n* Package and generate minified bundles to dist directory\n```shell\n$ gulp minify\n```\n\n* Lint\n```shell\n$ npm run lint\n```\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptalks%2Fmaptalks.heatmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaptalks%2Fmaptalks.heatmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptalks%2Fmaptalks.heatmap/lists"}