Skip to content
Snippets Groups Projects

feat: support darkmode in node link visualization

Merged Dennis Collaris requested to merge feat/nodelink-darkmode into main
8 files
+ 133
137
Compare changes
  • Side-by-side
  • Inline
Files
8
import { SchemaAttribute } from '../../..';
import { Handles, QueryElementTypes } from '../reactflow';
import { QueryGraphEdgeAttribute, QueryGraphEdgeHandle, QueryGraphNodes } from './model';
const metaAttribute: Record<string, QueryGraphEdgeAttribute> = {
'(# Connection)': {
attributeName: '(# Connection)',
attributeType: 'float',
attributeDimension: 'numerical',
},
};
export function checkForMetaAttributes(graphologyAttributes: QueryGraphNodes): QueryGraphEdgeHandle[] {
const ret: QueryGraphEdgeHandle[] = [];
const defaultHandleData = {
nodeId: graphologyAttributes.id,
nodeName: graphologyAttributes.name || '',
nodeType: graphologyAttributes.type,
handleType: graphologyAttributes.type === QueryElementTypes.Entity ? Handles.EntityAttribute : Handles.RelationAttribute,
};
// Only include if not already there
const metaAttributesToInclude = Object.keys(metaAttribute).filter((attributeName) => !(attributeName in graphologyAttributes.attributes));
return metaAttributesToInclude.map((attributeName) => ({
...defaultHandleData,
...metaAttribute[attributeName],
})) as QueryGraphEdgeHandle[];
}
Loading