@prefecthq/graphs 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ declare const _default: {
10
10
  formatDateFns?: Partial<FormatDateFns> | undefined;
11
11
  selectedNodeId?: string | null | undefined;
12
12
  layout?: TimelineNodesLayoutOptions | undefined;
13
+ hideEdges?: boolean | undefined;
13
14
  }>>> & {
14
15
  onClick?: ((value: string | null) => any) | undefined;
15
16
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
@@ -33,6 +34,7 @@ declare const _default: {
33
34
  formatDateFns?: Partial<FormatDateFns> | undefined;
34
35
  selectedNodeId?: string | null | undefined;
35
36
  layout?: TimelineNodesLayoutOptions | undefined;
37
+ hideEdges?: boolean | undefined;
36
38
  }>>> & {
37
39
  onClick?: ((value: string | null) => any) | undefined;
38
40
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -64,6 +66,7 @@ declare const _default: {
64
66
  formatDateFns?: Partial<FormatDateFns> | undefined;
65
67
  selectedNodeId?: string | null | undefined;
66
68
  layout?: TimelineNodesLayoutOptions | undefined;
69
+ hideEdges?: boolean | undefined;
67
70
  }>>> & {
68
71
  onClick?: ((value: string | null) => any) | undefined;
69
72
  } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
@@ -77,6 +80,7 @@ declare const _default: {
77
80
  formatDateFns?: Partial<FormatDateFns> | undefined;
78
81
  selectedNodeId?: string | null | undefined;
79
82
  layout?: TimelineNodesLayoutOptions | undefined;
83
+ hideEdges?: boolean | undefined;
80
84
  }>>> & {
81
85
  onClick?: ((value: string | null) => any) | undefined;
82
86
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -18,7 +18,7 @@ export type NodeLayoutWorkerProps = {
18
18
  data: {
19
19
  layoutSetting?: TimelineNodesLayoutOptions;
20
20
  graphData: string;
21
- textMWidth?: number;
21
+ apxCharacterWidth?: number;
22
22
  spacingMinimumNodeEdgeGap?: number;
23
23
  timeScaleProps?: InitTimelineScaleProps;
24
24
  };
@@ -31,7 +31,9 @@ export type NodeLayoutItem = {
31
31
  };
32
32
  export type NodesLayout = Record<string, NodeLayoutItem>;
33
33
  export type NodeLayoutWorkerResponse = {
34
- data: NodesLayout;
34
+ data: {
35
+ layout: NodesLayout;
36
+ };
35
37
  };
36
38
  export type DateToX = (date: Date) => number;
37
39
  export type XToDate = (xPosition: number) => number;
@@ -2,8 +2,10 @@ export * from './bitmapFonts';
2
2
  export * from './deselectLayer';
3
3
  export * from './initPixiApp';
4
4
  export * from './initViewport';
5
+ export * from './nodeSprites';
5
6
  export * from './timelineEdge';
6
7
  export * from './timelineGuides';
8
+ export * from './timelineNode';
7
9
  export * from './timelineNodes';
8
10
  export * from './timelinePlayhead';
9
11
  export * from './timelineScale';
@@ -1,3 +1,3 @@
1
1
  import type { Viewport as ViewportType } from 'pixi-viewport';
2
- import type { Application } from 'pixi.js';
2
+ import { Application } from 'pixi.js';
3
3
  export declare function initViewport(stage: HTMLElement, appRef: Application): Promise<ViewportType>;
@@ -0,0 +1,20 @@
1
+ import { Application, Texture } from 'pixi.js';
2
+ type BoxTextures = Record<'cap' | 'body', Texture>;
3
+ export declare function initNodeTextureCache(): void;
4
+ export declare function destroyNodeTextureCache(): void;
5
+ type GetNodeBoxTexturesProps = {
6
+ appRef: Application;
7
+ fill: number;
8
+ borderRadius: number;
9
+ boxCapWidth: number;
10
+ height: number;
11
+ };
12
+ export declare function getNodeBoxTextures({ appRef, fill, borderRadius, boxCapWidth, height, }: GetNodeBoxTexturesProps): BoxTextures;
13
+ type GetEdgeArrowTextureProps = {
14
+ appRef: Application;
15
+ strokeColor: number;
16
+ edgeWidth: number;
17
+ edgeLength: number;
18
+ };
19
+ export declare function getEdgeArrowTexture({ appRef, strokeColor, edgeWidth, edgeLength, }: GetEdgeArrowTextureProps): Texture;
20
+ export {};
@@ -1,13 +1,15 @@
1
- import { Container } from 'pixi.js';
1
+ import { Application, Container } from 'pixi.js';
2
2
  import { ComputedRef } from 'vue';
3
- import { TimelineNode } from './timelineNode';
4
3
  import { ParsedThemeStyles } from '../models';
4
+ import { TimelineNode } from '../pixiFunctions';
5
5
  type TimelineEdgeProps = {
6
+ appRef: Application;
6
7
  styles: ComputedRef<ParsedThemeStyles>;
7
8
  sourceNode: TimelineNode;
8
9
  targetNode: TimelineNode;
9
10
  };
10
11
  export declare class TimelineEdge extends Container {
12
+ private readonly appRef;
11
13
  private readonly styles;
12
14
  private readonly sourceNode;
13
15
  private readonly targetNode;
@@ -18,12 +20,12 @@ export declare class TimelineEdge extends Container {
18
20
  private readonly edge;
19
21
  private readonly arrow;
20
22
  private readonly unwatch;
21
- constructor({ styles, sourceNode, targetNode, }: TimelineEdgeProps);
23
+ constructor({ appRef, styles, sourceNode, targetNode, }: TimelineEdgeProps);
22
24
  private assignStartAndEndPositions;
23
25
  private drawEdge;
24
26
  private readonly getXBezier;
25
27
  private drawArrow;
26
- update(): void;
28
+ update(newStyles?: boolean): void;
27
29
  destroy(): void;
28
30
  }
29
31
  export {};
@@ -1,6 +1,5 @@
1
1
  import type { Viewport } from 'pixi-viewport';
2
- import { Container } from 'pixi.js';
3
- import type { Application } from 'pixi.js';
2
+ import { Application, Container } from 'pixi.js';
4
3
  import { ComputedRef, Ref } from 'vue';
5
4
  import { FormatDateFns, ParsedThemeStyles } from '../models';
6
5
  type TimelineGuidesProps = {
@@ -1,7 +1,8 @@
1
- import { Container } from 'pixi.js';
1
+ import { Application, Container } from 'pixi.js';
2
2
  import { ComputedRef } from 'vue';
3
3
  import { ParsedThemeStyles, TimelineNodeData, NodeThemeFn } from '../models';
4
4
  type TimelineNodeProps = {
5
+ appRef: Application;
5
6
  nodeData: TimelineNodeData;
6
7
  styles: ComputedRef<ParsedThemeStyles>;
7
8
  styleNode: ComputedRef<NodeThemeFn>;
@@ -9,11 +10,13 @@ type TimelineNodeProps = {
9
10
  };
10
11
  export declare const timelineNodeBoxName = "box";
11
12
  export declare class TimelineNode extends Container {
13
+ private readonly appRef;
12
14
  nodeData: TimelineNodeData;
13
15
  private readonly styles;
14
16
  private readonly styleNode;
15
17
  private readonly unwatch;
16
18
  private label;
19
+ private readonly boxCapWidth;
17
20
  private readonly box;
18
21
  private apxLabelWidth;
19
22
  private nodeWidth;
@@ -21,13 +24,15 @@ export declare class TimelineNode extends Container {
21
24
  layoutPosition: number;
22
25
  private isLabelInBox;
23
26
  private readonly selectedRing;
24
- constructor({ nodeData, styles, styleNode, layoutPosition, }: TimelineNodeProps);
27
+ constructor({ appRef, nodeData, styles, styleNode, layoutPosition, }: TimelineNodeProps);
25
28
  private getNodeWidth;
26
29
  private getLayoutPositionOffset;
27
30
  private drawBox;
31
+ private getBoxBodyWidth;
28
32
  private drawLabel;
29
33
  private drawSelectedRing;
30
34
  private animateIn;
35
+ private updateBoxWidth;
31
36
  updatePosition(skipAnimation?: boolean): Promise<void>;
32
37
  private updateLabelPosition;
33
38
  update(newNodeData?: TimelineNodeData): Promise<void>;
@@ -1,16 +1,17 @@
1
1
  import type { Viewport } from 'pixi-viewport';
2
2
  import { Application, Container } from 'pixi.js';
3
3
  import { ComputedRef } from 'vue';
4
- import { TimelineNode } from './timelineNode';
5
4
  import { NodeThemeFn, ParsedThemeStyles, TimelineNodeData, TimelineNodesLayoutOptions, InitTimelineScaleProps } from '../models';
5
+ import { TimelineNode } from '../pixiFunctions';
6
6
  type TimelineNodesProps = {
7
7
  appRef: Application;
8
8
  viewportRef: Viewport;
9
9
  graphData: TimelineNodeData[];
10
10
  styles: ComputedRef<ParsedThemeStyles>;
11
11
  styleNode: ComputedRef<NodeThemeFn>;
12
+ layoutSetting: TimelineNodesLayoutOptions;
13
+ hideEdges: boolean;
12
14
  timeScaleProps: InitTimelineScaleProps;
13
- layoutSetting?: TimelineNodesLayoutOptions;
14
15
  };
15
16
  export declare class TimelineNodes extends Container {
16
17
  private readonly appRef;
@@ -21,12 +22,13 @@ export declare class TimelineNodes extends Container {
21
22
  private readonly nodeContainer;
22
23
  readonly nodeRecords: Map<string, TimelineNode>;
23
24
  selectedNodeId: string | null | undefined;
24
- private readonly layoutSetting;
25
+ private layoutSetting;
26
+ private hideEdges;
25
27
  private readonly layoutWorker;
26
28
  private layout;
27
29
  private readonly edgeContainer;
28
30
  private readonly edgeRecords;
29
- constructor({ appRef, viewportRef, graphData, styles, styleNode, layoutSetting, timeScaleProps: { minimumStartTime, overallGraphWidth, initialOverallTimeSpan, }, }: TimelineNodesProps);
31
+ constructor({ appRef, viewportRef, graphData, styles, styleNode, layoutSetting, hideEdges, timeScaleProps: { minimumStartTime, overallGraphWidth, initialOverallTimeSpan, }, }: TimelineNodesProps);
30
32
  private initLayoutWorker;
31
33
  private initDeselectLayer;
32
34
  private renderLayout;
@@ -36,6 +38,11 @@ export declare class TimelineNodes extends Container {
36
38
  private addNodeEdges;
37
39
  update(newData?: TimelineNodeData[]): void;
38
40
  updateSelection(selectedNodeId?: string | null): void;
41
+ updateHideEdges(hideEdges: boolean): void;
42
+ updateLayoutSetting(layoutSetting: TimelineNodesLayoutOptions): void;
43
+ private clearNodeSelection;
44
+ private setNodeSelection;
45
+ private centerViewportAfterOutsideAnimation;
39
46
  private highlightSelectedNodePath;
40
47
  private unHighlightAll;
41
48
  private getAllUpstreamEdges;
@@ -1,6 +1,5 @@
1
1
  import type { Viewport } from 'pixi-viewport';
2
- import { Container } from 'pixi.js';
3
- import type { Application } from 'pixi.js';
2
+ import { Application, Container } from 'pixi.js';
4
3
  import { ComputedRef } from 'vue';
5
4
  import { FormatDateFns, ParsedThemeStyles } from '../models';
6
5
  type TimelinePlayheadProps = {
@@ -1,4 +1,4 @@
1
- import { P as c, R as b, T as C, C as P } from "./index-00ae5c0c.mjs";
1
+ import { P as c, R as b, T as C, C as P } from "./index-52fe544f.mjs";
2
2
  import "vue";
3
3
  class u {
4
4
  constructor(t) {
@@ -1530,4 +1530,4 @@ export {
1530
1530
  O as Viewport,
1531
1531
  $ as Wheel
1532
1532
  };
1533
- //# sourceMappingURL=viewport.es-5037f525.mjs.map
1533
+ //# sourceMappingURL=viewport.es-a6380c41.mjs.map