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

graphty-org / graphty-element / 15895541958

26 Jun 2025 07:19AM UTC coverage: 77.956% (+3.3%) from 74.622%
15895541958

push

github

apowers313
docs(readme): add coverage badge

283 of 391 branches covered (72.38%)

Branch coverage included in aggregate %.

2150 of 2730 relevant lines covered (78.75%)

551.19 hits per line

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

61.29
/src/layout/CircularLayoutEngine.ts
1
// @ts-expect-error graphty layout doesn't currently have types
2
import {circularLayout} from "@graphty/layout";
1✔
3
import {z} from "zod/v4";
1✔
4

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

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

16
export class CircularLayout extends SimpleLayoutEngine {
1✔
17
    static type = "circular";
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 graph = {
×
29
            nodes: () => this._nodes.map((n) => n.id),
×
30
            edges: () => this._edges.map((e) => [e.srcId, e.dstId]),
×
31
        };
×
32

33
        this.positions = circularLayout(
×
34
            graph,
×
35
            this.config.scale,
×
36
            this.config.center,
×
37
            this.config.dim,
×
38
        );
×
39
    }
×
40
}
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