@prefecthq/graphs 2.2.0 → 2.2.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.
@@ -1,11 +1,10 @@
1
- import { Container } from 'pixi.js';
2
- import { Artifact } from '../models/artifact';
1
+ import { RunGraphArtifact } from '../models/artifact';
3
2
  export type ArtifactFactory = Awaited<ReturnType<typeof artifactFactory>>;
4
3
  type ArtifactFactoryOptions = {
5
4
  cullAtZoomThreshold?: boolean;
6
5
  };
7
- export declare function artifactFactory(artifact: Artifact, { cullAtZoomThreshold }?: ArtifactFactoryOptions): Promise<{
8
- element: Container<import("pixi.js").DisplayObject>;
6
+ export declare function artifactFactory(artifact: RunGraphArtifact, { cullAtZoomThreshold }?: ArtifactFactoryOptions): Promise<{
7
+ element: import("pixi.js").Container<import("pixi.js").DisplayObject>;
9
8
  render: () => Promise<void>;
10
9
  getSelected: () => boolean;
11
10
  getDate: () => Date;
@@ -1,10 +1,10 @@
1
1
  import { ArtifactFactory } from '../factories/artifact';
2
2
  import { ArtifactClusterFactory } from '../factories/artifactCluster';
3
- import { Artifact } from '../models';
3
+ import { RunGraphArtifact } from '../models';
4
4
  export type FlowRunArtifactFactory = Awaited<ReturnType<typeof flowRunArtifactFactory>>;
5
5
  type ArtifactFactoryOptions = {
6
6
  type: 'artifact';
7
- artifact: Artifact;
7
+ artifact: RunGraphArtifact;
8
8
  } | {
9
9
  type: 'cluster';
10
10
  };
@@ -1,4 +1,4 @@
1
- import { Artifact } from '../models';
1
+ import { RunGraphArtifact } from '../models';
2
2
  export declare function flowRunArtifactsFactory(): Promise<{
3
- render: (newData?: Artifact[]) => Promise<void>;
3
+ render: (newData?: RunGraphArtifact[]) => Promise<void>;
4
4
  }>;
@@ -1,10 +1,10 @@
1
1
  import { Container } from 'pixi.js';
2
- import { StateEvent } from '../models/states';
2
+ import { RunGraphStateEvent } from '../models/states';
3
3
  export type FlowRunStateFactory = Awaited<ReturnType<typeof flowRunStateFactory>>;
4
4
  type FlowRunStateFactoryOptions = {
5
5
  end: Date;
6
6
  };
7
- export declare function flowRunStateFactory(state: StateEvent, options?: FlowRunStateFactoryOptions): Promise<{
7
+ export declare function flowRunStateFactory(state: RunGraphStateEvent, options?: FlowRunStateFactoryOptions): Promise<{
8
8
  element: Container<import("pixi.js").DisplayObject>;
9
9
  render: (newOptions?: FlowRunStateFactoryOptions) => void;
10
10
  }>;
@@ -1,6 +1,6 @@
1
1
  import { Container } from 'pixi.js';
2
- import { StateEvent } from '../models/states';
2
+ import { RunGraphStateEvent } from '../models/states';
3
3
  export declare function flowRunStatesFactory(): {
4
4
  element: Container<import("pixi.js").DisplayObject>;
5
- render: (newStateData?: StateEvent[]) => Promise<void>;
5
+ render: (newStateData?: RunGraphStateEvent[]) => Promise<void>;
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import { ColorSource } from 'pixi.js';
2
- import { Artifact } from '../models';
2
+ import { RunGraphArtifact } from '../models';
3
3
  import { GraphItemSelection } from '../models/selection';
4
- import { StateEvent, StateType } from '../models/states';
4
+ import { RunGraphStateEvent, StateType } from '../models/states';
5
5
  import { ViewportDateRange } from '../models/viewport';
6
6
  export type RunGraphProps = {
7
7
  config: RunGraphConfig;
@@ -14,8 +14,8 @@ export type RunGraphData = {
14
14
  start_time: Date;
15
15
  end_time: Date | null;
16
16
  nodes: RunGraphNodes;
17
- artifacts?: Artifact[];
18
- state_events?: StateEvent[];
17
+ artifacts?: RunGraphArtifact[];
18
+ state_events?: RunGraphStateEvent[];
19
19
  };
20
20
  export type RunGraphNodes = Map<string, RunGraphNode>;
21
21
  export type RunGraphNode = {
@@ -27,7 +27,7 @@ export type RunGraphNode = {
27
27
  end_time: Date | null;
28
28
  parents: RunGraphEdge[];
29
29
  children: RunGraphEdge[];
30
- artifacts?: Artifact[];
30
+ artifacts?: RunGraphArtifact[];
31
31
  };
32
32
  export type RunGraphEdge = {
33
33
  id: string;
@@ -85,7 +85,7 @@ export type RunGraphStyles = {
85
85
  playheadWidth?: number;
86
86
  playheadColor?: ColorSource;
87
87
  node?: (node: RunGraphNode) => RunGraphNodeStyles;
88
- state?: (state: StateEvent) => RunGraphStateStyles;
88
+ state?: (state: RunGraphStateEvent) => RunGraphStateStyles;
89
89
  };
90
90
  export type RunGraphConfig = {
91
91
  runId: string;
@@ -1,9 +1,9 @@
1
1
  export declare const artifactTypes: readonly ["result", "markdown", "table", "unknown"];
2
2
  export type ArtifactType = typeof artifactTypes[number];
3
- export type Artifact = {
3
+ export type RunGraphArtifact = {
4
4
  id: string;
5
5
  created: Date;
6
- key: string;
6
+ key?: string;
7
7
  type: ArtifactType;
8
8
  };
9
9
  export declare const artifactTypeIconMap: {
@@ -12,6 +12,10 @@ export declare function isArtifactSelection(selection: GraphItemSelection): sele
12
12
  export type ArtifactsSelection = {
13
13
  kind: 'artifacts';
14
14
  ids: string[];
15
+ position?: {
16
+ x: number;
17
+ y: number;
18
+ };
15
19
  };
16
20
  export declare function isArtifactsSelection(selection: GraphItemSelection): selection is ArtifactsSelection;
17
21
  export type GraphItemSelection = NodeSelection | ArtifactSelection | ArtifactsSelection;
@@ -1,6 +1,6 @@
1
1
  export declare const stateType: readonly ["COMPLETED", "RUNNING", "SCHEDULED", "PENDING", "FAILED", "CANCELLED", "CANCELLING", "CRASHED", "PAUSED"];
2
2
  export type StateType = typeof stateType[number];
3
- export type StateEvent = {
3
+ export type RunGraphStateEvent = {
4
4
  id: string;
5
5
  occurred: Date;
6
6
  type: StateType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prefecthq/graphs",
3
3
  "private": false,
4
- "version": "2.2.0",
4
+ "version": "2.2.2",
5
5
  "description": "Large scale graphs designed for Prefect",
6
6
  "scripts": {
7
7
  "serve": "vite --host --mode=demo",