Documentation
¶
Index ¶
- Constants
- type Correlation
- type CorrelationMatrix
- type CorrelationMatrixBodyItem
- type CorrelationMatrixHeaderItem
- type CreateIndicatorArgs
- type CreateOrUpdateObservationArgs
- type Dataset
- type DatasetAggregation
- type DatasetParams
- type DatasetStyle
- type GetCorrelationArgs
- type GetCorrelationMatrixArgs
- type GetDatasetsArgs
- type GetDatasetsArgsFilter
- type GetIndicatorsArgs
- type GetIndicatorsArgsFilter
- type Indicator
- type Observation
- type Scale
- type UpdateAggregationsArgs
- type UpdateCorrelationsArgs
- type User
- type UserSettings
Constants ¶
View Source
const ( PearsonCorrelationType = "pearson" SpearmanCorrelationType = "spearman" AutoCorrelationType = "auto" GranularityDay = "day" GranularityWeek = "week" GranularityMonth = "month" ScaleTypeNumeric = "numeric" ScaleTypeOrdinal = "ordinal" ScaleTypeNominal = "nominal" ScaleTypeBinary = "binary" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Correlation ¶
type Correlation struct {
ID int
Left *Dataset
Right *Dataset
Coef float64 // correlation coef
P float64 // p-value
R2 float64 // determination coef
Type string // Pearson or whatever
Granularity string
CreateTime time.Time
UpdateTime time.Time
}
Correlation is a corr value of a pair of Datasets
type CorrelationMatrix ¶
type CorrelationMatrix struct {
Header []CorrelationMatrixHeaderItem
Body [][]CorrelationMatrixBodyItem
}
CorrelationMatrix holds correlations of user datasets to be shown in the app.
type CorrelationMatrixBodyItem ¶
type CorrelationMatrixBodyItem struct {
CorrelationID int
Coef float64 // correlation coef
P float64 // p-value
R2 float64 // determination coef
Type string // Pearson or whatever
UpdateTime time.Time
}
CorrelationMatrixBodyItem holds a correlation on the matrix
type CorrelationMatrixHeaderItem ¶
CorrelationMatrixHeaderItem holds a matrix subject description
type CreateIndicatorArgs ¶
type Dataset ¶
type Dataset struct {
ID int
User *User
Indicator *Indicator
CreateTime time.Time
UpdateTime time.Time
Observations []*Observation
Params *DatasetParams
Source string // user input or external system
}
Dataset is an intance of an Indicator populated by user data. Each User can have one Dataset for each Indicator
type DatasetAggregation ¶
type DatasetAggregation struct {
IncludeZeroValues bool `json:"includeZeroValues"` // use zero values in aggregations
}
DatasetAggregation holds params for aggregation
type DatasetParams ¶
type DatasetParams struct {
Style DatasetStyle
Aggregation DatasetAggregation
}
DatasetParams holds various dataset options
type DatasetStyle ¶
type DatasetStyle struct {
Color string `json:"color,omitempty"`
}
DatasetStyle holds dataset apperance params for site/app
type GetCorrelationArgs ¶
type GetDatasetsArgs ¶
type GetDatasetsArgsFilter ¶
type GetDatasetsArgsFilter struct {
ID []int
}
type GetIndicatorsArgs ¶
type GetIndicatorsArgs struct {
UserID int
WithDataset bool
ObservationLimit int
Granularity string
Filter GetIndicatorsArgsFilter
}
type GetIndicatorsArgsFilter ¶
type Indicator ¶
type Indicator struct {
ID int
Code string // unique code for external systems
Title string
Description string
Active bool // FIXME move to dataset?
BuiltIn bool // if Indicator is created by the service
External bool // if Indicator is populated by the user or external system
Scale *Scale
Author *User
UserDataset *Dataset // dataset for a specific user
ValueMapping map[float64]string // aliases for nomial and ordinal scales
CreateTime time.Time
UpdateTime time.Time
}
Indicator is a set of user-created data
type Observation ¶
type Observation struct {
ID int
Value float64
Dataset *Dataset
Date *time.Time
Granularity string
CreateTime time.Time
UpdateTime time.Time
}
Observation is a data point for an indicator
type Scale ¶
type Scale struct {
ID int
Type string // numeric, ordinal or nomial
Title string
Description string
}
Scale is a type of a scale for an Indicator
type UpdateAggregationsArgs ¶
type UpdateCorrelationsArgs ¶
Click to show internal directories.
Click to hide internal directories.