{"id":29930386,"url":"https://github.com/vasturiano/d3-hilbert","last_synced_at":"2025-08-02T16:14:56.358Z","repository":{"id":11361332,"uuid":"69233504","full_name":"vasturiano/d3-hilbert","owner":"vasturiano","description":"D3 layout to visualize distance variables using a continuous Hilbert space-filling curve.","archived":false,"fork":false,"pushed_at":"2025-04-09T19:29:03.000Z","size":223,"stargazers_count":21,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-28T02:51:58.871Z","etag":null,"topics":["d3js","data-visualization","hilbert-curve","layout","space-filling-curves"],"latest_commit_sha":null,"homepage":"https://observablehq.com/@vasturiano/hilbert-curve","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/vasturiano.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":"2016-09-26T09:16:58.000Z","updated_at":"2025-04-09T19:29:07.000Z","dependencies_parsed_at":"2024-06-20T00:06:35.269Z","dependency_job_id":"dbd8832f-2207-43b2-84c3-ec39edbd4c34","html_url":"https://github.com/vasturiano/d3-hilbert","commit_stats":{"total_commits":64,"total_committers":3,"mean_commits":"21.333333333333332","dds":0.078125,"last_synced_commit":"7c2af9becaac6bca0553715f286fff050b8844f3"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/vasturiano/d3-hilbert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-hilbert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-hilbert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-hilbert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-hilbert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vasturiano","download_url":"https://codeload.github.com/vasturiano/d3-hilbert/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-hilbert/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268416772,"owners_count":24246979,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["d3js","data-visualization","hilbert-curve","layout","space-filling-curves"],"created_at":"2025-08-02T16:14:51.050Z","updated_at":"2025-08-02T16:14:56.342Z","avatar_url":"https://github.com/vasturiano.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"d3-hilbert\n==============\n\n[![NPM package][npm-img]][npm-url]\n[![Build Size][build-size-img]][build-size-url]\n[![NPM Downloads][npm-downloads-img]][npm-downloads-url]\n\nD3 layout to visualize distance variables using a continuous Hilbert space-filling curve. Here's an [example](https://observablehq.com/@vasturiano/hilbert-curve).\n\nSee also [d3-morton](https://github.com/vasturiano/d3-morton-order).\n\nIf you are looking for a module that also performs rendering, please see [hilbert-chart](https://github.com/vasturiano/hilbert-chart).\n\n## Quick start\n\n```js\nimport d3Hilbert from 'd3-hilbert';\n```\nor using a *script* tag\n```html\n\u003cscript src=\"//cdn.jsdelivr.net/npm/d3-hilbert\"\u003e\u003c/script\u003e\n```\nthen\n```js\nconst myRange = { start: 4, length: 9 };\nd3.hilbert()\n    .order(2)\n    .layout(myRange)\n```\n\n## API reference\n\n| Method | Description | Default |\n| ------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------- |\n| **canvasWidth**([*number*]) | Getter/setter for the length of each side of the hilbert square canvas. | 1 |\n| **order**([*int*]) | Getter/setter for the extent of the hilbert curve domain, determined by `4^order`. **The maximum safe order is *26***, due to the JS numbers upper-boundary of 53 bits. | 4 |\n| **simplifyCurves**([*boolean*]) | Getter/setter for whether to simplify the resolution of the curve to the most canonical 2-bit boundary that fits the range integral. For example, in a 2nd order curve (16 values), a range from *4* to *11* can be simplified from 8 vertices to 2 (each filling a square with 4 values), on the lower quadrants. This simplification greatly reduces the number of vertices in the curve and improves the calculation and rendering performance, specially for high-order ranges which tend to fall on bit boundaries, such as the case of IP address routes. | true |\n| **layout**(*rangeObject*) | Extends the input rangeObject (syntax: `{start:\u003cint\u003e, length:\u003cint\u003e}`) with 3 additional properties defining the hilbert curve: **.cellWidth** (*number* defining the side length of each square cell and essentially the thickness of the line, according to the canvasWidth), **.startCell** ([*int*,*int*] the x,y coordinates of the starting cell) and **.pathVertices** (*Array* of vertices, specified in terms of characters indicating movement direction: **UDLR** (**U**p, **D**own, **L**eft, **R**ight)). | |\n| **getValAtXY**(*num*, *num*) | Returns the reverse translated value on the curve domain found at coordinates *x*,*y*, relative to the canvasWidth. | |\n| **getXyAtVal**(*num*) | Returns the `[x, y]` coordinates of the requested value. Throws an error if the value is outside the boundaries of the current hilbert domain. | |\n\n\n[npm-img]: https://img.shields.io/npm/v/d3-hilbert\n[npm-url]: https://npmjs.org/package/d3-hilbert\n[build-size-img]: https://img.shields.io/bundlephobia/minzip/d3-hilbert\n[build-size-url]: https://bundlephobia.com/result?p=d3-hilbert\n[npm-downloads-img]: https://img.shields.io/npm/dt/d3-hilbert\n[npm-downloads-url]: https://www.npmtrends.com/d3-hilbert\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasturiano%2Fd3-hilbert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasturiano%2Fd3-hilbert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasturiano%2Fd3-hilbert/lists"}