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

graphty-org / graphty-element / 15948993626

28 Jun 2025 09:54PM UTC coverage: 73.423% (-4.5%) from 77.956%
15948993626

push

github

apowers313
build: add package linting and remove unused packages

254 of 356 branches covered (71.35%)

Branch coverage included in aggregate %.

1992 of 2703 relevant lines covered (73.7%)

462.07 hits per line

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

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

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

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

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

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

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

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

© 2025 Coveralls, Inc