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

graphty-org / graphty-element / 15958807562

29 Jun 2025 07:51PM UTC coverage: 73.631% (+0.2%) from 73.423%
15958807562

push

github

apowers313
test(test): remove .only test

270 of 375 branches covered (72.0%)

Branch coverage included in aggregate %.

2056 of 2784 relevant lines covered (73.85%)

485.68 hits per line

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

65.52
/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
    scalingFactor = 80;
1✔
18
    config: CircularLayoutConfigType;
19

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

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

30
        this.positions = circularLayout(
×
31
            {nodes, edges},
×
32
            this.config.scale,
×
33
            this.config.center,
×
34
            this.config.dim,
×
35
        );
×
36
    }
×
37
}
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