Documentation
¶
Index ¶
- Constants
- type Correlation
- type CorrelationMatrix
- type CorrelationMatrixBodyItem
- type CorrelationMatrixHeaderItem
- type CreateIndicatorArgs
- type CreateOrUpdateObservationArgs
- type Dataset
- type DatasetAggregation
- type DatasetParams
- type DatasetStyle
- type Dictionary
- type DictionaryEntry
- type GetCorrelationArgs
- type GetCorrelationMatrixArgs
- type GetDatasetsArgs
- type GetDatasetsArgsFilter
- type GetIndicatorsArgs
- type GetIndicatorsArgsFilter
- type Indicator
- type IndicatorValueParams
- type Observation
- type Scale
- type ServiceStats
- type UpdateAggregationsArgs
- type UpdateCorrelationsArgs
- type UpdateIndicatorArgs
- type User
- type UserSettings
Constants ¶
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 Dictionary ¶ added in v0.0.8
type Dictionary struct {
ID int `json:"id"`
Code string `json:"code"`
Description string `json:"description"`
}
Dictionary holds dictionaries
func (*Dictionary) JSONString ¶ added in v0.0.8
func (d *Dictionary) JSONString() string
type DictionaryEntry ¶ added in v0.0.8
type DictionaryEntry struct {
DictionaryID int `json:"dictionaryId"`
ID int `json:"id"`
Code string `json:"code"`
Description string `json:"description"`
}
DictionaryEntry holds entry of dictionary
func (*DictionaryEntry) JSONString ¶ added in v0.0.8
func (e *DictionaryEntry) JSONString() string
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 `json:"id"`
Code string `json:"code"` // unique code for external systems
Title string `json:"title"`
Description string `json:"description"`
Active bool `json:"active"` // FIXME move to dataset?
BuiltIn bool `json:"builtIn"` // if Indicator is created by the service
External bool `json:"extrnal"` // if Indicator is populated by the user or external system
Scale *Scale `json:"scale"`
Author *User `json:"author"`
UserDataset *Dataset `json:"userDataset"` // dataset for a specific user
ValueMapping map[string]string `json:"valueMapping"` // aliases for nomial and ordinal scales
ValueParams *IndicatorValueParams `json:"valueParams"`
CreateTime time.Time `json:"createTime"`
UpdateTime time.Time `json:"updateTime"`
}
Indicator is a set of user-created data
func (*Indicator) JSONString ¶ added in v0.0.7
type IndicatorValueParams ¶ added in v0.0.8
type IndicatorValueParams struct {
Default float64 `json:"default"`
Min float64 `json:"min"`
Max float64 `json:"max"`
Step float64 `json:"step"`
}
IndicatorValueParams holds rules for indicator values
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 `json:"id"`
Type string `json:"type"` // numeric, ordinal or nomial
Title string `json:"title"`
Description string `json:"description"`
}
Scale is a type of a scale for an Indicator
func (*Scale) JSONString ¶ added in v0.0.7
type ServiceStats ¶ added in v0.0.5
type ServiceStats struct {
Users int `json:"users,omitempty"`
Scales int `json:"scales,omitempty"`
Indicators int `json:"indicators,omitempty"`
Datasets int `json:"datasets,omitempty"`
Observations int `json:"observations,omitempty"`
Correlations int `json:"correlations,omitempty"`
}
ServiceStats struct holds service stats