Class

Classification

Classification(props) → {React.Component}

Overview

The classification tab in RuLeStudio. Presents the list of all object from information table with suggested classification based on generated rules.
Constructor

# new Classification(props) → {React.Component}

Parameters:
Name Type Description
props Object
objectGlobalName string

The global visible object name used by all tabs as reference.

onDateUploaded function

Callback fired when tab receives information that new data was uploaded.

onTabChange function

Callback fired when a tab is changed and there are unsaved changes in this tab.

project Object

Current project.

serverBase string

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

showAlert function

Callback fired when results in this tab are based on outdated information table.

value number

The index of a selected tab.

View Source Body/Project/Tabs/Classification.js, line 46

React.Component

Methods

# static calculateClassification(method, data)

Overview

Makes an API call on classification to classify objects from current project or uploaded objects with selected parameters. Then, updates state and makes necessary changes in display.
Parameters:
Name Type Description
method string

A HTTP method such as GET, POST or PUT.

data Object

The body of the message.

View Source Body/Project/Tabs/Classification.js, line 233

# static getClassification()

Overview

Makes an API call on classification to receive current copy of classification from server. Then, updates state and makes necessary changes in display.

View Source Body/Project/Tabs/Classification.js, line 90

# static onClassifyData()

Overview

Calls calculateClassification to classify objects from current project.

View Source Body/Project/Tabs/Classification.js, line 308

# static onCSVDialogClose(csvSpecs)

Overview

Callback fired when CSVDialog requests to be closed. If the user specified CSV attributes, method calls calculateClassification to classify objects from uploaded file.
Parameters:
Name Type Description
csvSpecs Object

An object representing CSV attributes.

View Source Body/Project/Tabs/Classification.js, line 358

# static onFilterChange(event)

Overview

Filters items from Classification's state. Method uses filterFunction to filter items.
Parameters:
Name Type Description
event Object

Represents an event that takes place in DOM.

View Source Body/Project/Tabs/Classification.js, line 428

# static onSaveToFile()

Overview

Callback fired when the user requests to download misclassification matrix. Method makes an API call to download the resource.

View Source Body/Project/Tabs/Classification.js, line 382

# static onUploadData(event)

Overview

Calls calculateClassification to classify objects from uploaded file. If uploaded file is in CSV format, method opens CSVDialog to specify CSV attributes.
Parameters:
Name Type Description
event Object

Represents an event that takes place in DOM.

View Source Body/Project/Tabs/Classification.js, line 326

# componentDidMount()

Overview

A component's lifecycle method. Fired once when component was mounted.

Goal

Method calls getClassification.

View Source Body/Project/Tabs/Classification.js, line 158

# componentDidUpdate(prevProps, prevState, snapshot)

Overview

A component's lifecycle method. Fired after a component was updated.

Goal

If project was changed, method saves changes from previous project and calls getClassification to receive the latest copy of classification.
Parameters:
Name Type Description
prevProps Object

Old props that were already replaced.

prevState Object

Old state that was already replaced.

snapshot Object

Returned from another lifecycle method getSnapshotBeforeUpdate. Usually undefined.

View Source Body/Project/Tabs/Classification.js, line 178

# componentWillUnmount()

Overview

A component's lifecycle method. Fired when component was requested to be unmounted.

Goal

Method saves changes from current project.

View Source Body/Project/Tabs/Classification.js, line 206