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. |
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. |
# 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.# static onClassifyData()
Overview
CallscalculateClassification
to classify objects from current project.
# static onCSVDialogClose(csvSpecs)
Overview
Callback fired whenCSVDialog
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. |
# static onFilterChange(event)
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | Represents an event that takes place in DOM. |
# static onSaveToFile()
Overview
Callback fired when the user requests to download misclassification matrix. Method makes an API call to download the resource.# static onUploadData(event)
Overview
CallscalculateClassification
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. |
# componentDidMount()
Overview
A component's lifecycle method. Fired once when component was mounted.Goal
Method callsgetClassification
.
# 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 callsgetClassification
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 |