Files
Marcus Andersson 6bc369629d Docs: adding first version of the auto-generated packages API docs. (#22107)
* trying out api-extractor.

* works with our setup of build.

* wip.

* changed the packages so it works better with the api-extractor.

* Changes to make the api-extractor to work.

* cleaned up the api-extractor config files.

* added some more documentation.

* added tsdoc-metadata to gitignore.

* removed the generated docs (will do that in another PR).

* added execute permission to script for generating dosc.

* added so we will push generated docs to branch.

* will clean packages_api on abort.

* Fixed failing tests.

* fixed formatting issue with typedoc comment.

* temporarily disabled tslint rules about namespace until https://github.com/microsoft/rushstack/issues/1029 is resolved

* temporary enabled bable namespaces.

* updated build script.

* updated script.

* updated script with some colors.

* changed to camelCase.

* removed spacing.

* Starting to add documentation guidelines.

* added examples headline.

* added menu options.

* added parameters and return values.

* Fixed merge error.

* Added first version of auto-generated docs.

* changed so we use the eslint ignore syntax.

* changed to correct eslint ingnore comment.

* fixed some spelling errors reported by codespell.

* added script to generate docs in current folder.

* updated api docs.

* lerna bootstrap.

* added eror to the ingore words list.

* removed file that should be ignored.

* updated locKFILE.

* referenced the code comments guidelines.

* updated packages.

* updated deps.

* updated the autogenerated dosc.

* adding missing new line.
2020-02-26 10:03:53 +01:00

22 KiB

+++

-----------------------------------------------------------------------

Do not edit this file. It is automatically generated by API Documenter.

-----------------------------------------------------------------------

title = "@grafana/data" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++

@grafana/data package

A library containing most of the core functionality and data types used in Grafana.

Classes

Class Description
AppendedVectors This may be more trouble than it is worth. This trades some computation time for RAM -- rather than allocate a new array the size of all previous arrays, this just points the correct index to their original array values
AppPlugin
ArrayVector
CircularDataFrame This dataframe can have values constantly added, and will never exceed the given capacity
CircularVector Circular vector uses a single buffer to capture a stream of values overwriting the oldest value on add.This supports addting to the 'head' or 'tail' and will grow the buffer to match a configured capacity.
ConstantVector
CSVReader
DataFrameView (BETA) This abstraction will present the contents of a DataFrame as if it were a well typed javascript object Vector.
DataSourceApi The main data source abstraction interface, represents an instance of a data sourceAlthough this is a class, datasource implementations do not *yet* need to extend it. As such, we can not yet add functions with default implementations.
DataSourcePlugin
FieldCache
GrafanaPlugin
LanguageProvider
MutableDataFrame
PanelPlugin
Registry
ScaledVector
SortedVector Values are returned in the order defined by the input parameter

Enumerations

Enumeration Description
ColorScheme
CoreApp
CSVHeaderStyle
DataSourceStatus
DataTransformerID
ExploreMode
FieldColorMode
FieldMatcherID
FieldType
FrameMatcherID Field name matchers
GrafanaThemeType
LoadingState
LogLevel Mapping of log level abbreviation to canonical log level. Supported levels are reduce to limit color variation.
LogsDedupDescription
LogsDedupStrategy
LogsMetaKind
MappingType
MatcherID
NullValueMode
OrgRole
PluginIncludeType
PluginState
PluginType
ReducerID
ThresholdsMode
VariableOrigin
VariableSuggestionsScope
VizOrientation

Functions

Function Description
addLogLevelToSeries(series, lineIndex)
applyFieldOverrides(options) Return a copy of the DataFrame with all rules applied
arrowTableToDataFrame(table)
base64StringToArrowTable(text)
calculateFieldStats(rows, extractor)
calculateLogsLabelStats(rows, label)
calculateStats(values)
eventFactory(name)
findCommonLabels(labelsSets) Returns a map labels that are common to the given label sets.
findHighlightChunksInText({ searchWords, textToHighlight, }) Adapt findMatchesInText for react-highlight-words findChunks handler. See https://github.com/bvaughn/react-highlight-words#props
findMatchesInText(haystack, needle) Returns a list of substring regexp matches.
findUniqueLabels(labels, commonLabels) Returns a map of labels that are in labels, but not in commonLabels.
formatLabels(labels, defaultValue) Serializes the given labels to a string.
formattedValueToString(val)
getActiveThreshold(value, thresholds)
getDataFrameRow(data, row) Wrapper to get an array from each field value
getDecimalsForValue(value, decimalOverride)
getDisplayProcessor(options)
getDisplayValueAlignmentFactors(values)
getFieldMatcher(config)
getFlotPairs({ xField, yField, nullValueMode })
getFlotPairsConstant(seriesData, range) Returns a constant series based on the first value from the provide series.
getFrameMatchers(config)
getLogLevel(line) Returns the log level of a log line. Parse the line for level words. If no level is found, it returns LogLevel.unknown.Example: getLogLevel('WARN 1999-12-31 this is great') // LogLevel.warn
getLogLevelFromKey(key)
getParser(line)
getScaleCalculator(field, theme)
getValueFormat(id)
getValueFormats()
getValueFormatterIndex()
grafanaDataFrameToArrowTable(data)
guessFieldTypeForField(field) Looks at the data to guess the column type. This ignores any existing setting
guessFieldTypeFromValue(v) Given a value this will guess the best column typeTODO: better Date/Time support! Look for standard date strings?
locale(value, decimals)
parseFlags(text) Converts any mode modifiers in the text to the Javascript equivalent flag
parseLabels(labels) Returns a map of label keys to value from an input selector string.Example: parseLabels('{job="foo", instance="bar"}) // {job: "foo", instance: "bar"}
readCSV(csv, options)
reduceField(options)
renderMarkdown(str)
resultsToDataFrames(rsp)
reverseDataFrame(data) Returns a copy with all values reversed
scaledUnits(factor, extArray)
setMarkdownOptions(optionsOverride)
simpleCountUnit(symbol)
sortDataFrame(data, sortIndex, reverse)
sortThresholds(thresholds) Sorts the thresholds
stringStartsAsRegEx(str)
stringToJsRegex(str)
stringToMs(str)
toCSV(data, config)
toDataFrameDTO(data) Returns a copy that does not include functions
toFixed(value, decimals)
toFixedScaled(value, decimals, scaledDecimals, additionalDecimals, ext)
toFixedUnit(unit, asPrefix)
toFloatOrUndefined(value)
toIntegerOrUndefined(value)
toNumberString(value)
transformDataFrame(options, data) Apply configured transformations to the input data
updateDatasourcePluginOption(props, key, val)
updateDatasourcePluginResetOption(props, key)
validateFieldConfig(config) This checks that all options on FieldConfig make sense. It mutates any value that needs fixed. In particular this makes sure that the first threshold value is -Infinity (not valid in JSON)

Interfaces

Interface Description
AbsoluteTimeRange
AngularPanelMenuItem
AnnotationEvent
AnnotationQueryRequest Options passed to the datasource.annotationQuery method. See docs/plugins/developing/datasource.md
AppEvent
AppPluginMeta
AppRootProps
ArrowDataFrame
Column
ConfigOverrideRule
CreatePlotOverlay
CSVConfig
CSVOptions
CSVParseCallbacks
DataFrame
DataFrameDTO Like a DataFrame, but fields may be a FieldDTO
DataLink Link configuration. The values may contain variables that need to be processed before running
DataLinkClickEvent Callback info for DataLink click events
DataQuery
DataQueryError
DataQueryRequest
DataQueryResponse
DataSourceConstructor
DataSourceInstanceSettings Frontend settings model that is passed to Datasource constructor. This differs a bit from the model above as this data model is available to every user who has access to a data source (Viewers+). This is loaded in bootData (on page load), or from: /api/frontend/settings
DataSourceJsonData
DataSourcePluginComponents
DataSourcePluginMeta
DataSourcePluginOptionsEditorProps
DataSourceSelectItem
DataSourceSettings Data Source instance edit model. This is returned from: /api/datasources
DataTransformerConfig
DataTransformerInfo
DateTime
DateTimeBuiltinFormat
DateTimeDuration
DateTimeLocale
DecimalInfo
Dimension
DisplayValue
DisplayValueAlignmentFactors These represents the display value with the longest title and text. Used to align widths and heights when displaying multiple DisplayValues
DynamicConfigValue
ExploreQueryFieldProps
ExploreStartPageProps
Field
FieldCalcs
FieldColor
FieldConfig Every property is optionalPlugins may extend this with additional properties. Something like series overrides
FieldConfigEditorProps
FieldConfigSource
FieldDisplay
FieldDisplayOptions
FieldDTO Like a field, but properties are optional and values may be a simple array
FieldMatcherInfo
FieldOverrideContext
FieldOverrideEditorProps
FieldPropertyEditorItem
FieldReducerInfo
FieldWithIndex
FilterFieldsByNameTransformerOptions
FilterFramesByRefIdTransformerOptions
FlotDataPoint
FormattedValue
FrameMatcherInfo
GetFieldDisplayValuesOptions
GrafanaTheme
GrafanaThemeCommons
GraphSeriesXY View model projection of a series
HistoryItem
IntervalValues
Labels
LinkModel Processed Link Model. The values are ready to use
LinkModelSupplier Provides a way to produce links on demandTODO: ScopedVars in in GrafanaUI package!
LogLabelStatsModel
LogRowModel
LogSearchMatch
LogsMetaItem
LogsModel
LogsParser
MatcherConfig
MetadataInspectorProps
MetricFindValue
MutableVector Vector with standard manipulation functions
NavModel
NavModelBreadcrumb
NavModelItem
PanelData
PanelEditorProps
PanelMenuItem
PanelModel
PanelPluginMeta
PanelProps
PluginBuildInfo
PluginConfigPage
PluginConfigPageProps
PluginDependencies
PluginInclude
PluginMeta
PluginMetaInfo
QueryEditorProps
QueryFix
QueryFixAction
QueryHint
QueryResultBase
QueryResultMeta
RangeMap
RawTimeRange
ReadWriteVector Apache arrow vectors are Read/Write
ReduceTransformerOptions
RegistryItem
RegistryItemWithOptions
ScaledValue
ScopedVar
ScopedVars
ScreenshotInfo
SelectableValue Used in select elements
TableData
TextMatch
Threshold
ThresholdsConfig
TimeOption
TimeOptions
TimeRange
TimeSeries
UserOrgDTO
ValueFormat
ValueFormatCategory
ValueMap
VariableSuggestion
Vector
YAxis

Namespaces

Namespace Description
AppEvents
dateMath
PanelEvents
rangeUtil

Variables

Variable Description
createDimension
dateTime
dateTimeAsMoment
dateTimeForTimeZone
DEFAULT_DATE_TIME_FORMAT
DEFAULT_FIELD_DISPLAY_VALUES_LIMIT
DefaultTimeRange
DefaultTimeZone
deprecationWarning
escapeStringForRegex
fieldMatchers
fieldReducers
frameMatchers
getAllValuesFromDimension
getColorByName
getColorDefinition
getColorDefinitionByName
getColorForTheme
getColorFromHexRgbOrName
getColorName
getColumnFromDimension
getColumnsFromDimension
getDimensionByName
getFieldDisplayValues
getLocaleData
getMappedValue
getNamedColorPalette
getSeriesTimeStep Returns minimal time step from series time field
getTimeField
getTimeZoneGroups
getValueFromDimension
guessFieldTypes
hasMsResolution Checks if series time field has ms resolution
isDataFrame
isDateTime
ISO_8601
isTableData
LogsParsers
MISSING_VALUE
MS_DATE_TIME_FORMAT
objRemoveUndefined
onUpdateDatasourceJsonDataOption
onUpdateDatasourceJsonDataOptionSelect
onUpdateDatasourceOption
onUpdateDatasourceResetOption
onUpdateDatasourceSecureJsonDataOption
onUpdateDatasourceSecureJsonDataOptionSelect
setLocale
standardFieldConfigEditorRegistry
TIME_FORMAT
toDataFrame
toDuration
toLegacyResponseData
toUtc
transformersRegistry
unEscapeStringFromRegex
updateDatasourcePluginJsonDataOption
updateDatasourcePluginSecureJsonDataOption
VAR_CALC
VAR_CELL_PREFIX
VAR_FIELD_NAME
VAR_SERIES_NAME

Type Aliases

Type Alias Description
Color
ColorDefinition
DataQueryResponseData
DataSourceOptionsType
DataSourceQueryType
DataTransformer Immutable data transformation
DateTimeInput
DecimalCount
Dimensions
DisplayProcessor
DurationInput
DurationUnit
FieldConfigEditorRegistry
FieldMatcher
FormatInput
FrameMatcher
GraphSeriesValue
InterpolateFunction
KeyValue
LegacyResponseData Starting in v6.2 DataFrame can represent both TimeSeries and TableData
LinkTarget
MutableField
NavIndex
Omit
PanelMigrationHandler Called when a panel is first loaded with current panel model
PanelTypeChangedHandler Called before a panel is initialized
ScaleCalculator
Subtract
TimeFragment
TimeSeriesPoints
TimeSeriesValue
TimeZone
TimeZoneBrowser
TimeZoneUtc
ValueFormatter
ValueMapping