Member Junction
    Preparing search index...

    Higher-level MemberJunction Entity ERD component that provides a simplified API for displaying entity relationship diagrams using EntityInfo objects.

    This component wraps the generic ERDDiagramComponent and handles the transformation of MemberJunction EntityInfo objects to the generic ERD format automatically.

    • Simple Input: Just pass EntityInfo[] - no manual transformation needed
    • Auto-Discovery: Automatically discovers and displays relationships
    • Configurable Depth: Control how many relationship hops to include
    • State Control: Parent controls selection/state - component doesn't persist

    Show one entity and its immediate relationships:

    <mj-entity-erd
    [entities]="[currentEntity]"
    [selectedEntityId]="currentEntity.ID"
    [depth]="1"
    (openRecord)="onOpenRecord($event)">
    </mj-entity-erd>

    Show multiple entities with persistence handled by parent:

    <mj-entity-erd
    [entities]="filteredEntities"
    [selectedEntityId]="savedSelectedId"
    [depth]="savedDepth"
    (entitySelected)="onEntitySelected($event); saveState()"
    (stateChange)="onStateChange($event); saveState()"
    (openRecord)="onOpenRecord($event)">
    </mj-entity-erd>
    • No State Persistence: This component does NOT persist user state (selection, zoom, etc.). The parent is responsible for saving/restoring state via the inputs and events.
    • No Filtering: The caller filters entities before passing them. This keeps the component simple.
    • Controlled Selection: Selection is controlled via selectedEntityId input. The component emits entitySelected when user clicks, but parent decides what to do.

    ERDDiagramComponent for the underlying generic component

    Hierarchy (View Summary)

    Implements

    • OnChanges
    Index

    Constructors

    Properties

    allEntities?: EntityInfo[]

    All entities in the system for relationship discovery. If not provided, uses Metadata.Entities automatically. This is used to look up related entities when building the ERD.

    config: ERDConfig = {}

    Configuration options passed to the underlying ERD component.

    depth: number = 1

    Number of relationship hops to include when auto-discovering related entities.

    • 0: Show only the provided entities (no auto-discovery)
    • 1: Show provided entities + directly related entities (default)
    • 2+: Show entities within N relationship hops
    1
    
    entities: EntityInfo[] = []

    The entities to display in the ERD. Pass one or more EntityInfo objects. The component will automatically discover and display related entities based on the depth setting.

    // Single entity
    [entities]="[currentEntity]"

    // Multiple entities (schema view)
    [entities]="filteredEntities"
    entityDeselected: EventEmitter<void> = ...

    Emitted when the selection is cleared.

    entityDoubleClick: EventEmitter<EntitySelectedEvent> = ...

    Emitted when an entity is double-clicked. Typically used to open the entity record.

    entitySelected: EventEmitter<EntitySelectedEvent> = ...

    Emitted when an entity is selected by clicking. The parent should update selectedEntityId in response.

    erdNodes: ERDNode[] = []

    Computed ERD nodes

    focusDepth: number = 1

    Focus depth when focusEntityId is set.

    focusEntityId: string | null = null

    ID of entity to focus on (shows only this entity and related up to depth). If null, shows all provided entities.

    headerTitle: string = 'Entity Relationship Diagram'

    Title for the header bar.

    highlightedEntityIds: string[] = []

    IDs of entities to highlight (in addition to selected).

    includeIncoming: boolean = true

    Include incoming relationships (entities that reference these entities).

    true
    
    includeOutgoing: boolean = true

    Include outgoing relationships (entities these reference via FK).

    true
    
    isRefreshing: boolean = false

    Whether the diagram is in a loading/refreshing state.

    openRecord: EventEmitter<OpenEntityRecordEvent> = ...

    Emitted when requesting to open an entity record. This is the standard MJ pattern for navigation.

    Provider: IMetadataProvider | null

    If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.

    readOnly: boolean = false

    Whether the diagram is read-only (no selection/dragging).

    refreshRequested: EventEmitter<void> = ...

    Emitted when user requests a refresh via the header button.

    selectedEntityId: string | null = null

    ID of the currently selected entity. Controlled by parent - the component emits selection events but doesn't manage selection state internally.

    showHeader: boolean = true

    Whether to show the header bar with controls.

    true
    
    stateChange: EventEmitter<ERDState> = ...

    Emitted when diagram state changes (selection, zoom, etc.). Parent can use this for state persistence.

    zoomChange: EventEmitter<ERDZoomEvent> = ...

    Emitted when zoom/pan changes. Parent can use this for state persistence.

    "ɵdir": unknown
    "ɵfac": unknown

    Accessors

    • get ProviderToUse(): IMetadataProvider

      Returns either the default Metadata provider or the one specified in the Provider property, if it was specified

      Returns IMetadataProvider

    • get RunQueryToUse(): IRunQueryProvider

      Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified

      Returns IRunQueryProvider

    • get RunReportToUse(): IRunReportProvider

      Returns either the default RunReport provider or the one specified in the Provider property, if it was specified

      Returns IRunReportProvider

    • get RunViewToUse(): IRunViewProvider

      Returns either the default RunView provider or the one specified in the Provider property, if it was specified

      Returns IRunViewProvider

    Methods

    • A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

      Parameters

      • changes: { [propName: string]: SimpleChange<any> }

        The changed properties.

      Returns void