{"id":13645689,"url":"https://github.com/HeartlandSoftware/AndroidHeatMap","last_synced_at":"2025-04-21T14:32:02.125Z","repository":{"id":44466369,"uuid":"71089198","full_name":"HeartlandSoftware/AndroidHeatMap","owner":"HeartlandSoftware","description":"A heat map view for Android.","archived":false,"fork":false,"pushed_at":"2020-07-15T02:17:29.000Z","size":296,"stargazers_count":127,"open_issues_count":5,"forks_count":33,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-09T18:43:22.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HeartlandSoftware.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":"2016-10-17T01:30:41.000Z","updated_at":"2024-11-01T12:11:01.000Z","dependencies_parsed_at":"2022-08-19T12:12:09.976Z","dependency_job_id":null,"html_url":"https://github.com/HeartlandSoftware/AndroidHeatMap","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeartlandSoftware%2FAndroidHeatMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeartlandSoftware%2FAndroidHeatMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeartlandSoftware%2FAndroidHeatMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeartlandSoftware%2FAndroidHeatMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HeartlandSoftware","download_url":"https://codeload.github.com/HeartlandSoftware/AndroidHeatMap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070252,"owners_count":21369842,"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":[],"created_at":"2024-08-02T01:02:39.753Z","updated_at":"2025-04-21T14:32:01.736Z","avatar_url":"https://github.com/HeartlandSoftware.png","language":"Java","readme":"[![Release](https://jitpack.io/v/ca.heartlandsoftware/androidheatmap.svg)](https://jitpack.io/#ca.heartlandsoftware/androidheatmap)\n[![API](https://img.shields.io/badge/API-18%2B-yellow.svg?style=flat)](https://android-arsenal.com/api?level=18)\n[![Apache 2](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/HeartlandSoftware/AndroidHeatMap/blob/master/LICENSE)\n\n# AndroidHeatMap\n\n[**AndroidHeatMap**](https://github.com/HeartlandSoftware/AndroidHeatMap) is an easy to use heat map control for Android apps.\n\n![Example View](https://raw.githubusercontent.com/HeartlandSoftware/AndroidHeatMap/master/images/screen.png)\n\n## Installation\n\nThere are three different ways to use this library:\n\n**1. Gradle dependency** (recommended)\n\n- Add the following to your project level `build.gradle`:\n\n```gradle\nallprojects {\n\trepositories {\n\t\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n```\n- Add this to your app `build.gradle`:\n\n```gradle\ndependencies {\n\timplementation 'ca.heartlandsoftware:androidheatmap:1.2.0'\n}\n```\n\n**2. Maven**\n- Add the following to the `\u003crepositories\u003e` section of your `pom.xml`:\n\n```xml\n\u003crepository\u003e\n\t\u003cid\u003ejitpack.io\u003c/id\u003e\n\t\u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n\u003c/repository\u003e\n```\n- Add the following to the `\u003cdependencies\u003e` section of your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003eca.heartlandsoftware\u003c/groupId\u003e\n\t\u003cartifactId\u003eandroidheatmap\u003c/artifactId\u003e\n\t\u003cversion\u003e1.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**3. Clone the whole repository**\n - Open your **commandline-input** and navigate to the desired destination folder on your machine (where you want to place the library)\n - Use the command `git clone https://github.com/HeartlandSoftware/AndroidHeatMap.git` to download the full AndroidHeatMap repository to your computer (this includes the folder of the library as well as the folder of the example project)\n - Import the library folder (`AndroidHeatMap`) into Android Studio (recommended) or your Eclipse workspace\n - Add it as a reference to your project: \n   - [referencing library projects in Eclipse](http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject)\n   - [managing projects from Android Studio](https://developer.android.com/sdk/installing/create-project.html)\n\n## Getting Started\n\nAdd a HeatMap control to your xml layout.\n\n```xml\n\u003cca.hss.heatmaplib.HeatMap\n    android:id=\"@+id/heatmap\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:minOpacity=\"0\"\n    app:maxOpacity=\"255\" /\u003e\n```\n\nBack in your activity or fragment you would get a reference to the BottomSheetLayout like any other view.\n```java\nHeatMap heatMap = (HeatMap) findViewById(R.id.heatmap);\n```\n\nSet the range that you want the heat maps gradient to cover.\n\n```java\nheatMap.setMinimum(0.0);\nheatMap.setMaximum(100.0);\n```\n\nNow you can add data to the heat map.\n\n```java\n//add random data to the map\nRandom rand = new Random();\nfor (int i = 0; i \u003c 20; i++) {\n    HeatMap.DataPoint point = new HeatMap.DataPoint(rand.nextFloat(), rand.nextFloat(), rand.nextDouble() * 100.0);\n    heatMap.addData(point);\n}\n```\n\n## Options\n\n### Colour Gradient\n\nChanging the colour gradient.\n\n```java\n//make the colour gradient from pink to yellow\nMap\u003cFloat, Integer\u003e colorStops = new ArrayMap\u003c\u003e();\ncolors.put(0.0f, 0xffee42f4);\ncolors.put(1.0f, 0xffeef442);\nheatMap.setColorStops(colors);\n```\n\n### Opacity\n\nSet the minimum and maximum opacity of the heat map. The value is an 2 byte alpha value with the range [0,255].\n\n```java\n//make the minimum opacity completely transparent\nheatMap.setMinimumOpactity(0);\n//make the maximum opacity 50% transparent\nheatMap.setMaximumOpacity(127);\n```\n\nOr set it in xml.\n\n```xml\n\u003cca.hss.heatmaplib.HeatMap\n    app:minOpacity=\"0\"\n    app:maxOpacity=\"255\" /\u003e\n```\n\n### Radius\n\nSet the radius of each points coloured gradient.\n\n```java\n//set the radius to 300 pixels.\nheatMap.setRadius(300);\n```\n\nOr in xml.\n\n```xml\n\u003cca.hss.heatmaplib.HeatMap\n    app:radius=\"100dp\" /\u003e\n```\n\n### HeatMap Size\n\nIf you are seeing ```OutOfMemoryError``` thrown on some devices this can be used to reduce the size of the bitmap that the HeatMap is rendered on to reduce memory usage.\n\n```java\n//set the maximum width to 400px\nheatMap.setMaxDrawingWidth(400);\n```\n\nOr in xml.\n\n```xml\n\u003cca.hss.heatmaplib.HeatMap\n    app:maxDrawingWidth=\"200dp\" /\u003e\n```\n\n### Draw Data Markers\n\nMarkers can be drawn on the HeatMap to indicate where the data points are located. The markers are drawn in a callback to allow any app to decide how the marker should be drawn. An example callback is included that draws a simple circle at the data point.\n\n```java\n//draw a dark violet circle at the location of each data point\nheatMap.setMarkerCallback(new HeatMapMarkerCallback.CircleHeatMapMarker(0xff9400D3));\n```\n\n### Refresh\n\nAfter changing an option after the heat map has been rendered force a refresh.\n\n```java\nheatMap.forceRefresh();\n```\n\n## License\n\nCopyright 2020 Heartland Software Solutions Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing\npermissions and limitations under the License.\n","funding_links":[],"categories":["其他"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeartlandSoftware%2FAndroidHeatMap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHeartlandSoftware%2FAndroidHeatMap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeartlandSoftware%2FAndroidHeatMap/lists"}