Model Editor User Guide

Overview

The Model Editor is the primary interface for creating and editing DataFlood models. It provides a visual tree-based editor for defining DataFlood model structures with integrated statistical models for realistic data generation.

Interface Components

Property Tree Panel (Left)

The hierarchical view of your model structure:

  • Root object properties
  • Nested objects and arrays
  • Property types and constraints
  • Required field indicators

Property Details Panel (Right)

Configuration for the selected property:

  • Type selection (string, number, integer, boolean, object, array)
  • Constraints (min/max, pattern, format)
  • Statistical models (string models, histograms)
  • Required field toggle

Toolbar

Quick access to common actions:

  • Add Property
  • Delete Property
  • Generate Documents
  • Validate Model
  • Import/Export

Creating a Model

Starting a New Model

  1. Create New Model

    File → New Model
    or press Ctrl+N
  2. Choose Template

    • Blank Model - Start from scratch
    • Basic Object - Simple object structure
    • From Sample - Import from existing data

Adding Properties

Method 1: Context Menu

  1. Right-click on parent object in tree
  2. Select "Add Property"
  3. Enter property name
  4. Configure type and constraints

Method 2: Toolbar

  1. Select parent object
  2. Click "Add Property" button
  3. Configure in details panel

Method 3: Keyboard

  1. Select parent object
  2. Press Insert key
  3. Type property name
  4. Press Tab to configure

Property Types

String Properties

Configuration options:

  • Min/Max Length: Character count constraints
  • Pattern: Regular expression validation
  • Format: Predefined formats (email, url, date, uuid)
  • Enum: Fixed set of allowed values
  • String Model: Statistical generation model

Example configuration:

{
  "type": "string",
  "minLength": 5,
  "maxLength": 50,
  "pattern": "^[A-Z][a-z]+$",
  "format": "email"
}

Number/Integer Properties

Configuration options:

  • Minimum: Lower bound
  • Maximum: Upper bound
  • Multiple Of: Step value
  • Exclusive Min/Max: Boundary exclusion
  • Histogram: Distribution model

Example configuration:

{
  "type": "integer",
  "minimum": 0,
  "maximum": 100,
  "multipleOf": 5
}

Boolean Properties

Simple true/false values with optional:

  • Default: Default value
  • Probability: True/false ratio for generation

Object Properties

Nested structures with:

  • Properties: Child properties
  • Required: List of required properties
  • Additional Properties: Allow undefined properties

Array Properties

Collections with:

  • Items: Model for array elements
  • Min/Max Items: Array size constraints
  • Unique Items: Enforce uniqueness

Statistical Models

String Model Editor

Access the String Model Editor:

  1. Select a string property
  2. Click "Edit String Model" button
  3. Configure generation parameters

String Model Components

Entropy Score (0.0 - 10.0)

  • Low (0-2): Use existing vocabulary
  • Medium (2-4): Pattern-based generation
  • High (4+): Character distribution

Patterns Add structural patterns:

Name pattern: Llll Llll
Phone pattern: (ddd) ddd-dddd
ID pattern: ID-dddddd

Pattern notation:

  • L - Uppercase letter
  • l - Lowercase letter
  • d - Digit
  • s - Space
  • Special characters as literals

Value Frequency Most common values and their weights:

john.doe@example.com: 10
jane.smith@test.org: 8
admin@localhost: 5

Character Probability Distribution of characters in generated strings.

N-grams Common character sequences for realistic text.

Histogram Editor

Access the Histogram Editor:

  1. Select a number/integer property
  2. Click "Edit Histogram" button
  3. Design distribution

Creating Distribution Bins

  1. Add Bin

    • Click "Add Bin"
    • Set range (min, max)
    • Set frequency (0-100%)
  2. Visual Editor

    • Drag bin boundaries
    • Adjust heights for frequency
    • Preview distribution curve
  3. Import from Data

    • Load sample values
    • Auto-generate bins
    • Adjust as needed

Example histogram:

Age Distribution:
18-25: 15%
25-35: 30%
35-50: 35%
50-65: 15%
65-80: 5%

Advanced Features

Required Fields

Mark fields as required:

  1. Select property
  2. Check "Required" in details panel
  3. Or right-click → "Toggle Required"

Required fields appear in bold in the tree.

Property Ordering

Reorder properties:

  1. Drag and drop in tree
  2. Or use Ctrl+Up/Down arrows
  3. Or right-click → Move Up/Down

Property Duplication

Duplicate existing properties:

  1. Select property
  2. Ctrl+D or right-click → Duplicate
  3. Rename and modify copy

Property Templates

Save property as template:

  1. Configure property completely
  2. Right-click → Save as Template
  3. Name template for reuse

Use template:

  1. Right-click parent
  2. Add from Template
  3. Select saved template

Format Detection

Auto-detect formats from sample values:

  1. Select string property
  2. Click "Detect Format"
  3. Paste sample values
  4. Apply detected format

Detected formats:

  • Email addresses
  • URLs
  • Dates (ISO 8601)
  • UUIDs
  • IP addresses
  • Phone numbers

Validation

Real-time Validation

The editor validates continuously:

  • Red highlight: Errors
  • Yellow highlight: Warnings
  • Green checkmark: Valid

Common validation rules:

  • Property names must be unique
  • Types must be valid
  • Constraints must be logical
  • Patterns must be valid regex

Manual Validation

Full model validation:

  1. Click "Validate" button
  2. Or press F5
  3. Review validation report

Generating Documents

Quick Generation

  1. Click "Generate" button in toolbar
  2. Set parameters:
    • Count: Number of documents
    • Seed: For reproducibility
    • Format: JSON or CSV
  3. Click "Generate"
  4. View/save results

Generation Preview

  1. Select property
  2. Click "Preview Values"
  3. See sample generated values
  4. Adjust model if needed

Advanced Generation

  1. Tools → Document Generator
  2. Configure:
    • Entropy overrides
    • Output options
    • Metadata inclusion
  3. Generate and export

Import and Export

Import from JSON

  1. File → Import → From JSON
  2. Select JSON files
  3. Review detected model
  4. Adjust statistical models
  5. Save model

Import from CSV

  1. File → Import → From CSV
  2. Select CSV file
  3. Configure:
    • Header row
    • Delimiter
    • Type detection
  4. Review generated model
  5. Refine and save

Export Model

  1. File → Export → Model
  2. Choose format:
    • DataFlood Model (with statistical models)
    • Standard DataFlood Model
    • TypeScript interfaces
  3. Select location
  4. Export

Tips and Best Practices

Naming Conventions

  • Use camelCase for properties
  • Be descriptive but concise
  • Avoid special characters
  • Use consistent naming patterns

Model Organization

  • Group related properties
  • Use nested objects for structure
  • Keep depth reasonable (< 5 levels)
  • Use arrays for collections

Statistical Models

  • Provide diverse sample data
  • Review generated patterns
  • Test with small batches first
  • Adjust entropy for variety

Performance

  • Limit schema complexity
  • Use appropriate constraints
  • Test generation performance
  • Optimize histograms bins

Keyboard Shortcuts

Shortcut Action
Ctrl+N New model
Ctrl+O Open file
Ctrl+S Save
Ctrl+Z Undo
Ctrl+Y Redo
Insert Add property
Delete Delete property
F2 Rename property
F5 Validate schema
Ctrl+G Generate documents
Ctrl+D Duplicate property
Ctrl+Up/Down Move property
Ctrl+Tab Next tab
Ctrl+Shift+Tab Previous tab

Troubleshooting

Property Won't Add

  • Check parent is object/array
  • Verify property name is unique
  • Ensure schema is valid

Generation Fails

  • Validate schema first
  • Check constraints are satisfiable
  • Verify statistical models
  • Reduce document count

Import Issues

  • Verify file format
  • Check for invalid JSON
  • Ensure CSV has headers
  • Try smaller sample

Performance Problems

  • Simplify complex schemas
  • Reduce property count
  • Optimize nested structures
  • Use CLI for large batches

Next Steps