Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

@dioramajs/data/graph

Exports of @dioramajs/data/graph.

View as Markdown
On this page
import { backdrop, default, fitTo } from '@dioramajs/data/graph'

Functions

backdropThe colour painted behind an element: the first ancestor background that is not clear.
fitToLayout positions stretched into `plot`, element px; a flat axis stays in the middle.
layoutGraphPositions of the nodes, x right and y down, in a frame of the box's proportions; the same graph, mode, aspect and seed always give the same picture.
neighborsNeighbors of every node, in the order the links were written.
readGraphNodes and links of a list or a table. A list: every `<li>` is a node, a nested list links its items to the item it sits in, `data-dio-to` links to other items by id or label. A table: each row links the names in its first two cells, a number in the third is the link's weight.
spanningA spanning tree by breadth from node 0, then from the first node of each other part: the parent and depth of every node, and the roots of the parts.

Constants

defaultA list or a table of links drawn as a network: nodes in group colors sized by their links, laid out once from a seed, that grow in when the graph scrolls into view. The pointer or focus on a node lights it and its neighbors; the markup stays for screen readers and keyboards.
MAX_NODESMost nodes one graph draws; the rest of a longer list stays DOM only.

Interfaces

GraphData
GraphEdge
GraphNodeA node of the graph: a list item, or a name in a table of links.