@prefecthq/graphs 1.0.4 → 1.0.6

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.
@@ -1,4 +1,4 @@
1
- import { GraphTimelineNode, TimelineThemeOptions, FormatDateFns, TimelineNodesLayoutOptions, CenterViewportOptions, ExpandedSubNodes, NodeSelectionEvent } from './models';
1
+ import { GraphTimelineNode, TimelineThemeOptions, FormatDateFns, TimelineNodesLayoutOptions, CenterViewportOptions, ExpandedSubNodes, NodeSelectionEvent, TimelineVisibleDateRange } from './models';
2
2
  declare const _default: {
3
3
  new (...args: any[]): {
4
4
  $: import("vue").ComponentInternalInstance;
@@ -13,9 +13,11 @@ declare const _default: {
13
13
  hideEdges?: boolean | undefined;
14
14
  subNodeLabels?: Map<string, string> | undefined;
15
15
  expandedSubNodes?: ExpandedSubNodes<Record<string, unknown>> | undefined;
16
+ visibleDateRange?: TimelineVisibleDateRange | undefined;
16
17
  }>>> & {
17
18
  onSelection?: ((value: NodeSelectionEvent | null) => any) | undefined;
18
19
  onSubNodeToggle?: ((value: string) => any) | undefined;
20
+ "onUpdate:visibleDateRange"?: ((value: TimelineVisibleDateRange | undefined) => any) | undefined;
19
21
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
20
22
  $attrs: {
21
23
  [x: string]: unknown;
@@ -28,7 +30,7 @@ declare const _default: {
28
30
  }>;
29
31
  $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
30
32
  $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
31
- $emit: ((event: "selection", value: NodeSelectionEvent | null) => void) & ((event: "subNodeToggle", value: string) => void);
33
+ $emit: ((event: "selection", value: NodeSelectionEvent | null) => void) & ((event: "subNodeToggle", value: string) => void) & ((event: "update:visibleDateRange", value: TimelineVisibleDateRange | undefined) => void);
32
34
  $el: any;
33
35
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
34
36
  graphData: GraphTimelineNode[];
@@ -40,9 +42,11 @@ declare const _default: {
40
42
  hideEdges?: boolean | undefined;
41
43
  subNodeLabels?: Map<string, string> | undefined;
42
44
  expandedSubNodes?: ExpandedSubNodes<Record<string, unknown>> | undefined;
45
+ visibleDateRange?: TimelineVisibleDateRange | undefined;
43
46
  }>>> & {
44
47
  onSelection?: ((value: NodeSelectionEvent | null) => any) | undefined;
45
48
  onSubNodeToggle?: ((value: string) => any) | undefined;
49
+ "onUpdate:visibleDateRange"?: ((value: TimelineVisibleDateRange | undefined) => any) | undefined;
46
50
  }, {
47
51
  centerViewport: ({ skipAnimation }?: CenterViewportOptions) => void;
48
52
  moveViewportCenter: ({ xOffset, yOffset }: {
@@ -53,6 +57,8 @@ declare const _default: {
53
57
  selection: (value: NodeSelectionEvent | null) => void;
54
58
  } & {
55
59
  subNodeToggle: (value: string) => void;
60
+ } & {
61
+ "update:visibleDateRange": (value: TimelineVisibleDateRange | undefined) => void;
56
62
  }, string, {}, {}, string> & {
57
63
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
58
64
  created?: ((() => void) | (() => void)[]) | undefined;
@@ -83,9 +89,11 @@ declare const _default: {
83
89
  hideEdges?: boolean | undefined;
84
90
  subNodeLabels?: Map<string, string> | undefined;
85
91
  expandedSubNodes?: ExpandedSubNodes<Record<string, unknown>> | undefined;
92
+ visibleDateRange?: TimelineVisibleDateRange | undefined;
86
93
  }>>> & {
87
94
  onSelection?: ((value: NodeSelectionEvent | null) => any) | undefined;
88
95
  onSubNodeToggle?: ((value: string) => any) | undefined;
96
+ "onUpdate:visibleDateRange"?: ((value: TimelineVisibleDateRange | undefined) => any) | undefined;
89
97
  } & import("vue").ShallowUnwrapRef<{
90
98
  centerViewport: ({ skipAnimation }?: CenterViewportOptions) => void;
91
99
  moveViewportCenter: ({ xOffset, yOffset }: {
@@ -106,9 +114,11 @@ declare const _default: {
106
114
  hideEdges?: boolean | undefined;
107
115
  subNodeLabels?: Map<string, string> | undefined;
108
116
  expandedSubNodes?: ExpandedSubNodes<Record<string, unknown>> | undefined;
117
+ visibleDateRange?: TimelineVisibleDateRange | undefined;
109
118
  }>>> & {
110
119
  onSelection?: ((value: NodeSelectionEvent | null) => any) | undefined;
111
120
  onSubNodeToggle?: ((value: string) => any) | undefined;
121
+ "onUpdate:visibleDateRange"?: ((value: TimelineVisibleDateRange | undefined) => any) | undefined;
112
122
  }, {
113
123
  centerViewport: ({ skipAnimation }?: CenterViewportOptions) => void;
114
124
  moveViewportCenter: ({ xOffset, yOffset }: {
@@ -119,6 +129,8 @@ declare const _default: {
119
129
  selection: (value: NodeSelectionEvent | null) => void;
120
130
  } & {
121
131
  subNodeToggle: (value: string) => void;
132
+ } & {
133
+ "update:visibleDateRange": (value: TimelineVisibleDateRange | undefined) => void;
122
134
  }, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
123
135
  export default _default;
124
136
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -20,6 +20,11 @@ export type InitTimelineScaleProps = {
20
20
  graphXDomain: number;
21
21
  initialOverallTimeSpan: number;
22
22
  };
23
+ export type TimelineVisibleDateRange = {
24
+ startDate: Date;
25
+ endDate: Date;
26
+ internalOrigin?: boolean;
27
+ };
23
28
  export type TimelineNodesLayoutOptions = 'waterfall' | 'nearestParent';
24
29
  export type NodeSelectionEventTypes = 'task' | 'subFlowRun';
25
30
  export type NodeSelectionEvent = {
@@ -76,7 +81,7 @@ export type GraphState = {
76
81
  centerViewport: (options?: CenterViewportOptions) => void;
77
82
  };
78
83
  export type DateToX = (date: Date) => number;
79
- export type XToDate = (xPosition: number) => number;
84
+ export type XToDate = (xPosition: number) => Date;
80
85
  export type TimelineScale = {
81
86
  dateToX: DateToX;
82
87
  xToDate: XToDate;
@@ -2,17 +2,17 @@ import { Application, Container } from 'pixi.js';
2
2
  import { ComputedRef } from 'vue';
3
3
  import { ParsedThemeStyles } from '../models';
4
4
  type TimelineGuideProps = {
5
- appRef: Application;
5
+ pixiApp: Application;
6
6
  labelText: string | null;
7
- styles: ComputedRef<ParsedThemeStyles>;
7
+ styleOptions: ComputedRef<ParsedThemeStyles>;
8
8
  };
9
9
  export declare class TimelineGuide extends Container {
10
- private readonly appRef;
10
+ private readonly pixiApp;
11
11
  private readonly labelText;
12
- private readonly styles;
12
+ private readonly styleOptions;
13
13
  private guideLine;
14
14
  private label;
15
- constructor({ appRef, labelText, styles, }: TimelineGuideProps);
15
+ constructor({ pixiApp, labelText, styleOptions, }: TimelineGuideProps);
16
16
  private initGuideLine;
17
17
  private drawLabel;
18
18
  updateHeight(appHeight: number): void;
@@ -1,30 +1,22 @@
1
- import type { Viewport } from 'pixi-viewport';
2
- import { Application, Container } from 'pixi.js';
1
+ import { Container } from 'pixi.js';
3
2
  import { ComputedRef, Ref } from 'vue';
4
- import { FormatDateFns, ParsedThemeStyles } from '../models';
5
- type TimelineGuidesProps = {
6
- viewportRef: Viewport;
7
- appRef: Application;
8
- minimumStartDate: Date;
3
+ import { FormatDateFns, GraphState } from '../models';
4
+ type TimelineGuideProps = {
5
+ graphState: GraphState;
9
6
  maximumEndDate: Ref<Date | undefined>;
10
- isRunning: boolean;
11
- styleOptions: ComputedRef<ParsedThemeStyles>;
12
7
  formatDateFns: ComputedRef<FormatDateFns>;
13
8
  };
14
9
  export declare class TimelineGuides extends Container {
15
- private readonly viewportRef;
16
- private readonly appRef;
17
- private readonly minimumStartDate;
10
+ private readonly graphState;
18
11
  private readonly maximumEndDate;
19
- private readonly isRunning;
20
- private readonly styleOptions;
21
12
  private readonly formatDateFns;
22
- private readonly unwatch;
13
+ private readonly unWatchers;
23
14
  private idealGuideCount;
24
15
  private currentTimeGap;
25
16
  private labelFormatter;
26
17
  private readonly guides;
27
- constructor({ viewportRef, appRef, minimumStartDate, maximumEndDate, isRunning, styleOptions, formatDateFns, }: TimelineGuidesProps);
18
+ constructor({ graphState, maximumEndDate, formatDateFns, }: TimelineGuideProps);
19
+ private initWatchers;
28
20
  updateGuides(): void;
29
21
  private updateIdealGuideCount;
30
22
  private updateCurrentTimeGap;
@@ -1,4 +1,4 @@
1
- import { P as c, R as b, T as C, C as P } from "./index-21c883f9.mjs";
1
+ import { P as c, R as b, T as C, C as P } from "./index-9b903be3.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-84fb8076.mjs.map
1533
+ //# sourceMappingURL=viewport.es-87938ebd.mjs.map