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
Create New Model
File → New Model or press Ctrl+N
Choose Template
- Blank Model - Start from scratch
- Basic Object - Simple object structure
- From Sample - Import from existing data
Adding Properties
Method 1: Context Menu
- Right-click on parent object in tree
- Select "Add Property"
- Enter property name
- Configure type and constraints
Method 2: Toolbar
- Select parent object
- Click "Add Property" button
- Configure in details panel
Method 3: Keyboard
- Select parent object
- Press
Insert
key - Type property name
- 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:
- Select a string property
- Click "Edit String Model" button
- 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 letterl
- Lowercase letterd
- Digits
- 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:
- Select a number/integer property
- Click "Edit Histogram" button
- Design distribution
Creating Distribution Bins
Add Bin
- Click "Add Bin"
- Set range (min, max)
- Set frequency (0-100%)
Visual Editor
- Drag bin boundaries
- Adjust heights for frequency
- Preview distribution curve
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:
- Select property
- Check "Required" in details panel
- Or right-click → "Toggle Required"
Required fields appear in bold in the tree.
Property Ordering
Reorder properties:
- Drag and drop in tree
- Or use Ctrl+Up/Down arrows
- Or right-click → Move Up/Down
Property Duplication
Duplicate existing properties:
- Select property
- Ctrl+D or right-click → Duplicate
- Rename and modify copy
Property Templates
Save property as template:
- Configure property completely
- Right-click → Save as Template
- Name template for reuse
Use template:
- Right-click parent
- Add from Template
- Select saved template
Format Detection
Auto-detect formats from sample values:
- Select string property
- Click "Detect Format"
- Paste sample values
- 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:
- Click "Validate" button
- Or press F5
- Review validation report
Generating Documents
Quick Generation
- Click "Generate" button in toolbar
- Set parameters:
- Count: Number of documents
- Seed: For reproducibility
- Format: JSON or CSV
- Click "Generate"
- View/save results
Generation Preview
- Select property
- Click "Preview Values"
- See sample generated values
- Adjust model if needed
Advanced Generation
- Tools → Document Generator
- Configure:
- Entropy overrides
- Output options
- Metadata inclusion
- Generate and export
Import and Export
Import from JSON
- File → Import → From JSON
- Select JSON files
- Review detected model
- Adjust statistical models
- Save model
Import from CSV
- File → Import → From CSV
- Select CSV file
- Configure:
- Header row
- Delimiter
- Type detection
- Review generated model
- Refine and save
Export Model
- File → Export → Model
- Choose format:
- DataFlood Model (with statistical models)
- Standard DataFlood Model
- TypeScript interfaces
- Select location
- 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
- Learn about String Models
- Master Histogram Editor
- Explore Tides Editor
- Try Model Merge Tool
- Review Import/Export options