@prefecthq/graphs 3.0.1 → 3.0.2

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.
@@ -11,8 +11,8 @@ export type RunGraphProps = {
11
11
  };
12
12
  export type RunGraphData = {
13
13
  root_node_ids: string[];
14
- start_time: Date;
15
- end_time: Date | null;
14
+ start_time: string;
15
+ end_time: string | null;
16
16
  nodes: RunGraphNodes;
17
17
  artifacts?: RunGraphArtifact[];
18
18
  states?: RunGraphStateEvent[];
@@ -28,8 +28,8 @@ export type RunGraphNode = {
28
28
  id: string;
29
29
  label: string;
30
30
  state_type: StateType;
31
- start_time: Date;
32
- end_time: Date | null;
31
+ start_time: string;
32
+ end_time: string | null;
33
33
  parents: RunGraphEdge[];
34
34
  children: RunGraphEdge[];
35
35
  artifacts?: RunGraphArtifact[];
@@ -54,7 +54,6 @@ export type RunGraphStateStyles = {
54
54
  background?: ColorSource;
55
55
  };
56
56
  export type RunGraphStyles = {
57
- colorMode: 'dark' | 'light';
58
57
  rowGap?: number;
59
58
  columnGap?: number;
60
59
  textDefault?: ColorSource;
@@ -106,16 +105,18 @@ export type RunGraphStyles = {
106
105
  node?: (node: RunGraphNode) => RunGraphNodeStyles;
107
106
  state?: (state: RunGraphStateEvent) => RunGraphStateStyles;
108
107
  };
108
+ export type RunGraphTheme = 'dark' | 'light';
109
109
  export type RunGraphConfig = {
110
110
  runId: string;
111
111
  fetch: RunGraphFetch;
112
112
  fetchEvents?: RunGraphFetchEvents;
113
+ theme: RunGraphTheme;
113
114
  fetchEventsInterval?: number;
114
115
  animationDuration?: number;
115
- styles?: RunGraphStyles;
116
+ styles?: (theme: RunGraphTheme) => RunGraphStyles;
116
117
  disableAnimationsThreshold?: number;
117
118
  disableEdgesThreshold?: number;
118
119
  };
119
120
  export type RequiredGraphConfig = Omit<Required<RunGraphConfig>, 'styles'> & {
120
- styles: Required<RunGraphStyles>;
121
+ styles?: (theme: RunGraphTheme) => RunGraphStyles;
121
122
  };
@@ -4,7 +4,7 @@ import { Application, Container } from 'pixi.js';
4
4
  import { HorizontalScale } from '../factories/position';
5
5
  import { RunGraphEvent } from '../models';
6
6
  import { LayoutSettings } from '../models/layout';
7
- import { RequiredGraphConfig, RunGraphData } from '../models/RunGraph';
7
+ import { RequiredGraphConfig, RunGraphData, RunGraphStyles } from '../models/RunGraph';
8
8
  import { GraphItemSelection } from '../models/selection';
9
9
  import { ViewportDateRange } from '../models/viewport';
10
10
  import { Fonts } from '../objects/fonts';
@@ -36,6 +36,8 @@ type Events = {
36
36
  itemSelected: GraphItemSelection | null;
37
37
  layoutUpdated: void;
38
38
  toggleCullCreated: VisibilityCull;
39
+ stylesCreated: Required<RunGraphStyles>;
40
+ stylesUpdated: Required<RunGraphStyles>;
39
41
  };
40
42
  export type EventKey = keyof Events;
41
43
  export declare const emitter: {
@@ -0,0 +1,4 @@
1
+ import { RunGraphStyles } from '../models/RunGraph';
2
+ export declare function startStyles(): Promise<void>;
3
+ export declare function stopStyles(): void;
4
+ export declare function waitForStyles(): Promise<Required<RunGraphStyles>>;
@@ -1,2 +1,2 @@
1
- import { RequiredGraphConfig, RunGraphData } from '../models/RunGraph';
2
- export declare function getInitialHorizontalScaleMultiplier({ start_time, end_time, nodes }: RunGraphData, config: RequiredGraphConfig, aspectRatio: number): number;
1
+ import { RunGraphData, RunGraphStyles } from '../models/RunGraph';
2
+ export declare function getInitialHorizontalScaleMultiplier({ start_time, end_time, nodes }: RunGraphData, styles: Required<RunGraphStyles>, aspectRatio: number): number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prefecthq/graphs",
3
3
  "private": false,
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "description": "Large scale graphs designed for Prefect",
6
6
  "scripts": {
7
7
  "dev": "tsc -w & tsc-alias -w & vite build -w",
@@ -9,7 +9,8 @@
9
9
  "lint": "eslint src",
10
10
  "lint:fix": "eslint src --fix",
11
11
  "changelog": "auto-changelog --package --commit-limit 0",
12
- "release": "./graphs-release"
12
+ "release": "./graphs-release",
13
+ "validate:types": "tsc --noEmit"
13
14
  },
14
15
  "main": "./dist/graphs.umd.js",
15
16
  "module": "./dist/graphs.mjs",
@@ -62,7 +63,6 @@
62
63
  "fontfaceobserver": "^2.3.0",
63
64
  "gsap": "^3.12.2",
64
65
  "lodash.isequal": "4.5.0",
65
- "lodash.merge": "4.6.2",
66
66
  "lodash.throttle": "^4.1.1",
67
67
  "pixi-viewport": "5.0.3",
68
68
  "pixi.js": "7.3.2"