-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dagit] Async layout of large asset graphs (#7366)
- Loading branch information
Showing
37 changed files
with
532 additions
and
439 deletions.
There are no files selected for viewing
18 changes: 15 additions & 3 deletions
18
js_modules/dagit/packages/core/jest/mocks/dagre_layout.worker.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
// eslint-disable-next-line no-restricted-imports | ||
import {layoutPipeline, IPipelineLayoutParams} from '../../src/graph/layout'; | ||
import {ILayoutOp, layoutOpGraph} from '../../src/graph/layout'; | ||
import {GraphData} from '../../src/workspace/asset-graph/Utils'; | ||
import {layoutAssetGraph} from '../../src/workspace/asset-graph/layout'; | ||
|
||
type WorkerMessageData = | ||
| {type: 'layoutOpGraph'; ops: ILayoutOp[]; parentOp: ILayoutOp} | ||
| {type: 'layoutAssetGraph'; graphData: GraphData}; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default class MockWorker { | ||
onmessage = (_: any) => {}; | ||
|
||
// mock expects data: { } instead of e: { data: { } } | ||
postMessage(data: IPipelineLayoutParams) { | ||
this.onmessage({data: layoutPipeline(data.solids)}); | ||
postMessage(data: WorkerMessageData) { | ||
if (data.type === 'layoutOpGraph') { | ||
const {ops, parentOp} = data; | ||
this.onmessage({data: layoutOpGraph(ops, parentOp)}); | ||
} else if (data.type === 'layoutAssetGraph') { | ||
const {graphData} = data; | ||
this.onmessage({data: layoutAssetGraph(graphData)}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.