{"id":32390804,"url":"https://github.com/e-/treecolors.js","last_synced_at":"2025-10-25T04:52:31.143Z","repository":{"id":25479328,"uuid":"28910117","full_name":"e-/TreeColors.js","owner":"e-","description":"A javascript implementation of the color scheme proposed in the paper \"TreeColors: Color Schemes for Tree-Structured Data\"","archived":false,"fork":false,"pushed_at":"2015-05-29T06:18:45.000Z","size":260,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-15T11:49:12.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://e-.github.io/TreeColors.js/demo","language":"JavaScript","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/e-.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}},"created_at":"2015-01-07T10:36:08.000Z","updated_at":"2023-01-17T07:54:53.000Z","dependencies_parsed_at":"2022-09-05T16:21:14.931Z","dependency_job_id":null,"html_url":"https://github.com/e-/TreeColors.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/e-/TreeColors.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-%2FTreeColors.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-%2FTreeColors.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-%2FTreeColors.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-%2FTreeColors.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e-","download_url":"https://codeload.github.com/e-/TreeColors.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e-%2FTreeColors.js/sbom","scorecard":{"id":362837,"data":{"date":"2025-08-11","repo":{"name":"github.com/e-/TreeColors.js","commit":"b9881294c354ce00145df25a03f69ea2837fd7d1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T11:12:16.243Z","repository_id":25479328,"created_at":"2025-08-18T11:12:16.243Z","updated_at":"2025-08-18T11:12:16.243Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280906445,"owners_count":26411413,"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-10-25T02:00:06.499Z","response_time":81,"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":[],"created_at":"2025-10-25T04:51:35.491Z","updated_at":"2025-10-25T04:52:31.138Z","avatar_url":"https://github.com/e-.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/e-/TreeColors.js.svg?branch=master)](https://travis-ci.org/e-/TreeColors.js)\n\n# TreeColors.js\n\n\u003e A javascript implementation of the color scheme proposed in the paper \"TreeColors: Color Schemes for Tree-Structured Data\" by [Martijn Tennekes](https://github.com/mtennekes) and [Edwin de Jonge](https://github.com/edwindj)\n\n## Install\n\nDownload the repository and include the script in your web page:\n\n```html\n\u003cscript src=\"TreeColors.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nYou can also install it using [npm](https://www.npmjs.com/package/treecolors)\n\n```\nnpm install treecolors\n```\n\nand load the library into your code:\n\n```js\nvar TreeColors = require('treecolors');\n```\n\n## Usage\n\nWe have two color schemes: `additive` and `subtractive`. You can choose one of them by passing the name of it.\n\n```js\nvar additive = TreeColors('add'),\n    subtractive = TreeColors('sub');\n```\n\nSuppose we have a tree structure which looks like this:\n\n```js\nvar tree = \n{\n  name: \"root\",\n  children: [\n    {\n      name: \"child1\"\n    },\n    {\n      name: \"child2\"\n    }\n  ]\n};\n```\n\nNote that each node has its children as an array with a key `children`. This is quite similar to the hierarchical structure used in [d3.js](http://d3js.org/).\n\nYou can color the tree by calling the color scheme as a function:\n\n```js\nadditive(tree); // color the tree with the additive color scheme\nsubtractive(tree); // color the tree with the subtractive color scheme\n```\n\nThen, the color scheme adds a field (named `color` by default) to each node. \n\n```js\nadditive(tree);\nconsole.log(tree.color); // { h: 0, c: 0, l: 70 }\nconsole.log(tree.children[0].color); // { h: 90, c: 65, l: 60 }\n```\n\nNote that we are using the HCL color space rather than the RGB color space. This is because the HCL color space is more balanced than the RGB color space in terms of human perception.  For more information, please refer to [the original paper](http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6875961\u0026tag=1) or this webpage([http://hclwizard.org/why-hcl/](http://hclwizard.org/why-hcl/)).\n\nUnfortunately, modern web browsers do not support the HCL color space. Therefore, you need to convert HCL color values to RGB color values. If you are using d3.js, it is super easy:\n\n```js\nvar rootColor = tree.color;\n\nconsole.log(d3.hcl(rootColor.h, rootColor.c, rootColor.l));\n```\n\nIf you want to paint d3's hierarchical visualizations such as treemaps, radial trees, or sunburst layout, first assign colors to the nodes:\n\n```js\nvar additive = TreeColors('add');\nadditive(tree);\n```\n\nand paint all the nodes:\n\n```js\nd3.selectAll('.node rect') // `rect` for treemaps. If you are using different layout, you may change it to `path` or `circle`.\n  .attr('fill', function(d){return d3.hcl(d.color.h, d.color.c, d.color.l);})\n```\n\nIf you are interested in integrating TreeColors with d3.js, please see [this demo](http://e-.github.io/TreeColors.js/demo/).\n\n## Options\n\nwill be documented soon.\n\n## License\n\nMIT © [Jaemin Jo](http://www.jaeminjo.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-%2Ftreecolors.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe-%2Ftreecolors.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe-%2Ftreecolors.js/lists"}