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

@expeed/ngx-data-mapper

v1.3.5

Published

Visual data mapping component for Angular - drag-and-drop field mapping with transformations

Downloads

1,323

Readme

@expeed/ngx-data-mapper

A visual drag-and-drop data mapping component for Angular applications. Create field mappings between source and target JSON schemas with transformations, array mapping, and default values.

Features

  • Drag & Drop Mapping: Visually connect source fields to target fields
  • Multi-Source Mapping: Combine multiple source fields into one target (concatenation)
  • Transformations: Apply data transformations (uppercase, lowercase, trim, date formatting, number formatting, substring, replace, mask, templating)
  • Array Mapping: Map array fields with optional filtering
  • Array-to-Object: Select single item from array using first, last, or conditional logic
  • Default Values: Set defaults for unmapped target fields
  • Endpoint Dragging: Reassign mappings by dragging connection endpoints
  • Real-time Preview: View transformations with sample data
  • Import/Export: Save and load mappings as JSON

Installation

npm install @expeed/ngx-data-mapper

Peer Dependencies

npm install @angular/cdk @angular/material

Usage

Basic Usage

import { Component } from '@angular/core';
import { DataMapperComponent, JsonSchema, FieldMapping } from '@expeed/ngx-data-mapper';

@Component({
  selector: 'app-mapper',
  standalone: true,
  imports: [DataMapperComponent],
  template: `
    <data-mapper
      [sourceSchema]="sourceSchema"
      [targetSchema]="targetSchema"
      [sampleData]="sampleData"
      (mappingsChange)="onMappingsChange($event)"
    />
  `
})
export class MapperComponent {
  sourceSchema: JsonSchema = {
    type: 'object',
    title: 'Source',
    properties: {
      firstName: { type: 'string', title: 'First Name' },
      lastName: { type: 'string', title: 'Last Name' },
      birthDate: { type: 'string', format: 'date', title: 'Birth Date' }
    }
  };

  targetSchema: JsonSchema = {
    type: 'object',
    title: 'Target',
    properties: {
      fullName: { type: 'string', title: 'Full Name' },
      age: { type: 'integer', title: 'Age' }
    }
  };

  sampleData = {
    firstName: 'John',
    lastName: 'Doe',
    birthDate: '1990-05-15'
  };

  onMappingsChange(mappings: FieldMapping[]): void {
    console.log('Mappings:', mappings);
  }
}

With Schema Document (Multiple Definitions)

import { SchemaDocument } from '@expeed/ngx-data-mapper';

sourceSchema: SchemaDocument = {
  $defs: {
    Customer: {
      type: 'object',
      properties: {
        name: { type: 'string' },
        email: { type: 'string' }
      }
    }
  }
};

// Reference specific definition
sourceSchemaRef = '#/$defs/Customer';
<data-mapper
  [sourceSchema]="sourceSchema"
  [targetSchema]="targetSchema"
  [sourceSchemaRef]="sourceSchemaRef"
  [targetSchemaRef]="targetSchemaRef"
  (mappingsChange)="onMappingsChange($event)"
/>

Import/Export Mappings

import { ViewChild } from '@angular/core';
import { DataMapperComponent } from '@expeed/ngx-data-mapper';

@ViewChild(DataMapperComponent) mapper!: DataMapperComponent;

exportMappings(): void {
  const json = this.mapper.exportMappings();
  // Save to file or API
}

importMappings(json: string): void {
  this.mapper.importMappings(json);
}

clearMappings(): void {
  this.mapper.clearAllMappings();
}

API Reference

DataMapperComponent

Inputs

| Input | Type | Default | Description | |-------|------|---------|-------------| | sourceSchema | JsonSchema \| SchemaDocument | - | Source schema definition | | targetSchema | JsonSchema \| SchemaDocument | - | Target schema definition | | sourceSchemaRef | string | - | JSON pointer to source definition (e.g., #/$defs/Source) | | targetSchemaRef | string | - | JSON pointer to target definition (e.g., #/$defs/Target) | | sampleData | Record<string, unknown> | {} | Sample data for transformation preview |

Outputs

| Output | Type | Description | |--------|------|-------------| | mappingsChange | EventEmitter<FieldMapping[]> | Emits when mappings change |

Public Methods

| Method | Returns | Description | |--------|---------|-------------| | exportMappings() | string | Export all mappings as JSON | | importMappings(json: string) | void | Import mappings from JSON | | clearAllMappings() | void | Remove all mappings |

Transformations

Available transformation types:

| Type | Description | Example | |------|-------------|---------| | uppercase | Convert to uppercase | "hello" → "HELLO" | | lowercase | Convert to lowercase | "HELLO" → "hello" | | trim | Remove whitespace | " hello " → "hello" | | concat | Concatenate multiple fields | "John" + "Doe" → "John Doe" | | substring | Extract part of string | "hello"[0:3] → "hel" | | replace | Replace text | "hello" → "hi" | | mask | Mask characters | "1234567890" → "******7890" | | dateFormat | Format date | "2024-01-15" → "Jan 15, 2024" | | numberFormat | Format number | 1234.5 → "1,234.50" | | template | Template string | "${firstName} ${lastName}" | | datePart | Extract date part | Extract year, month, day |

Array Mapping

Array to Array

Map arrays with optional filtering:

// Filter array items
{
  type: 'array-mapping',
  filter: {
    conditions: [
      { field: 'status', operator: 'equals', value: 'active' }
    ]
  }
}

Array to Object

Select single item from array:

| Mode | Description | |------|-------------| | first | Select first item | | last | Select last item | | condition | Select item matching condition |

Default Values

Set default values for unmapped target fields:

| Type | Description | |------|-------------| | static | Fixed value | | null | Null value | | empty-string | Empty string | | empty-array | Empty array [] | | empty-object | Empty object {} | | current-date | Current date | | current-datetime | Current date and time | | uuid | Generated UUID |

Styling

Customize appearance with CSS custom properties:

data-mapper {
  --data-mapper-bg: #f8fafc;
  --data-mapper-panel-bg: #ffffff;
  --data-mapper-text-primary: #1e293b;
  --data-mapper-text-secondary: #64748b;
  --data-mapper-accent-primary: #6366f1;
  --data-mapper-connector-color: #6366f1;
  --data-mapper-border-color: #e2e8f0;
}

Dark Theme

data-mapper {
  --data-mapper-bg: #1e293b;
  --data-mapper-panel-bg: #334155;
  --data-mapper-text-primary: #f1f5f9;
  --data-mapper-text-secondary: #cbd5e1;
  --data-mapper-accent-primary: #818cf8;
  --data-mapper-connector-color: #818cf8;
  --data-mapper-border-color: #475569;
}

Exports

// Components
export { DataMapperComponent } from './lib/components/data-mapper/data-mapper.component';
export { SchemaTreeComponent } from './lib/components/schema-tree/schema-tree.component';

// Services
export { MappingService } from './lib/services/mapping.service';
export { TransformationService } from './lib/services/transformation.service';
export { SchemaParserService } from './lib/services/schema-parser.service';
export { SvgConnectorService } from './lib/services/svg-connector.service';

// Types
export { JsonSchema, SchemaDocument } from './lib/models/json-schema.model';
export { FieldMapping, FieldReference } from './lib/models/field-mapping.model';
export { TransformationConfig, TransformationType } from './lib/models/transformation.model';
export { ArrayMapping, ArrayToObjectMapping } from './lib/models/array-mapping.model';
export { DefaultValue, DefaultValueType } from './lib/models/default-value.model';
export { SchemaTreeNode, FieldType } from './lib/models/schema-tree.model';

Requirements

  • Angular 19+
  • Angular Material 19+
  • Angular CDK 19+

License

Apache 2.0