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

graphty-org / graphty-element / 18770573775

24 Oct 2025 05:27AM UTC coverage: 82.365% (+0.7%) from 81.618%
18770573775

push

github

apowers313
ci: fix ci, take 2

1221 of 1491 branches covered (81.89%)

Branch coverage included in aggregate %.

6588 of 7990 relevant lines covered (82.45%)

601.6 hits per line

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

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

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

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

16
export class ShellLayout extends SimpleLayoutEngine {
2✔
17
    static type = "shell";
2✔
18
    static maxDimensions = 2;
2✔
19
    scalingFactor = 100;
2✔
20
    config: ShellLayoutConfigType;
21

22
    constructor(opts: ShellLayoutOpts) {
2✔
23
        super(opts);
1✔
24
        this.config = ShellLayoutConfig.parse(opts);
1✔
25
    }
1✔
26

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

32
        this.positions = shellLayout(
×
33
            {nodes, edges},
×
34
            this.config.nlist,
×
35
            this.config.scale,
×
36
            this.config.center,
×
37
            this.config.dim,
×
38
        );
×
39
    }
×
40
}
2✔
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