Skip to content

Commit cc9f670

Browse files
committed
add components for lineage
1 parent 906be74 commit cc9f670

40 files changed

+3524
-2
lines changed

pnpm-lock.yaml

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/common/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite'
22

33
const config: StorybookConfig = {
44
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5-
addons: ['@storybook/addon-docs', '@storybook/addon-onboarding'],
5+
addons: ['@storybook/addon-docs'],
66
framework: {
77
name: '@storybook/react-vite',
88
options: {},

web/common/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "@tobikodata/sqlmesh-common",
33
"version": "0.0.1",
4+
"dependencies": {
5+
"cronstrue": "^3.3.0"
6+
},
47
"devDependencies": {
58
"@eslint/js": "^9.31.0",
69
"@radix-ui/react-slot": "^1.2.3",
@@ -12,6 +15,8 @@
1215
"@testing-library/dom": "^10.4.1",
1316
"@testing-library/jest-dom": "^6.6.3",
1417
"@testing-library/react": "^16.3.0",
18+
"@types/dagre": "^0.7.53",
19+
"@types/lodash": "^4.17.20",
1520
"@types/node": "^20.11.25",
1621
"@types/react": "^18.3.23",
1722
"@types/react-dom": "^18.3.7",
@@ -21,11 +26,14 @@
2126
"autoprefixer": "^10.4.21",
2227
"class-variance-authority": "^0.7.1",
2328
"clsx": "^2.1.1",
29+
"dagre": "^0.8.5",
30+
"deepmerge": "^4.3.1",
2431
"eslint": "^9.31.0",
2532
"eslint-plugin-react-hooks": "^5.2.0",
2633
"eslint-plugin-storybook": "^9.1.5",
2734
"fuse.js": "^7.1.0",
2835
"globals": "^16.3.0",
36+
"lodash": "^4.17.21",
2937
"lucide-react": "^0.542.0",
3038
"playwright": "^1.54.1",
3139
"postcss": "^8.5.6",
@@ -72,7 +80,10 @@
7280
"@xyflow/react": "^12.8.4",
7381
"class-variance-authority": "^0.7.1",
7482
"clsx": "^2.1.1",
83+
"dagre": "^0.8.5",
84+
"deepmerge": "^4.3.1",
7585
"fuse.js": "^7.1.0",
86+
"lodash": "^4.17.21",
7687
"lucide-react": "^0.542.0",
7788
"react": "^18.3.1",
7889
"react-dom": "^18.3.1",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.react-flow__node {
2+
height: auto !important;
3+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React from 'react'
2+
3+
import {
4+
type AdjacencyListColumnKey,
5+
type AdjacencyListKey,
6+
type PortId,
7+
} from '../utils'
8+
9+
export type LineageColumn = {
10+
source?: string | null
11+
expression?: string | null
12+
models: Record<string, string[]>
13+
}
14+
15+
export type ColumnLevelModelConnections = Record<
16+
AdjacencyListKey,
17+
AdjacencyListKey[]
18+
>
19+
export type ColumnLevelDetails = Omit<LineageColumn, 'models'> & {
20+
models: ColumnLevelModelConnections
21+
}
22+
export type ColumnLevelConnections = Record<
23+
AdjacencyListColumnKey,
24+
ColumnLevelDetails
25+
>
26+
export type ColumnLevelLineageAdjacencyList = Record<
27+
AdjacencyListKey,
28+
ColumnLevelConnections
29+
>
30+
31+
export type ColumnLevelLineageContextValue = {
32+
adjacencyListColumnLevel: ColumnLevelLineageAdjacencyList
33+
selectedColumns: Set<PortId>
34+
columnLevelLineage: Map<PortId, ColumnLevelLineageAdjacencyList>
35+
setColumnLevelLineage: React.Dispatch<
36+
React.SetStateAction<Map<PortId, ColumnLevelLineageAdjacencyList>>
37+
>
38+
showColumns: boolean
39+
setShowColumns: React.Dispatch<React.SetStateAction<boolean>>
40+
fetchingColumns: Set<PortId>
41+
setFetchingColumns: React.Dispatch<React.SetStateAction<Set<PortId>>>
42+
}
43+
44+
export const initial = {
45+
adjacencyListColumnLevel: {},
46+
selectedColumns: new Set<PortId>(),
47+
columnLevelLineage: new Map<PortId, ColumnLevelLineageAdjacencyList>(),
48+
setColumnLevelLineage: () => {},
49+
showColumns: false,
50+
setShowColumns: () => {},
51+
fetchingColumns: new Set<PortId>(),
52+
setFetchingColumns: () => {},
53+
}
54+
55+
export type ColumnLevelLineageContextHook = () => ColumnLevelLineageContextValue

0 commit comments

Comments
 (0)