npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@memberjunction/ng-data-context

v4.4.0

Published

MemberJunction: Angular component and pop-up window to display and edit the contents of a data context.

Readme

@memberjunction/ng-data-context

Angular components for managing MemberJunction Data Contexts -- reusable collections of data sources (views, queries, raw SQL) that can be composed and referenced by reports, dashboards, and AI prompts.

Overview

The @memberjunction/ng-data-context package provides an interactive component for creating, editing, and previewing data contexts. A data context defines one or more data source items (entity views, stored queries, or raw SQL statements) along with optional filters, and packages them into a named, reusable unit. The package includes both an inline component and a dialog wrapper.

graph TD
    A[DataContextModule] --> B[DataContextComponent]
    A --> C[DataContextDialogComponent]

    B --> D["Data Source Items"]
    D --> D1["Entity Views"]
    D --> D2["Stored Queries"]
    D --> D3["Raw SQL"]
    D --> D4["Entity Records"]

    B --> E["Item Configuration"]
    E --> E1["Filters"]
    E --> E2["Preview"]
    E --> E3["Virtual Scrolling"]

    C --> B

    style A fill:#2d6a9f,stroke:#1a4971,color:#fff
    style B fill:#7c5295,stroke:#563a6b,color:#fff
    style C fill:#2d8659,stroke:#1a5c3a,color:#fff
    style D fill:#b8762f,stroke:#8a5722,color:#fff

Installation

npm install @memberjunction/ng-data-context

Usage

Import the Module

import { DataContextModule } from '@memberjunction/ng-data-context';

@NgModule({
  imports: [DataContextModule]
})
export class YourModule { }

Inline Component

<mj-data-context
  [dataContextId]="'your-data-context-id'"
  [Provider]="customMetadataProvider">
</mj-data-context>

Dialog Component

<mj-data-context-dialog
  [dataContextId]="selectedDataContextId"
  [Provider]="metadataProvider"
  (dialogClosed)="onDialogClosed()">
</mj-data-context-dialog>

Complete Example

import { Component } from '@angular/core';
import { IMetadataProvider, Metadata } from '@memberjunction/core';

@Component({
  selector: 'app-data-context-viewer',
  template: `
    <mj-data-context
      [dataContextId]="selectedDataContextId"
      [Provider]="metadataProvider">
    </mj-data-context>

    <button (click)="showDialog()">View in Dialog</button>

    @if (isDialogVisible) {
      <mj-data-context-dialog
        [dataContextId]="selectedDataContextId"
        [Provider]="metadataProvider"
        (dialogClosed)="onDialogClose()">
      </mj-data-context-dialog>
    }
  `
})
export class DataContextViewerComponent {
  isDialogVisible = false;
  selectedDataContextId = '12345-67890-abcdef';
  metadataProvider: IMetadataProvider;

  constructor() {
    this.metadataProvider = Metadata.Provider;
  }

  showDialog(): void {
    this.isDialogVisible = true;
  }

  onDialogClose(): void {
    this.isDialogVisible = false;
  }
}

API Reference

DataContextComponent (mj-data-context)

Main component for displaying a data context and its items.

Inputs

| Input | Type | Required | Default | Description | |-------|------|----------|---------|-------------| | dataContextId | string | Yes | - | The ID of the data context to display | | Provider | IMetadataProvider \| null | No | Metadata.Provider | Custom metadata provider |

DataContextDialogComponent (mj-data-context-dialog)

Dialog wrapper displaying the DataContextComponent in a Kendo dialog.

Inputs

| Input | Type | Required | Default | Description | |-------|------|----------|---------|-------------| | dataContextId | string | Yes | - | The ID of the data context to display | | Provider | IMetadataProvider \| null | No | null | Custom metadata provider |

Outputs

| Output | Type | Description | |--------|------|-------------| | dialogClosed | EventEmitter<void> | Emitted when the dialog is closed |

Data Context Structure

A data context in MemberJunction consists of:

  1. Context Record (DataContextEntity) -- ID, Name, Description, and metadata
  2. Context Items (Data Context Items entity) with the following types:
    • SQL -- Direct SQL query
    • View -- Reference to a saved view
    • Query -- Reference to a stored query
    • Entity -- Reference to an entity
    • Record -- Specific record reference

Features

  • Multi-source composition: Combine entity views, stored queries, raw SQL, and specific records into a single named context
  • Virtual scrolling: Efficient handling of large datasets via Kendo Grid
  • Column sorting and resizing: Interactive grid features
  • Metadata integration: Uses MemberJunction's metadata system for entity loading
  • Loading state management: Built-in loading indicators
  • Custom provider support: Works with custom metadata providers for multi-tenant scenarios
  • Error handling: Logs errors via MemberJunction's LogError function

Dependencies

Runtime Dependencies

| Package | Description | |---------|-------------| | @memberjunction/core | Core MemberJunction framework | | @memberjunction/core-entities | Entity type definitions | | @memberjunction/global | Global utilities | | @memberjunction/ng-container-directives | Container directives | | @memberjunction/ng-shared | Shared Angular utilities | | @progress/kendo-angular-grid | Grid with virtual scrolling | | @progress/kendo-angular-indicators | Loading indicators | | @progress/kendo-angular-dialog | Dialog component | | @progress/kendo-angular-buttons | Button components |

Peer Dependencies

  • @angular/common ^21.x
  • @angular/core ^21.x

Build

cd packages/Angular/Generic/data-context
npm run build

License

ISC