{"id":18310530,"url":"https://github.com/wvhulle/map","last_synced_at":"2026-01-20T03:01:27.756Z","repository":{"id":245333385,"uuid":"817945028","full_name":"wvhulle/map","owner":"wvhulle","description":"Reactive data structures such as sets, maps and graphs","archived":false,"fork":false,"pushed_at":"2024-06-21T20:22:14.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T05:49:39.083Z","etag":null,"topics":["data-structures","graphs","maps","observables","reactive","svelte","tensors"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/wvhulle.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":"2024-06-20T19:18:03.000Z","updated_at":"2024-06-21T20:23:48.000Z","dependencies_parsed_at":"2025-04-05T17:44:41.884Z","dependency_job_id":"860657a0-1832-4305-8fb2-473b7e8bdce6","html_url":"https://github.com/wvhulle/map","commit_stats":null,"previous_names":["wvhulle/map"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wvhulle/map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvhulle%2Fmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvhulle%2Fmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvhulle%2Fmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvhulle%2Fmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wvhulle","download_url":"https://codeload.github.com/wvhulle/map/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wvhulle%2Fmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28594958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["data-structures","graphs","maps","observables","reactive","svelte","tensors"],"created_at":"2024-11-05T16:14:46.858Z","updated_at":"2026-01-20T03:01:27.738Z","avatar_url":"https://github.com/wvhulle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reactive maps\n\nContains several commonly used data structures enriched with reactivity.\n\nCan be used in conjunction with RxJS or Svelte.\n\n## Sets\n\nReactive set or list of reactive values.\n\nFeatures:\n\n- easily extended to implement custom storage based on equality\n- merging of equivalent elements if equivalence is defined\n- fast iteration over entries\n- behaves like an [RxJS array observable](rxjs.dev/guide/overview)\n- compatible with the Svelte auto-subscription with $-sign for user-defined stores.\n\nFor examples, see [tests](./lib/set/stream_of_sets.test.ts)\n\nImplemented as a stream of sets of streams.\n\n## Maps\n\nAssociative reactive arrays, also called reactive *maps* or reactive *dictionaries*.\n\nFeatures:\n\n- the keys can be anything that is serializable as JSON.\n- values of the map are reactive, individual keys are not\n- values can be reverted to an initial value or saved\n\nFor examples, see [tests](./lib/maps/hashMap.test.ts)\n\nThe implementation is an extension of a set where elements of the set are indexed by arbitrary serializable objects.\n\n## Recursive maps\n\nA special version of a reactive map that has a recursive index for keys. This means that for every key, also sub-keys or projections are indexed and put inside a map.\n\nFeatures:\n\n- key type safety when doing subspace look-ups\n- fast lookup inside subspaces such as rows and columns\n- fast iteration over all elements\n\nIf the index space is a vector of positive integers, this data structure corresponds to a [mathematical tensor](en.wikipedia.org/wiki/Tensor). That is why I use the name *tensor*. When the index space is one dimensional, this corresponds to a vector. When the index space is two-dimensional, this corresponds to a matrix.\n\nFor examples, see [tests](./lib/maps/tensor.test.ts)\n\nAddition or removal is a recursive action. It does depth-first traversal through the index tree. Performance improvements for over 10000 nodes are still in progress, though it is already useful for complex interactive data grids of less than 1000 rows.\n\n## Graphs\n\nNormal graph with a reactive list of nodes and reactive edges. There is also a topological graph. This is a graph where the edges have weights.\n\nFeatures:\n\n- reactive edges\n- shortest path between nodes\n\nImplementation of shortest path is the the Dijkstra shortest path algorithm. The shortest path is stored in a two-dimensional tensor.\n\n## Credits\n\nWritten during a trip to Austria in April 2023.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwvhulle%2Fmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwvhulle%2Fmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwvhulle%2Fmap/lists"}