{"id":17023023,"url":"https://github.com/precondition/hot_blobs","last_synced_at":"2026-05-02T01:33:21.537Z","repository":{"id":117655058,"uuid":"432553125","full_name":"precondition/hot_blobs","owner":"precondition","description":"A Python library for drawing transparent heatmap overlays","archived":false,"fork":false,"pushed_at":"2021-11-27T19:59:51.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T22:13:58.616Z","etag":null,"topics":["data-viz","heatmap","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/precondition.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-27T19:52:50.000Z","updated_at":"2021-11-27T19:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8fda0e2-ffbd-42ed-8f62-ebfa0b5aff5a","html_url":"https://github.com/precondition/hot_blobs","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/precondition%2Fhot_blobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precondition%2Fhot_blobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precondition%2Fhot_blobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precondition%2Fhot_blobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/precondition","download_url":"https://codeload.github.com/precondition/hot_blobs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244999406,"owners_count":20544873,"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":["data-viz","heatmap","python","python3"],"created_at":"2024-10-14T07:11:59.773Z","updated_at":"2026-05-02T01:33:21.496Z","avatar_url":"https://github.com/precondition.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hot Blobs\n\nA Python library for drawing heatmap overlays with the same look and feel as\n[simpleheat](https://github.com/mourner/simpleheat) and [heatmap.js](https://github.com/pa7/heatmap.js).\n\n![Glamor shot]()\n\nA \"heatmap\" can take many forms but this library focuses only on a single kind. See the illustrated table below.\nGeographic zoomable maps are not supported.\n\n![Horizontal strip of different heatmap types with a red cross in the corner of unsupported heatmap types]()\n\n## Reference\n\n### Constructor\n\n| Constructor | Description |\n|-------------|-------------|\n| `Heatmap(w: int, h: int)` | Constructs an empty `Heatmap` of dimensions `w`×`h` |\n\n### Public Methods\n\n| Return type | Method | Description |\n|-------------|--------|-------------|\n| hot_blobs.Heatmap | `data(data: Iterable[Tuple[int]], compute_max: bool = True)` | Initialise the heatmap data with `data` |\n| hot_blobs.Heatmap | `add(data: Iterable[Tuple[int, int]]` | Adds one or more data points to the heatmap |\n| hot_blobs.Heatmap | `clear()` | Clears all heatmap data points. |\n| hot_blobs.Heatmap | `max(maximum: int)` | Sets the maximum value with which to normalise the heatmap data points. |\n| hot_blobs.Heatmap | `stamp(r: int = 25, blur: int = 51)` | Creates a grayscale blurred circle image used like a rubber stamp for drawing points. |\n| hot_blobs.Heatmap | `resize(w: int, h: int)` | Resizes the dimensions of the heatmap. |\n| hot_blobs.Heatmap | `gradient(grad: Dict[float, Union[str, QColor]])` | Sets the color gradient to use in the heatmap to `grad`. |\n| np.ndarray | `generate_image(min_opacity: float = 0.05)` | Generates the final heatmap image in the form of a `width`×`height`×4 numpy array in RGBA format. |\n\nEach method contains a detailed docstring that you can consult anytime by typing `help(Heatmap.method_name)`.\n\nThe reason why all those \"setter\" methods return an instance of the Heatmap object is for purposes of function chaining.\nThis means that these two code blocks are perfectly equivalent:\n\n```py\nfrom hot_blobs import Heatmap\nhm = Heatmap(600, 300)\nhm.data(my_data)\nhm.max(20)\nhm.stamp(r=10, blur=63)\nim = hm.generate_image(0.1)\n```\n\n```py\nfrom hot_blobs import Heatmap\nim = Heatmap(600, 300).data(my_data).max(20).stamp(r=10, blur=63).generate_image(0.1)\n```\n\n### Basic example\n\n```py\nimport hot_blobs\nfrom PIL import Image # Use any desired library to convert the RGBA matrix into an image\n\n# You can either feed in a collection of non-unique 2D tuples\n# or a dictionary that associates a value to each unique tuple.\nobservations = [(400, 300), (400, 300), (400, 300), (10, 20), (10, 20), (750, 530)]\nobservations = {(400, 300): 3, (10, 20): 2, (750, 530): 1}\nheatmap_obj = hot_blobs.Heatmap(w=800, h=600).data(observations)\nheatmap_matrix = heatmap_obj.generate_image()\nImage.fromarray(heatmap_matrix).save(\"basic_heatmap_example.png\")\n```\n\nSee the `demo/` directory for more examples.\n\n\n\u003c!-- WIP\n## Prior Art\n\nThis is not the first nor the only Python heatmap library, but I developed it because none of the available offerings suited me.\n\nFirst, let's cite the №1 result you get when searching for \"heatmap python\" online: `seaborn`. While `seaborn` is a fine data-visualisation library that produces pretty heatmaps, they're not the kind of heatmap that you would overlay over a background picture.\n\n--\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecondition%2Fhot_blobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprecondition%2Fhot_blobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecondition%2Fhot_blobs/lists"}