|
|
@ -3,7 +3,7 @@ import { UITypes } from 'nocodb-sdk' |
|
|
|
import dagre from 'dagre' |
|
|
|
import dagre from 'dagre' |
|
|
|
import type { Edge, Elements } from '@vue-flow/core' |
|
|
|
import type { Edge, Elements } from '@vue-flow/core' |
|
|
|
import type { MaybeRef } from '@vueuse/core' |
|
|
|
import type { MaybeRef } from '@vueuse/core' |
|
|
|
import { Position, isEdge, isNode } from '@vue-flow/core' |
|
|
|
import { MarkerType, Position, isEdge, isNode } from '@vue-flow/core' |
|
|
|
import { scaleLinear as d3ScaleLinear } from 'd3-scale' |
|
|
|
import { scaleLinear as d3ScaleLinear } from 'd3-scale' |
|
|
|
import { computed, ref, unref, useMetas, useTheme } from '#imports' |
|
|
|
import { computed, ref, unref, useMetas, useTheme } from '#imports' |
|
|
|
|
|
|
|
|
|
|
@ -160,6 +160,7 @@ export function useErdElements(tables: MaybeRef<TableType[]>, props: MaybeRef<Er |
|
|
|
sourceHandle: `s-${sourceColumnId}-${source}`, |
|
|
|
sourceHandle: `s-${sourceColumnId}-${source}`, |
|
|
|
targetHandle: `d-${targetColumnId}-${target}`, |
|
|
|
targetHandle: `d-${targetColumnId}-${target}`, |
|
|
|
type: 'custom', |
|
|
|
type: 'custom', |
|
|
|
|
|
|
|
markerEnd: MarkerType.ArrowClosed, |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
isManyToMany: type === 'mm', |
|
|
|
isManyToMany: type === 'mm', |
|
|
|
isSelfRelation: source === target && sourceColumnId === targetColumnId, |
|
|
|
isSelfRelation: source === target && sourceColumnId === targetColumnId, |
|
|
@ -213,7 +214,7 @@ export function useErdElements(tables: MaybeRef<TableType[]>, props: MaybeRef<Er |
|
|
|
if (isNode(el)) { |
|
|
|
if (isNode(el)) { |
|
|
|
dagreGraph.setNode(el.id, { |
|
|
|
dagreGraph.setNode(el.id, { |
|
|
|
width: skeleton ? nodeWidth * 2 : nodeWidth, |
|
|
|
width: skeleton ? nodeWidth * 2 : nodeWidth, |
|
|
|
height: nodeHeight + (skeleton ? 100 : nodeHeight * el.data.columnLength), |
|
|
|
height: nodeHeight + (skeleton ? 250 : nodeHeight * el.data.columnLength), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else if (isEdge(el)) { |
|
|
|
} else if (isEdge(el)) { |
|
|
|
// avoid duplicate edges when using skeleton
|
|
|
|
// avoid duplicate edges when using skeleton
|
|
|
|