• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

graphty-org / graphty-element / 16240476180

12 Jul 2025 05:37PM UTC coverage: 73.747% (+3.6%) from 70.153%
16240476180

push

github

apowers313
docs(storybook): update layout library, re-add multipartite, bipartite, and bfs stories

534 of 738 branches covered (72.36%)

Branch coverage included in aggregate %.

4073 of 5509 relevant lines covered (73.93%)

1108.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/layout/CircularLayoutEngine.ts
1
import {circularLayout, Edge as LayoutEdge, Node as LayoutNode} from "@graphty/layout";
1✔
2
import {z} from "zod/v4";
1✔
3

4
import {SimpleLayoutConfig, SimpleLayoutEngine} from "./LayoutEngine";
1✔
5

6
export const CircularLayoutConfig = z.strictObject({
1✔
7
    ... SimpleLayoutConfig.shape,
1✔
8
    scale: z.number().positive().default(1),
1✔
9
    center: z.array(z.number()).length(2).or(z.null()).default(null),
1✔
10
    dim: z.number().default(2),
1✔
11
});
1✔
12
export type CircularLayoutConfigType = z.infer<typeof CircularLayoutConfig>;
13
export type CircularLayoutOpts = Partial<CircularLayoutConfigType>;
14

15
export class CircularLayout extends SimpleLayoutEngine {
1✔
16
    static type = "circular";
1✔
17
    static maxDimensions = 2;
1✔
18
    scalingFactor = 80;
1✔
19
    config: CircularLayoutConfigType;
20

21
    constructor(opts: CircularLayoutOpts) {
1✔
22
        super(opts);
1✔
23
        this.config = CircularLayoutConfig.parse(opts);
1✔
24
    }
1✔
25

26
    doLayout(): void {
1✔
27
        this.stale = false;
×
28
        const nodes = (): LayoutNode[] => this._nodes.map((n) => n.id as LayoutNode);
×
29
        const edges = (): LayoutEdge[] => this._edges.map((e) => [e.srcId, e.dstId] as LayoutEdge);
×
30

31
        this.positions = circularLayout(
×
32
            {nodes, edges},
×
33
            this.config.scale,
×
34
            this.config.center,
×
35
            this.config.dim,
×
36
        );
×
37
    }
×
38
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc