Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d968793
fix: update year to 2026
ethanluc7 Feb 3, 2026
3709c14
feat: add subtitle prop to modal component
ethanluc7 Feb 3, 2026
cc905ad
feat: create diagram view button
ethanluc7 Feb 3, 2026
1b0a3d5
feat: add dictionary view button to toolbar
ethanluc7 Feb 3, 2026
bd02d6b
fix: format fles
ethanluc7 Feb 3, 2026
f729b69
feat: implement entity relationship diagram
ethanluc7 Feb 10, 2026
2d61856
feat: add icons for diagram
ethanluc7 Feb 10, 2026
f840404
feat: add entity relationship diagram to diagram view button
ethanluc7 Feb 10, 2026
1479f36
feat: add entity relationship diagram story
ethanluc7 Feb 10, 2026
36476f5
Merge branch 'main' into 395-render-dictionary-schema
ethanluc7 Feb 10, 2026
2abb827
Merge branch 'main' into 395-render-dictionary-schema
ethanluc7 Feb 10, 2026
288d961
Merge branch '395-render-dictionary-schema' of https://github.com/ove…
ethanluc7 Feb 10, 2026
f66e39f
fix: removed unused imports
ethanluc7 Feb 10, 2026
d69ef67
fix: use empty dictionary instead of full dictionary
ethanluc7 Feb 10, 2026
1448234
feat: add separate file for schema node css
ethanluc7 Feb 11, 2026
e2ec2ed
fix: import types and components in one line
ethanluc7 Feb 11, 2026
6eba979
fix: remove spread
ethanluc7 Feb 11, 2026
7700a63
fix: remove type casting
ethanluc7 Feb 11, 2026
e083d73
fix: reduce height of modal to remove vertical scrolling on container
ethanluc7 Feb 11, 2026
04e0314
fix: remove unused type import
ethanluc7 Feb 11, 2026
ffb4767
refactor: remove max-height from nodes
ethanluc7 Feb 12, 2026
3a9efd9
docs: add docs for functions and props
ethanluc7 Feb 12, 2026
cb0e9d4
feat: add row hover states
ethanluc7 Feb 12, 2026
82b93f8
feat: add edge hover states
ethanluc7 Feb 12, 2026
0554d37
Merge branch 'main' into 396-field-edge-interactions
ethanluc7 Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/ui/src/theme/emotion/schemaNodeStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@
import { css } from '@emotion/react';
import type { Theme } from '../';

export const fieldRowStyles = css`
export const fieldRowStyles = (theme: Theme, isForeignKey: boolean, isEven: boolean) => css`
padding: 12px 12px;
display: flex;
align-items: center;
justify-content: space-between;
transition: background-color 0.2s;
position: relative;
background-color: ${isEven ? '#e5edf3' : 'transparent'};
border-block: 1.5px solid ${isEven ? '#d4dce2' : 'transparent'};
${isForeignKey ? 'cursor: pointer;' : ''}

&:hover {
background-color: ${isForeignKey ? theme.colors.secondary_1 : theme.colors.grey_3};
border-block: 1.5px solid ${isForeignKey ? theme.colors.secondary_dark : theme.colors.grey_4};
}
`;

export const fieldContentStyles = css`
Expand Down Expand Up @@ -102,10 +110,6 @@ export const nodeSubtitleTextStyle = css`
export const fieldsListStyles = css`
background: #f8fafc;
overflow-y: auto;
& > div:nth-child(even) {
background-color: #e5edf3;
border-block: 1.5px solid #d4dce2;
}
`;

export const fieldNameContainerStyles = css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/

/** @jsxImportSource @emotion/react */
import { css } from '@emotion/react';
import { type Theme, useThemeContext } from '../../theme';
import type { Dictionary } from '@overture-stack/lectern-dictionary';
import ReactFlow, {
Background,
Expand All @@ -43,6 +45,19 @@ type EntityRelationshipDiagramProps = {
layout?: Partial<SchemaNodeLayout>;
};

const edgeHoverStyles = (theme: Theme) => css`
.react-flow__edge {
cursor: pointer;
}
.react-flow__edge-path {
stroke: ${theme.colors.black};
stroke-width: 2;
}
.react-flow__edge:hover .react-flow__edge-path {
stroke: ${theme.colors.secondary_dark};
}
`;

/**
* Entity Relationship Diagram visualizing schemas and their foreign key relationships.
*
Expand All @@ -55,26 +70,29 @@ type EntityRelationshipDiagramProps = {
export function EntityRelationshipDiagram({ dictionary, layout }: EntityRelationshipDiagramProps) {
const [nodes, , onNodesChange] = useNodesState(getNodesForDictionary(dictionary, layout));
const [edges, , onEdgesChange] = useEdgesState(getEdgesForDictionary(dictionary));
const theme = useThemeContext();

return (
<>
<OneCardinalityMarker />
<ReactFlow
nodes={nodes}
edges={edges}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
nodeTypes={nodeTypes}
fitView
fitViewOptions={{ padding: 20, maxZoom: 1.5, minZoom: 0.5 }}
style={{ width: '100%', height: '100%' }}
defaultViewport={{ x: 0, y: 0, zoom: 1.0 }}
minZoom={0.1}
maxZoom={3}
>
<Controls />
<Background variant={BackgroundVariant.Lines} />
</ReactFlow>
<div css={edgeHoverStyles(theme)} style={{ width: '100%', height: '100%' }}>
<ReactFlow
nodes={nodes}
edges={edges}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
nodeTypes={nodeTypes}
fitView
fitViewOptions={{ padding: 20, maxZoom: 1.5, minZoom: 0.5 }}
style={{ width: '100%', height: '100%' }}
defaultViewport={{ x: 0, y: 0, zoom: 1.0 }}
minZoom={0.1}
maxZoom={3}
>
<Controls />
<Background variant={BackgroundVariant.Lines} />
</ReactFlow>
</div>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ export function SchemaNode(props: { data: Schema }) {
schema.restrictions?.foreignKey?.some((fk) =>
fk.mappings.some((mapping) => mapping.local === field.name),
) || false;

const isEvenRow = index % 2 === 1;
const valueType = field.isArray ? `${field.valueType}[]` : field.valueType;

return (
<div key={index} css={fieldRowStyles}>
<div key={index} css={fieldRowStyles(theme, isForeignKey, isEvenRow)}>
<div css={fieldContentStyles}>
<span css={fieldNameStyles(theme)}>{field.name}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export function getEdgesForDictionary(dictionary: Dictionary): Edge[] {
target: schema.name,
targetHandle: createFieldHandleId(schema.name, mapping.local, 'target'),
type: 'smoothstep',
style: { stroke: '#374151', strokeWidth: 2 },
pathOptions: {
offset: -20,
},
Expand Down