Data simulation
This article lists and explains all available simulator functions.
The data simulation class generates random and mock data for testing, prototyping, and creating demonstrations without requiring real information. These functions create numbers, strings, and complex structured datasets such as personal profiles, geographic coordinates, and time-series logs. This class provides static functions only and does not require an instance. The code class name is Simulator.
Basic values
randomInteger
Returns a random whole number between a minimum and a maximum value (both inclusive).
Parameters
options
min
The minimum possible integer. Default 0.
integer
max
The maximum possible integer. Default 99999.
integer
Output
Returns a random integer.
Example
# options
min: 1
max: 10randomNumber
Returns a random floating-point number between a minimum and a maximum value.
Parameters
options
min
The minimum possible number. Default 0.
number
max
The maximum possible number (exclusive). Default 1.
number
Output
Returns a random floating-point number.
Example
randomString
Generates a string of a specified length composed of random printable characters from ! to } (character codes 33 to 125).
Parameters
length
The desired length of the string. Maximum is 2^20. Default 10.
integer
Output
Returns a random string.
Example
randomText
Generates random placeholder text in a lorem ipsum style to populate text fields and layout paragraphs.
Parameters
options
count
The number of units to generate. Default 1.
integer
units
The type of unit to generate: words, sentences, or paragraphs. Default sentences.
string
format
The output format, either plain or html. Default plain.
string
sentenceLowerBound
The minimum number of words per sentence.
integer
sentenceUpperBound
The maximum number of words per sentence.
integer
paragraphLowerBound
The minimum number of sentences per paragraph.
integer
paragraphUpperBound
The maximum number of sentences per paragraph.
integer
suffix
The line ending used between units. Defaults to the system line break.
string
Output
Returns a string of random text.
Examples
Example 1: Generate words
Example 2: Generate paragraphs with HTML tags
error
Throws an execution error with a specified or random message to test error-handling logic.
Parameters
customMessage
An optional string to use as the error message. If omitted, the function uses a random lorem ipsum sentence.
string
Output
Throws an execution error.
Complex structures
randomObject
Generates an object with a random number of keys and values of various types.
Parameters
options
min
The minimum number of key-value pairs. Default 3.
integer
max
The maximum number of key-value pairs. Default 7.
integer
allowNesting
Allows values to be other random objects. Default true.
boolean
Output
Returns a random object.
randomArrayOfIntegers
Returns an array of random integers.
Parameters
length
The length of the array. Default 10.
integer
Output
Returns an array of integers.
randomArrayOfNumbers
Returns an array of random floating-point numbers.
Parameters
length
The length of the array. Default 10.
integer
Output
Returns an array of numbers.
randomArrayOfDigits
Returns an array of random single digits (0 to 9).
Parameters
length
The length of the array. Default 10.
integer
Output
Returns an array of integers.
randomArrayOfStrings
Returns an array of random words.
Parameters
length
The length of the array. Default 10.
integer
Output
Returns an array of strings.
randomArrayOfObjects
Returns an array of random objects with flat, non-nested values.
Parameters
length
The length of the array. Default 10.
integer
options
min
The minimum number of entries per object. Default 3.
integer
max
The maximum number of entries per object. Default 7.
integer
Output
Returns an array of objects.
Specialized datasets
randomNumericData
Generates numeric datasets using a Gaussian distribution to create realistic random fluctuations around a mean value, typically used for charts.
Parameters
options
nDataSets
The number of separate datasets to generate. Default 1.
integer
nDataPoints
The number of data points per dataset. Default 100.
integer
addTimeAxis
Adds a date field to each data point, incrementing by one second per point. Default false.
boolean
timeFormat
The format of the date field when addTimeAxis is true: epoch, iso, string, or object. Default epoch.
string
Output
Returns a single array of numbers if nDataSets is 1 and addTimeAxis is false. Otherwise returns an array of objects with one key per dataset (dataset0, dataset1, ...) and, if enabled, the date field.
Examples
Example 1: Single dataset array
Example 2: Multiple datasets with an ISO time axis
randomAddressData
Returns an array of realistic address objects containing street, building number, city, state, and country fields.
Parameters
options
entries
The number of address objects to generate. Default 10.
integer
locale
The geographic locale format for the data: DE or US. Default DE.
string
Output
Returns an array of address objects.
randomPersonData
Returns an array of realistic personal identity records.
Parameters
options
entries
The number of person objects to generate. Default 10.
integer
locale
The regional locale format for names and data: DE or US. Default DE.
string
Output
Returns an array of objects containing avatar (a base64-encoded random JPEG image), title, firstName, lastName, company, phone, verified (always true), validUntil (a random ISO date within the next 30 hours), and note (always empty).
randomChatData
Generates an array of simple chat message objects with alternating role values (You and ChatBot) and random content to simulate a conversation.
Parameters
messages
The total number of chat messages to generate. Default 10.
integer
Output
Returns an array of chat message objects.
timelineData
Generates randomized chronological timeline events spanning a specific duration and ending at the current time. This function supports tracking machine states, operator assignments, and work shifts.
Parameters
options
totalDurationHours
The total duration of the generated data in hours. Default 24.
number
includeState
Includes the machine state track (values Running, Idle, Maintenance, or Error). Default true.
boolean
includeOperator
Includes the operator assignment track. Default false.
boolean
includeShift
Includes the work shift track. Default false.
boolean
timeFormat
The timestamp format: epoch, iso, string, or object. Default epoch.
string
Output
Returns an array of timeline event objects with a timestamp and the enabled tracks.
randomPointInCircle
Generates a random GPS coordinate within a specified radius of a central point.
Parameters
distance
The radius of the circle in meters. Default 5000.
integer
coord
lat
The latitude of the central coordinate point. Default 53.5511 (Hamburg, Germany).
number
lng
The longitude of the central coordinate point. Default 9.9937 (Hamburg, Germany).
number
Output
Returns a coordinate object containing lat and lng properties.
Predefined reference datasets
These functions require no parameters and return static, predefined JSON datasets to test layout configurations and UI components (such as charts, data grids, or kanban boards) consistently:
kanbanData: Returns structured columns and cards for a kanban board.energyData: Returns data tracking power metrics and energy sources.populationDataset: Returns historical demographic population data.marketValueDataset: Returns data tracking corporate market valuations.australianMedalsDataset: Returns statistics on historical Olympic medals.populationVsAgeDataset: Returns data correlating age groups and population distribution.
Execution control
longExecution
Simulates a long-running asynchronous process by pausing execution for a specified duration.
Parameters
time
The simulated execution duration in milliseconds.
integer
Output
Returns the execution duration value after the specified delay.
Last updated
Was this helpful?