{"id":31021360,"url":"https://github.com/sisl/d3trees.jl","last_synced_at":"2026-03-01T03:01:10.467Z","repository":{"id":39615562,"uuid":"104132528","full_name":"sisl/D3Trees.jl","owner":"sisl","description":"Flexible interactive visualization for large trees in Julia using D3.js","archived":false,"fork":false,"pushed_at":"2026-03-01T01:04:32.000Z","size":299,"stargazers_count":46,"open_issues_count":10,"forks_count":10,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-03-01T02:14:12.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sisl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-09-19T21:47:42.000Z","updated_at":"2026-02-28T23:17:57.000Z","dependencies_parsed_at":"2025-07-16T07:27:21.893Z","dependency_job_id":"91a26d1b-c0e0-4718-87c6-c89eb9dace3e","html_url":"https://github.com/sisl/D3Trees.jl","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/sisl/D3Trees.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2FD3Trees.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2FD3Trees.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2FD3Trees.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2FD3Trees.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sisl","download_url":"https://codeload.github.com/sisl/D3Trees.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisl%2FD3Trees.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29959284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"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-09-13T11:20:49.089Z","updated_at":"2026-03-01T03:01:10.427Z","avatar_url":"https://github.com/sisl.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# D3Trees\n\n[![Build Status](https://github.com/sisl/D3Trees.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/sisl/D3Trees.jl/actions/workflows/CI.yml)\n[![Code Coverage](https://codecov.io/gh/sisl/D3Trees.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/sisl/D3Trees.jl)\n\nFlexible interactive visualization for large trees using [D3.js](d3js.org).\n\n![Tree](img/tree.png)\n\n## Installation\n\n```julia\nPkg.add(\"D3Trees\")\n```\n\n## Basic Usage\n\nThere are two ways to create a D3Tree object described below:\n\n### 1) With AbstractTrees\n\nAny object that implements the interface from AbstractTrees can be given to the constructor: `D3Tree(object)`.\n\nSee the docstring (`julia\u003e ?D3Tree`) for information on how to control the style.\n\n### 2) Without AbstractTrees\n\nThe structure of a D3Tree is specified with *lists of children for each node* stored in a `Vector` of `Int` `Vector`s. For example,\n\n```julia\nD3Tree([[2,3], [], [4], []])\n```\n\ncreates a tree with four nodes. Nodes 2 and 3 are children of node 1, and node 4 is the only child of node 3. Nodes 2 and 4 are childless.\n\n## Displaying Trees\n\nIn an IJulia notebook, Pluto or VSCode, the tree will automatically be displayed using D3.js. (see [issue #32](https://github.com/sisl/D3Trees.jl/issues/32) - thanks [@mmikhasenko](https://github.com/mmikhasenko)!)\n\n\u003cimg width=\"375\" height=\"404\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ea84e2a8-a558-4699-93f0-ac4ea80fb374\" /\u003e\n\n\nTo get an interactive display in a chrome browser from the repl or a script, you can use the `inchrome` function. The `blink` function can also open it in a standalone window using the `Blink.jl` package.\n\n```julia\nchildren = [[2,3], [4,5], [6,7], [8,9], [1], [], [], [], []]\nt = D3Tree(children)\n\ninchrome(t)\ninbrowser(t, \"firefox\")\n```\n\nBy clicking on the nodes, you can expand it to look like the image at the top of the page.\n\n## Style Control\n\nOptional arguments control other aspects of the style (use `julia\u003e ?D3Tree` for a complete list), for example,\n\n```julia\nchildren = [[2,3], [], [4], []]\ntext = [\"one\\n(second line)\", \"2\", \"III\", \"four\"]\nstyle = [\"\", \"fill:red\", \"r:14px\", \"opacity:0.7\"]\nlink_style = [\"\", \"stroke:blue\", \"\", \"stroke-width:10px\"]\ntooltip = [\"pops\", \"up\", \"on\", \"hover\"]\nt = D3Tree(children,\n           text=text,\n           style=style,\n           tooltip=tooltip,\n           link_style=link_style,\n           title=\"My Tree\",\n           init_expand=10)\n\ninchrome(t)\n```\n\nwill yield\n\n![Expanded tree with style](img/styled_tree.png)\n\nor, see [examples/hello.ipynb](https://nbviewer.jupyter.org/github/sisl/D3Trees.jl/blob/master/examples/hello.ipynb)\n\n## Lazy loading trees\n\nDeep trees can be expanded on demand from the visualization by clicking on unexpanded nodes. For example, see [examples/LazyLoadDeepTrees.ipynb](https://nbviewer.jupyter.org/github/sisl/D3Trees.jl/blob/master/examples/LazyLoadDeepTrees.ipynb)\n\nThe lazy loading can be controlled through two main keyword arguments:\n\n- `lazy_expand_after_depth` which controls the initial expansion depth of the tree, before being sent as json to the visualization, \n- `lazy_subtree_depth` which determines the depth of on-demand expanded subtrees.\n\n```julia\n# very deep tree\nldroot = LimitedDepthTree()\n# launches visualization and click some nodes\nD3Tree(ldroot, lazy_expand_after_depth=0,  lazy_subtree_depth=1)\n```\n\nreturns\n![Expanded tree with style](img/deep_tree.png)\n\n## Text output\n\nD3Trees also supports basic text output. This can be achieved by writing to an io object with the `text/plain` mime. This format is the automatic output if a D3Tree is created in the REPL:\n\n```julia\njulia\u003e children = [[2,3], [4,5], [6,7], [8,9], [1], [], [], [], []];\n\njulia\u003e t = D3Tree(children)\n1\n├──2\n│  ├──4\n│  │  ├──8 (0 children)\n│  │  └──9 (0 children)\n│  └──5\n│     └──1 (2 children)\n└──3\n   ├──6\n   └──7\n```\n\n## Browser compatibility\n\nThis package works best in the Google chrome or chromium browser.\n\n## Limitations\n\n- This will not work offline because it downloads the D3 library on the fly (\u003chttps://github.com/sisl/D3Trees.jl/issues/10\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsisl%2Fd3trees.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsisl%2Fd3trees.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsisl%2Fd3trees.jl/lists"}