{"id":23505671,"url":"https://github.com/gamcil/clustermap.js","last_synced_at":"2025-09-07T20:37:22.093Z","repository":{"id":54110886,"uuid":"210521800","full_name":"gamcil/clustermap.js","owner":"gamcil","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-26T05:54:45.000Z","size":490,"stargazers_count":31,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-16T00:59:42.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/gamcil.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":"2019-09-24T05:49:43.000Z","updated_at":"2025-02-13T15:14:18.000Z","dependencies_parsed_at":"2022-08-13T06:50:46.462Z","dependency_job_id":null,"html_url":"https://github.com/gamcil/clustermap.js","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/gamcil%2Fclustermap.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamcil%2Fclustermap.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamcil%2Fclustermap.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamcil%2Fclustermap.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamcil","download_url":"https://codeload.github.com/gamcil/clustermap.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249178209,"owners_count":21225349,"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-12-25T09:38:53.255Z","updated_at":"2025-04-16T00:59:48.121Z","avatar_url":"https://github.com/gamcil.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clustermap.js\n\nA d3 chart for generating gene cluster comparison figures\n\n## What is it?\n\nclustermap.js is an interactive, reusable d3 chart designed to visualise homology between\nmultiple gene clusters.\n\n## Input data\n\nThe clustermap chart expects data in the following format:\n\n```\n{\n  \"clusters\": [\n    {\n      \"uid\":  \u003cstr: Unique ID\u003e,\n      \"name\": \u003cstr: Cluster name\u003e,\n      \"loci\": [\n        {\n          \"uid\":   \u003cstr: Unique ID\u003e,\n          \"name\":  \u003cstr: Locus name\u003e,\n          \"start\": \u003cint: Locus start position\u003e,\n          \"end\":   \u003cint: Locus end position\u003e,\n          \"genes\": [\n            {\n              \"uid\":    \u003cstr: Unique ID\u003e,\n              \"name\":   \u003cstr: Gene name\u003e,\n              \"start\":  \u003cint: Gene start position\u003e,\n              \"end\":    \u003cint: Gene end position\u003e,\n              \"strand\": \u003cint: Gene strand (0 or 1)\u003e,\n            }\n          ]}\n      ]}\n  ],\n  \"links\": [\n    {\n      \"query\": {\n      \t\"uid\":  \u003cstr: Unique ID of query gene\u003e,\n      \t\"name\": \u003cstr: Name of query gene\u003e\n      },\n      \"target\": {\n      \t\"uid\":  \u003cstr: Unique ID of target gene\u003e,\n      \t\"name\": \u003cstr: Name of target gene\u003e\n      },\n      \"identity\": \u003cfloat: Percent identity query-target alignment\u003e\n    }\n  ],\n  \"groups\": [\n    {\n      \"uid\":     \u003cstr: Unique ID of group\u003e,\n      \"label\":   \u003cstr: Group label\u003e,\n      \"genes\":  [\u003cstr: Gene UID\u003e],\n      \"colour\":  \u003cstr: Colour code for gene fill\u003e,\n      \"hidden\":  \u003cbool: Hide group in the plot\u003e\n    }\n  ]\n}\n```\n\n## Example usage\n\n1. Import d3 v6\n2. Import clustermap.js\n3. Style container div element to take up entire viewport\n4. Create and configure clustermap.js ClusterMap function\n5. Bind data to container div, call ClusterMap\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003c!-- Import d3 v6 and clustermap.js --\u003e\n    \u003cscript src=\"http://d3js.org/d3.v6.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"clustermap.min.js\"\u003e\u003c/script\u003e\n\n    \u003c!-- Make div take up entire viewport --\u003e\n    \u003c!-- clustermap.js \u003csvg\u003e element has 100% width/height --\u003e\n    \u003cstyle\u003e\n      div#plot {\n        width: 100vw;\n        height: 100vh;\n      }\n      #plot div {\n        width: 100vw;\n        height: 100vh;\n      }\n    \u003c/style\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- Create a \u003cdiv\u003e container for the clustermap.js plot --\u003e\n    \u003c!-- clustermap.js will create child \u003csvg\u003e (plot) and \u003cinput\u003e (colour picker) elements --\u003e\n    \u003cdiv id=\"plot\"\u003e\u003c/div\u003e\n    \u003cscript\u003e\n      // Create and configure the ClusterMap function.\n      let chart = ClusterMap.ClusterMap().config({\n        cluster: {\n          spacing: 30,\n          alignLabels: true,\n        },\n      });\n\n      // Load in data via d3.json, select \u003cdiv\u003e elements and call the\n      // chart function on the selection.\n      d3.json(\"data.json\").then((data) =\u003e {\n        d3.select(\"#plot\").datum(data).call(chart);\n      });\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamcil%2Fclustermap.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamcil%2Fclustermap.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamcil%2Fclustermap.js/lists"}