Title

Global

Methods

# addSubheaders(subheaders, matrix) → {Array.<Array>}

Overview

Adds subheaders to the first row and column of a provided matrix.
Parameters:
Name Type Description
subheaders Array.<string> | Array.<number>

Additional information added to first row and column of a matrix.

matrix Array.<Array.<number>>

Data set that is going to have subheaders added to it.

View Source Utils/utilFunctions/parseMatrix/parseElements/addSubheaders.js, line 11

  • The matrix with added subheaders.
Array.<Array>

# conjugateContent(number, base) → {string}

Overview

Conjugates a provided word based on a provided number.
Parameters:
Name Type Description
number number

Used to conjugate word.

base string

A word that will be conjugated.

View Source Utils/utilFunctions/parseItems/parseDetails/conjugateContent.js, line 11

  • Conjugated word.
string

# async downloadFunction(link)

Overview

Downloads data from provided link.
Parameters:
Name Type Description
link string | URL

The link to download data from.

View Source Utils/utilFunctions/fetchFunctions/downloadFunction/downloadFunction.js, line 13

AlertError

# async downloadMatrix(pathParams, queryParamsopt, baseopt)

Overview

Utilizes downloadFunction to download matrix from /projects/{projectId}/misclassificationMatrix/download where projectId is the identifier of a selected project.

Usage

In order to download matrix from second fold from cross-validation specify queryParams accordingly: { typeOfMatrix: crossValidationFold, foldIndex: 1 }.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

queryParams Object <optional>

The query parameters in the URL of an API call.

typeOfMatrix string <optional>

The type of a matrix download.

numberOfFold string <optional>

The index of a fold from cross-validation.

base string <optional>
http://localhost:8080

The host in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchMatrix/downloadMatrix.js, line 23

# async downloadRules(pathParams, queryParams, baseopt)

Overview

Utilizes downloadFunction to download rules from /projects/{projectId}/rules/download where projectId is the identifier of a selected project.

Usage

In order to download rules in XML format specify queryParams accordingly: { format: "xml" }.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

queryParams Object

The query parameters in the URL of an API call.

format "txt" | "xml"

The format in which rules should be downloaded.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchRules/downloadRules.js, line 22

InvalidPathParamsException

# estimateMatrixHeight(matrix, cellHeightopt) → {number}

Overview

Estimates the height of a VirtualizedMatrix for given data.
Parameters:
Name Type Attributes Default Description
matrix Array.<Array>

A matrix that is going to be displayed in VirtualizedMatrix.

cellHeight number <optional>
64

Height of a cell from the matrix.

View Source Utils/DataDisplay/VirtualizedMatrix.js, line 56

An estimated height of a matrix.

number

# estimateMatrixWidth(matrix, cellWidthopt) → {number}

Overview

Estimates the width of a VirtualizedMatrix for given data.
Parameters:
Name Type Attributes Default Description
matrix Array.<Array>

A matrix that is going to be displayed in VirtualizedMatrix.

cellWidth number <optional>
64

Width of a cell from the matrix.

View Source Utils/DataDisplay/VirtualizedMatrix.js, line 75

An estimated width of a matrix.

number

# estimateTableHeight(data, rowHeightopt) → {number}

Overview

Estimates height of the VirtualizedTable for given data.
Parameters:
Name Type Attributes Default Description
data Array

An array of objects that is going to be displayed in VirtualizedTable.

rowHeight number <optional>
48

Height of a row from the table.

View Source Utils/DataDisplay/VirtualizedTable.js, line 19

An estimated height of the table.

number

# async exportProject(pathParams, baseopt) → {Promise.<void>}

Overview

Utilizes downloadFunction to download project from /project/{projectId}/export where projectId is the identifier of a selected project.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchProject/exportProject.js, line 17

InvalidPathParamsException

Promise.<void>

# async fetchClassification(pathParams, method, body, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET or PUT method and a specified body on /projects/{projectId}/classification where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve or calculate classification for a selected project.

Example response


    {
        "objectNames": [
            "Object 1",
            "Object 2"
        ],
        "externalData": false,
        "Objects": [
            {
                "originalDecision": "medium",
                "suggestedDecision": "medium",
                "certainty": 1.0,
                "numberOfCoveringRules": 2
            },
            {
                "originalDecision": "medium",
                "suggestedDecision": "medium",
                "certainty": 1.0,
                "numberOfCoveringRules": 3
            }
        ],
        "isCurrentData": true
        "parameters": {
            "classifierType": "SIMPLE_RULE_CLASSIFIER",
            "defaultClassificationResultType": "MAJORITY_DECISION_CLASS"
        }
    }

Usage

In order to calculate with the following parameters:
  • classifier type - simple rule classifier
  • default classification result type - majority decision class
create a FormData object and append mentioned parameters to the body using append method.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

method string

The HTTP method of an API call.

body Object

The body in the message of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchClassification/fetchClassification.js, line 61

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchConeObjects(pathParams, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /projects/{projectId}/cones/{objectIndex}/{coneType} where projectId is the identifier of a selected project, objectIndex is the index of an object from information table and coneType is the type of a selected cone such as: positive, negative, positive_inverted or negative_inverted.

Goal

The goal of this functions is to retrieve the indices of elements from a selected dominance cone.

Example response


    [
         0,
         2,
         3,
         5
    ]
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

objectIndex number

The index of a selected object from information table.

coneType string

The type of a selected cone.

base string <optional>
http://localhost:8080

The host in in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchCones/fetchConeObjects.js, line 36

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchCones(pathParams, method, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET or POST on /project/{projectId}/cones where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve or calculate dominance cones for objects from specified project.

Example response


    {
        "numberOfObjects": 2,
        "objectNames": [
            "Object 1",
            "Object 2"
        ],
        "isCurrentData": true,
        "positiveDominanceCones": [
            "Object 1"
        ],
        "negativeDominanceCones": [
            "Object 2"
        ],
        "positiveInvertedDominanceCones": [
            "Object 2"
        ],
        "negativeInvertedDominanceCones": [
            "Object 1"
        ]
    }
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

method string

The HTTP method of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchCones/fetchCones.js, line 46

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchCrossValidation(pathParams, method, body, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET or PUT method and a specified body on /projects/{projectId}/crossValidation where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve or calculate cross-validation for a selected project.

Example response


    {
        "isCurrentData": true,
        "parameters": {
             "typeOfUnions": "MONOTONIC",
             "consistencyThreshold": 0.0,
             "typeOfRules": "CERTAIN",
             "classifierType": "SIMPLE_RULE_CLASSIFIER",
             "defaultClassificationResultType": "MAJORITY_DECISION_CLASS",
             "numberOfFolds": 10,
             "seed": 0
        }
    }

Usage

In order to calculate cross-validation with the following parameters:
  • type of unions - monotonic
  • consistency threshold - 0.0
  • type of rules - certain
  • classifier type - simple rule classifier
  • default classification result type - majority decision class
  • number of folds - 10
create a FormData object and append mentioned parameters to the body using append method.
Parameters:
Name Type Attributes Default Description
pathParams string

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

method string

The HTTP method of an API call.

body Object

The body in the message of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchCrossValidation/fetchCrossValidation.js, line 51

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchData(pathParams, method, body, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET or PUT method on /projects/{projectId}/data where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve or update information table from specified project.

Examples

When method is set to GET


    {
        "attributes": [ ],
        "objects": [ ]
    }
When method is set to POST


    {
         "dominanceCones": {
             "isCurrentData": true
         },
         "unions": {
             "isCurrentData": true
         },
         "rules": {
             "externalRules": false,
             "isCurrentData": true
         },
         "classification": {
             "externalData": false,
             "isCurrentData": true
         },
         "crossValidation": {
             "isCurrentData": true
         }
     }

Usage

In order to update information table, create a FormData object and append attributes and objects to the body using append method with keys metadata and data.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

method string

The HTTP method of an API call.

body FormData

The body in the message of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchData/fetchData.js, line 62

Promise.<Object>

# async fetchDescriptiveAttributes(resource, pathParams, queryParams, method, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET or POST method on /projects/{projectId}/{resource}/descriptiveAttributes where projectId is the identifier of a selected project and resource is the name of a selected resource such as: cones, unions, rules, classification, classification/rules and crossValidation.

Goal

The goal of this function is to retrieve the name of descriptive attributes from information table or change default visible object name which is the value of a descriptive attribute for a certain object.

Example response


    {
        "available": [
            "Name",
            "LastName"
        ],
        "actual": null
    }

Usage

In order to set default object names to represent values of an attribute "Name" specify queryParams accordingly: { objectVisibleName: "Name" } and set method to POST.
Parameters:
Name Type Attributes Default Description
resource string

The name of a selected resource.

pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

queryParams Object

The query parameters in the URL of an API call.

objectVisibleName string <optional>

The new type of a name that will be used to describe objects.

method string

The HTTP method of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchDescriptiveAttributes.js, line 43

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchFold(pathParams, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /projects/{projectId}/crossValidation/{foldIndex} where projectId is the identifier of a selected project and foldIndex is the index of a selected fold from cross-validation.

Goal

The goal of this function is to retrieve the content of a selected fold from cross-validation.

Example response


     {
         "objectNames": [
             "Object 1",
             "Object 2"
         ],
         "numberOfTrainingObjects": 2,
         "numberOfRules": 1,
         "objects": [
             {
                 "originalDecision": "bad",
                 "suggestedDecision": "bad",
                 "certainty": 1.0,
                 "numberOfCoveringRules": 1
             },
             {
                 "originalDecision": "bad",
                 "suggestedDecision": "bad",
                 "certainty": 1.0,
                 "numberOfCoveringRules": 1
             }
         ]
     }
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

foldIndex number

The index of a selected fold from cross-validation

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchCrossValidation/fetchFold.js, line 47

Promise.<Object>

# async fetchMatrix(resource, pathParams, queryParamsopt, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /projects/{projectId}/classification/misclassificationMatrix or /projects/{projectId}/crossValidation/{foldIndex}/misclassificationMatrix where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve information about misclassification matrix from a selected project.

Example response


    {
        "decisionsDomain": [
             "bad",
             "medium",
             "good"
        ],
        "traits": {
            "Accuracy": 0.9476492164054684,
               "Deviation of accuracy": 0.012053299287963505,
               "mae": 0.052350783594531505,
               "rmse": 0.22880293615802116,
               "gmean": 0.7313837893935226,
               "Number of correct assignments": 284.2,
               "Deviation of number of correct assignments": 3.6147844564602556,
               "Number of incorrect assignments": 15.7,
               "Deviation of number of incorrect assignments": 4.854551129266914,
               "Number of objects with assigned decision": 299.90000000000003,
               "Deviation of number objects with assigned decision": 2.8460498941515415,
               "Number of unknown original decisions": 0.0,
               "Deviation of number of unknown original decisions": 0.0,
               "Number of unknown assignments": 0.0,
               "Deviation of number of unknown assignments": 0.0,
               "Number of unknown assigned decisions for unknown original decisions": 0.0,
               "Deviation of number of unknown assigned decisions for unknown original decisions": 0.0
         },
        "value": [
            [101.60000000000001, 1.4000000000000001, 0]
            [0, 173.20000000000002, 0],
            [0, 14.3, 9.399999999999999]
        ],
        "Deviation of value": [
            [1.1737877907772674, 1.1737877907772674, 0],
            [0, 0.6324555320336759, 0],
            [0, 4.738729318662921, 3.5023801430836525]
         ]
    }

Usage

In order to retrieve matrix from second fold from cross-validation specify queryParams accordingly: { typeOfMatrix: crossValidationFold, foldIndex: 1 }.
Parameters:
Name Type Attributes Default Description
resource string

The name of a selected resource.

pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

queryParams Object <optional>

The query parameters in the URL of an API call.

typeOfMatrix string

The type of a matrix to fetch.

numberOfFold string <optional>

The index of a selected fold.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchMatrix/fetchMatrix.js, line 70

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchObject(resource, pathParams, queryParams, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /projects/{projectId}/{resource}/object where projectId is the identifier of a selected project and resource is the name of a selected resource such as: cones, unions, rules, classification, classification/rules or crossValidation.

Goal

The goal of this function is to retrieve an object with a specified index from the information table.

Example

When isAttributes is set to true


     {
         "value": { },
         "attributes": [ ]
     }

Usage

In order to retrieve information about object with index 0 and receive attributes as well specify queryParams accordingly: { objectIndex: 0, isAttributes: true }.
Parameters:
Name Type Attributes Default Description
resource string

The name of a selected resource.

pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

queryParams Object

The query parameters in the URL of an API call.

objectIndex string

The index of a selected object from information table.

isAttributes boolean

If true server will include attributes in response.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchObject.js, line 41

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchObjectNames(resource, pathParams, queryParamsopt, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /project/{projectId}/{resource}/objectNames where projectId is the identifier of a selected project and resource is the name of a selected resource such as: cones, unions, rules, classification, classification/rules or crossValidation.

Goal

The goal of this functions is to retrieve visible object names.

Example


    [
        "Object 1",
        "Object 2"
    ]

Usage

In order to retrieve object names for the upper approximation of an union with index 0 specify queryParams accordingly: { subject: 0, set: "upperApproximation" }.
Parameters:
Name Type Attributes Default Description
resource string

The name of a selected resource.

pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

queryParams Object <optional>

The query parameters in the URL of an API call.

subject number <optional>

The index of a subject that contains object names.

set string <optional>

The name of the set that narrows down object names.

base string <optional>
http://localhost:8080

The host in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchObjectNames.js, line 39

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchProject(pathParams, method, body, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET, PATCH or DELETE method and specified body on /projects/{projectId} where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve concise information about project, change it's name or delete it.

Examples

When method is set to PATCH


    {
        "id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
        "name": "students"
    }
When method is set to GET


    {
         "dominanceCones": {
             "isCurrentData": true
         },
         "unions": {
             "isCurrentData": true
         },
         "rules": {
             "externalRules": false,
             "isCurrentData": true
         },
         "classification": {
             "externalData": false,
             "isCurrentData": true
         },
         "crossValidation": {
             "isCurrentData": true
         }
     }

Usage

In order to change project's name to "students 2", create a FormData object and append your name with name key.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

method string

The HTTP method of an API call.

body FormData

The body in the message of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchProject/fetchProject.js, line 62

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchProjectDetails(pathParams, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /projects/{projectId}/details.

Goal

The goal of this functions is to retrieve concise details about selected project.

Example response


     {
         "metadataFileName": "students_metadata.json",
         "dataFileName": "students_data.csv",
         "rulesFileName": "students_rules.xml",
         "externalDataFileName": "students_2_data.csv"
     }
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

base string <optional>
http://localhost:8080

The host and port in the url of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchProject/fetchProjectDetails.js, line 30

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchProjects(method, body, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET or POST method and specified body on /projects

Goal

The goal of this functions is to retrieve all project from server or create another one.

Examples

When method is set to GET


    [
         {
             "id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
             "name": "students"
         },
         {
             "id": "bcde2e1c-e76a-433b-862d-469e5bf16a93",
             "name": "students 2"
         }
    ]
When method is set to POST


    {
        "id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
        "name": "students"
    }

Usage

In order to create project with three files: metadata, data and rules, create FormData object and append mentioned files to the object using append method.
Parameters:
Name Type Attributes Default Description
method string

The HTTP method of an API call.

body FormData

The body in the message of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchProject/fetchProjects.js, line 50

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchRule(resource, pathParams, baseopt, isCoveringObjectsopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /projects/{projectId}/{resource}/{ruleIndex} where projectId is the identifier of a selected project, ruleIndex is the index of a selected rule and resource is the name of a selected resource such as: rules, classification or cross-validation/{foldIndex}.

Goal

The goal of this functions is to retrieve information about selected rule from specified project.

Examples

When resource equals to rules and classification or cross-validation/{foldIndex} but with isCoveringObjects set to true


     {
         "objectNames": [
             "Object 1"
             "Object 2"
         ],
         "indicesOfCoveredObjects": [
             0,
             1
         ],
         "isSupportingObject": [
             true,
             true
         ]
     }
When resource equals to classification or cross-validation


    {
         "ruleCharacteristics": { },
         "rule": { }
    }

Usage

If isCoveringObjects is set to true function will perform an API call on /projects/{projectId}/{resource}/{ruleIndex}/coveringObjects.
Parameters:
Name Type Attributes Default Description
resource string

The name of a selected resource.

pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

ruleIndex string

The index of a selected rule.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

isCoveringObjects boolean <optional>
false

If true function will add /coveringObjects to pathname.

View Source Utils/utilFunctions/fetchFunctions/fetchRule.js, line 63

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchRules(pathParams, method, body, baseopt, uploadopt) → {Promise.<Object>}

Overview

Performs an API call with GET or PUT method and specified body on /projects/{projectId}/rules where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve, upload or calculate decision rules from a selected project.

Example response


    {
        "externalRules": false,
        "validityRulesContainer": {
            "unions": {
                "isCurrentData": true
            },
            "classification": {
                "externalData": false,
                "isCurrentData": true
            }
        },
        "Rules": [
            {
                "ruleCharacteristics": { },
                "rule": { }
            },
            {
                "ruleCharacteristics": { },
                "rule": { }
            }
        ],
        "parameters": {
            "typeOfUnions": "MONOTONIC",
            "consistencyThreshold": 0.0,
            "typeOfRules": "CERTAIN"
        },
        "isCurrentData": true
    }

Usage

In order to calculate rules with the following parameters:
  • type of unions - monotonic
  • consistency threshold - 0.0
  • type of rules - certain
create a FormData object and append mentioned parameters to the body using append method.

In order to upload rules create a FormData object and append selected file with rules key.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

method string

The HTTP method of an API call.

body FormData

The body in the message of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

upload boolean <optional>
false

If true function will add /upload to path.

View Source Utils/utilFunctions/fetchFunctions/fetchRules/fetchRules.js, line 70

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchUnion(pathParams, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method on /projects/{projectId}/unions/{unionIndex} or /projects/{projectId}/unions/{unionIndex}/{arrayPropertyType} where projectId is the identifier of a selected project, unionIndex is the index of a selected union and arrayPropertyType is the name of a selected union's property such as: objects, upperApproximation or lowerApproximation.

Goal

The goal of this function is to retrieve properties that belong to a specified union or elements from a selected union's property.

Example response

When fetching union:


     {
         "Objects": 237,
         "Lower approximation": 78,
         "Upper approximation": 251,
         "Boundary": 173,
         "Positive region": 78,
         "Negative region": 2753,
         "Boundary region": 168
    }
When fetching union's property:

    {
        "objectNames": [
            "Object 1",
            "Object 2"
        ],
        "value": [
            0,
            1
        ]
    }
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

unionIndex number

The index of a selected union.

arrayPropertyType string <optional>

The name of a selected union property.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchUnions/fetchUnion.js, line 57

AlertError

InvalidPathParamsException

Promise.<Object>

# async fetchUnions(pathParams, queryParams, method, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET or PUT method on /projects/{projectId}/unions where projectId is the identifier of a selected project.

Goal

The goal of this function is to retrieve or calculate class unions for a selected project.

Example response


    {
        "qualityOfApproximation": 1,
        "Unions": [
            {
                 "unionType": "AT_MOST",
                    "limitingDecision": "good",
                    "accuracyOfApproximation": 1,
                    "qualityOfApproximation": 1
            }
        ],
        "isCurrentData": true,
        "parameters": {
            "typeOfUnions": MONOTONIC,
            "consistencyThreshold": 0.0
        }
    }

Usage

In order to calculate monotonic class unions with consistency threshold equal to 0.3 specify queryParams accordingly: { typeOfUnions: "monotonic", consistencyThreshold: 0.3 }.
Parameters:
Name Type Attributes Default Description
pathParams Object

The path parameters in the URL of an API call.

projectId string

The identifier of a selected project.

queryParams Object

The query parameters in the URL of an API call.

typeOfUnions string <optional>

The value of the type of unions from Unions tab.

consistencyThreshold number <optional>

The value of consistency threshold from Unions tab.

method "GET" | "PUT"

The HTTP method of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchUnions/fetchUnions.js, line 49

AlertError

InvalidPathParamsException

Promise.<Object>

# filterFunction(filterText, items) → {Array.<Object>}

Overview

Looks for at least one match in filter features. When filterText contains more than one word, all of them have to be found in at least one filter feature.
Parameters:
Name Type Description
filterText string

Input from FilterTextField.

items Array.<Object>

The list of items from ResultList.

View Source Body/Project/Filtering/FilterFunction.js, line 17

  • Filtered list of items.
Array.<Object>

# getAppropriateColor(attribute) → {Object}

Overview

Returns appropriate styling for given attribute.
Parameters:
Name Type Description
attribute Object

An attribute from information table.

View Source Utils/Dialogs/DetailsDialog/Utils/getAppropriateColor.js, line 10

  • Style object with background colour and colour.
Object

# getAppropriateSign(object1, object2, attribute, tableIndex) → {string}

Overview

Returns appropriate relation symbol to compare values of attributes from two objects.
Parameters:
Name Type Description
object1 Object

The selected object with it's details displayed in FullscreenDialog.

object2 Object

An object from information table.

attribute Object

An attribute from information table.

tableIndex number

The index of dominance cone.

View Source Utils/Dialogs/DetailsDialog/Utils/getAppropriateSign.js, line 13

  • Relation symbol.
string

# getFixed(value) → {string|number}

Overview

Formats number using either a fixed-point notation or an exponential notation. The exponential notation is used if there are three or more zero digits after decimal point and before a non-zero digit. Otherwise, a fixed-point notation is used.

If a provided value is an integer, formatting is omitted.

Used in parseRulesListItems to prepare rule characteristic to be displayed in ResultList.
Parameters:
Name Type Description
value string | number

A number that will be formatted accordingly.

View Source Utils/utilFunctions/parseListItems/parseRulesListItems.js, line 19

  • A formatted number.
string | number

# getItemName(index, names, defaultNameopt) → {Object}

Overview

Generates name for items displayed in Cones, Classification and CrossValidation. Function takes user preferences into account. If an 'indexOption' property from project settings is equal to one of description or identification attributes, a value associated with this attribute will be used as a name.

Used to generate name for parseConesItems, parseClassifiedItems.
Parameters:
Name Type Attributes Default Description
index number

The index of an object in information table.

names Array

The array of object names received from server.

defaultName string <optional>
"Object"

The default object name.

View Source Utils/utilFunctions/parseItems/parseElements/getItemName.js, line 17

  • An item's name as an object.
Object

# getRelationSign(relationSymbol) → {string}

Overview

Returns a unicode for a provided relation symbol.
Parameters:
Name Type Description
relationSymbol string

A relation symbol as a simple string.

View Source Utils/utilFunctions/parseItems/parseDetails/getRelationSign.js, line 10

  • A relation in unicode.
string

# getRuleName(rule) → {Object}

Overview

Generates name for rules. Uses parseDecisions and parseDecisions to obtain decisions and conditions.
Parameters:
Name Type Description
rule Object

A single rule from a rule set.

View Source Utils/utilFunctions/parseItems/parseElements/getRuleName.js, line 13

  • Generated name for provided rule.
Object

# getTitleConditions(conditions) → {Array.<Object>}

Overview

Wraps conditions in round brackets when necessary. Joins conditions with logic AND.
Parameters:
Name Type Description
conditions Array.<Object>

The condition's part of a rule.

View Source Utils/Dialogs/DetailsDialog/Utils/getTitleConditions.js, line 11

  • The condition's part of a rule prepared to be displayed in a title.
Array.<Object>

# getTitleDecisions(decisions) → {Array.<Array.<Object>>}

Overview

Wraps decisions in round brackets then adds square brackets when necessary. Joins decisions with logic AND then with logic OR.
Parameters:
Name Type Description
decisions Array.<Array.<Object>>

The decision's part of a rule.

View Source Utils/Dialogs/DetailsDialog/Utils/getTitleDecisions.js, line 11

  • The decision's part of a rule prepared to be displayed in a title.
Array.<Array.<Object>>

# async handleNotOk(response) → {Promise.<Object>}

Overview

Determines the severity of a thrown AlertError.

4** - corresponds to 'error' severity,
5** - corresponds to 'warning' severity,
any other will be marked as 'info'.
Parameters:
Name Type Description
response Object

A response from server with status different than 2**.

View Source Utils/utilFunctions/fetchFunctions/parseResponse/handleNotOk.js, line 20

AlertError

Promise.<Object>

# hexToRgb(hex, opacity) → {string}

Overview

Converts color in HEX to RGB and adds opacity.
Parameters:
Name Type Description
hex string

Colour in HEX that will be converted to RGB.

opacity number

Opacity of a colour that will be added to RGB.

View Source Utils/utilFunctions/colors/hexToRgb.js, line 11

  • Colour in RGB.
string

# async importProject(body, baseopt) → {Promise.<Object>}

Overview

Performs an API call with GET method and specified body on /projects/import.

Goal

The goal of this function is to import project from ZIP file.

Example response


    {
        "id": "2bd9663c-725b-41aa-bb99-d41a43cf1f66",
        "name": "students"
    }

Usage

In order to import project from ZIP file, create FormData object and append mentioned file with importFile key.
Parameters:
Name Type Attributes Default Description
body FormData

The body in the message of an API call.

base string <optional>
http://localhost:8080

The host and port in the URL of an API call.

View Source Utils/utilFunctions/fetchFunctions/fetchProject/importProject.js, line 29

Promise.<Object>

# mergeClasses(c1, c2) → {Object}

Overview

Merges two classes objects. Classes object looks something like this: {key-name: "name-of-css_class"}.
For more information check out Material-UI docs on overriding styles with classes .
Parameters:
Name Type Description
c1 Object

Base classes object. Some values may be overwritten.

c2 Object

Classes object that will be merged into base classes object.

View Source Utils/utilFunctions/mergeClasses.js, line 19

  • Merged classes object.
Object

# nonNullProperty(object, propertyName) → {boolean}

Overview

Checks whether object exists, has it's own property from second argument and that property has a defined value.
Parameters:
Name Type Description
object Object

Any javascript object.

propertyName string

The property name as string.

View Source Utils/utilFunctions/nonNullProperty.js, line 11

  • If true the object has a non null property.
boolean

# parseClassificationParams(result) → {Object}

Overview

Retrieves parameters used to perform classification from server response.
Parameters:
Name Type Description
result Object

Server response.

View Source Utils/utilFunctions/parseParams/parseClassificationParams.js, line 10

  • Retrieved parameters.
Object

# parseClassifiedItems(objects, names) → {Array.<Object>}

Overview

Converts server response to an array of items. Single item can be displayed in ClassifiedObjectDialog. Uses getItemName as well as 'settings' to obtain special name for an item.
Parameters:
Name Type Description
objects Array

The array of classified objects received from server.

names Array

The array of object names received from server.

View Source Utils/utilFunctions/parseItems/parseClassifiedItems.js, line 14

  • The array of items.
Array.<Object>

# parseClassifiedListItems(items) → {Array.<Object>}

Overview

Converts items to list items that will be displayed in ResultList.
Parameters:
Name Type Description
items Array.<Object>

An array of items prepared by parseClassifiedItems.

View Source Utils/utilFunctions/parseListItems/parseClassifiedListItems.js, line 12

Array.<Object>

# parseConditions(conditions) → {Array.<Array.<Object>>}

Overview

Converts conditions from server response to conditions used in a rule name.
Parameters:
Name Type Description
conditions Array.<Array.<Object>>

Conditions from a single rule received from server.

View Source Utils/utilFunctions/parseItems/parseElements/parseConditions.js, line 12

  • An array of conditions.
Array.<Array.<Object>>

# parseConesItems(data, names) → {Array.<Object>}

Overview

Converts server response to an array of items. Single item can be displayed in ConesDialog. Uses getItemName as well as 'objects' and 'settings' to obtain special name for an item.
Parameters:
Name Type Description
data Object

A response from server.

names Array

The array of object names received from server.

View Source Utils/utilFunctions/parseItems/parseConesItems.js, line 14

  • The array of items.
Array.<Object>

# parseConesListItems(items) → {Array.<Object>}

Overview

Converts items to list items that will be displayed in ResultList.
Parameters:
Name Type Description
items Array.<Object>

An array of items prepared by parseConesItems.

View Source Utils/utilFunctions/parseListItems/parseConesListItems.js, line 10

Array.<Object>

# parseCrossValidationParams(result) → {Object}

Overview

Retrieves parameters used to perform cross-validation from server response.
Parameters:
Name Type Description
result Object

Server response.

View Source Utils/utilFunctions/parseParams/parseCrossValidationParams.js, line 10

  • Retrieved parameters.
Object

# parseDecisions(decisions) → {Array.<Array.<Object>>}

Overview

Converts decisions from server response to decisions used in a rule name.
Parameters:
Name Type Description
decisions Array.<Array.<Object>>

Decision from a single rule received from server.

View Source Utils/utilFunctions/parseItems/parseElements/parseDecisions.js, line 12

  • An array of decisions.
Array.<Array.<Object>>

# parseFormData(parameters, files) → {FormData}

Overview

Prepares FormData that will be included in the body of an API call.
Parameters:
Name Type Description
parameters Object

The map of parameters to be appended to FormData.

files Object

The map of files to be appended to FormData.

View Source Utils/utilFunctions/fetchFunctions/parseFormData/parseFormData.js, line 11

  • FormData with appended parameters and files.
FormData

# parseMatrix(matrixObject) → {Object}

Overview

Creates a matrix item to display in MatrixDialog.
Parameters:
Name Type Description
matrixObject Object

The part of a server response containing misclassification matrix.

View Source Utils/utilFunctions/parseMatrix/parseMatrix.js, line 12

Object

# parseRulesItems(data) → {Array.<Object>}

Overview

Converts server response to an array of items. Single item can be displayed in RulesDialog. Uses getRuleName to obtain special name for an item.
Parameters:
Name Type Description
data Object

Server response.

View Source Utils/utilFunctions/parseItems/parseRulesItems.js, line 13

  • An array of items.
Array.<Object>

# parseRulesListItems(items) → {Array.<Object>}

Converts items to list items that will be displayed in ResultList.

Parameters:
Name Type Description
items Array.<Object>

An array of items prepared by parseRulesItems.

View Source Utils/utilFunctions/parseListItems/parseRulesListItems.js, line 45

Array.<Object>

# parseRulesParams(result) → {Object}

Overview

Retrieves parameters used to generate rules from server response.
Parameters:
Name Type Description
result Object

Server response.

View Source Utils/utilFunctions/parseParams/parseRulesParams.js, line 10

  • Retrieved parameters.
Object

# parseUnionsItems(data) → {Array.<Object>}

Overview

Converts server response to an array of items. Single item can be displayed in UnionsDialog.
Parameters:
Name Type Description
data Object

Server response.

View Source Utils/utilFunctions/parseItems/parseUnionsItems.js, line 10

  • An array of items.
Array.<Object>

# parseUnionsListItems(items) → {Array.<Object>}

Overview

Converts items to list items that will be displayed in ResultList.
Parameters:
Name Type Description
items Array.<Object>

An array of items prepared by parseUnionsItems.

View Source Utils/utilFunctions/parseListItems/parseUnionsListItems.js, line 10

Array.<Object>

# async responseBlob(response) → {Promise.<Object>}

Overview

Returns response from a server parsed to BLOB format.
Parameters:
Name Type Description
response Object

A response from a server that can be converted to BLOB format.

View Source Utils/utilFunctions/fetchFunctions/parseResponse/responseBlob.js, line 12

Promise.<Object>

# async responseJson(response) → {Promise.<Object>}

Overview

Returns response from a server parsed to JSON format.
Parameters:
Name Type Description
response Object

A response from a server that can be parsed to JSON format.

View Source Utils/utilFunctions/fetchFunctions/parseResponse/responseJson.js, line 12

Promise.<Object>