@grafana/data APIs
- SelectableValue
- DataQuery
- DataSourceJsonData
- PanelProps
- PanelPlugin
- DataFrame
- DataSourcePluginOptionsEditorProps
- DataSourceInstanceSettings
- FieldType
- DataSourcePlugin
- DataSourceApi
- MetricFindValue
- PanelEditorProps
- GrafanaTheme
- getDisplayProcessor
- DataQueryError
- DataQueryRequest
- DataQueryResponse
- MutableDataFrame
- ArrayVector
- LoadingState
- KeyValue
- AppPluginMeta
- PluginMeta
- AppPlugin
- NavModelItem
- ThresholdsMode
- DisplayValue
- formattedValueToString
- FieldConfig
- FieldColorMode
- GraphSeriesValue
- FieldDisplayOptions
- GraphSeriesXY
- TimeZone
- MS_DATE_TIME_FORMAT
- DEFAULT_DATE_TIME_FORMAT
- ReducerID
- AppEvents
- DataSourceSelectItem
- NullValueMode
- getFlotPairs
- getValueFormat
- AbsoluteTimeRange
- AnnotationEvent
- PanelData
- getTimeField
- reduceField
- getSeriesTimeStep
- hasMsResolution
- FieldColor
- MutableField
- AppRootProps
- GrafanaThemeType
- PanelPluginMeta
- ScopedVars
- PluginBuildInfo
- PluginState
- VizOrientation
- Field
- TimeSeriesValue
- FormattedValue
- DisplayValueAlignmentFactors
- getColorFromHexRgbOrName
- getColorDefinitionByName
- getNamedColorPalette
- getColorName
- getColorForTheme
- deprecationWarning
- DataLink
- VariableSuggestion
- VariableOrigin
- LinkModelSupplier
- DataSourceSettings
- applyFieldOverrides
- FieldConfigSource
- InterpolateFunction
- FieldMatcherID
- toDataFrame
- standardFieldConfigEditorRegistry
- FieldOverrideContext
- FieldConfigEditorProps
- FieldOverrideEditorProps
- ValueMapping
- toIntegerOrUndefined
- toFloatOrUndefined
- FieldPropertyEditorItem
- ThresholdsConfig
- getActiveThreshold
- Threshold
- dateTime
- TimeRange
- DefaultTimeZone
- createDimension
- DateTimeInput
- FlotDataPoint
- getValueFromDimension
- getColumnFromDimension
- FieldCache
- LogRowModel
- LogLevel
- calculateFieldStats
- calculateLogsLabelStats
- calculateStats
- getParser
- LinkModel
- Labels
- findHighlightChunksInText
- LogsDedupStrategy
- fieldMatchers
- Registry
- stringToMs
- DEFAULT_FIELD_DISPLAY_VALUES_LIMIT
- toNumberString
- VAR_SERIES_NAME
- VAR_FIELD_NAME
- VAR_CALC
- VAR_CELL_PREFIX
- fieldReducers
- sortThresholds
- MappingType
- PanelModel
- ConfigOverrideRule
- validateFieldConfig
- readCSV
- DateTime
- dateTimeAsMoment
- TimeFragment
- isDateTime
- rangeUtil
- TIME_FORMAT
- TimeOption
- dateMath
- dateTimeForTimeZone
- getTimeZoneGroups
- RawTimeRange
- FilterFieldsByNameTransformerOptions
- DataTransformerID
- transformersRegistry
- FilterFramesByRefIdTransformerOptions
- ReduceTransformerOptions
- DataTransformerConfig
- transformDataFrame
- getValueFormats
- GrafanaThemeCommons
- setLocale
- setMarkdownOptions
- escapeStringForRegex
- unEscapeStringFromRegex
- UserOrgDTO
- NavModel
- NavModelBreadcrumb
- renderMarkdown
- LogsMetaKind
- findCommonLabels
- findUniqueLabels
- getLogLevel
- getLogLevelFromKey
- LogsModel
- LogsMetaItem
- toUtc
- FieldWithIndex
- NavIndex
- PanelEvents
- OrgRole
- eventFactory
- TableData
- Column
- ValueFormatter
- stringToJsRegex
- DecimalCount
- AppEvent
- ExploreMode
- CoreApp
- HistoryItem
- IntervalValues
- toCSV
- DynamicConfigValue
- FieldConfigEditorRegistry
- VariableSuggestionsScope
- DefaultTimeRange
- toDataFrameDTO
- PanelMenuItem
- PluginType
- toLegacyResponseData
- DataQueryResponseData
- guessFieldTypes
- DataSourcePluginMeta
- DataSourceConstructor
- PluginInclude
- PluginMetaInfo
- toDuration
- LogsDedupDescription
- QueryFixAction
- TimeSeries
- LegacyResponseData
- AngularPanelMenuItem
- FieldDisplay
- DataFrameView
- GrafanaPlugin
- PluginDependencies
- PluginIncludeType
- onUpdateDatasourceJsonDataOptionSelect
- onUpdateDatasourceOption
- onUpdateDatasourceResetOption
- onUpdateDatasourceJsonDataOption
- onUpdateDatasourceSecureJsonDataOption
- updateDatasourcePluginOption
- updateDatasourcePluginResetOption
- updateDatasourcePluginJsonDataOption
- updateDatasourcePluginSecureJsonDataOption
- ExploreStartPageProps
- DataFrameDTO
- AnnotationQueryRequest
- LanguageProvider
- formatLabels
- parseLabels
- CircularDataFrame
- QueryHint
- isDataFrame
- QueryFix
- CSVReader
- DurationUnit
- getFieldDisplayValues
- getDisplayValueAlignmentFactors
- getFlotPairsConstant
- CreatePlotOverlay
- isTableData
- stringStartsAsRegEx
- base64StringToArrowTable
- arrowTableToDataFrame
- FieldConfigProperty
Other Related APIs
- react#forwardRef
- @grafana/data#GrafanaThemeType
- @grafana/data#ScopedVars
- @grafana/data#formattedValueToString
- @grafana/data#getColorFromHexRgbOrName
- @grafana/data#dateTime
- @grafana/data#unEscapeStringFromRegex
- @grafana/data#getValueFormat
- @grafana/data#stringToJsRegex
- @grafana/data#stringStartsAsRegEx
@grafana/data#escapeStringForRegex TypeScript Examples
The following examples show how to use
@grafana/data#escapeStringForRegex.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FilterInput.tsx From grafana-chinese with Apache License 2.0 | 6 votes |
FilterInput = forwardRef<HTMLInputElement, Props>((props, ref) => (
<label className={props.labelClassName}>
<input
ref={ref}
type="text"
className={props.inputClassName}
value={unEscapeStringFromRegex(props.value)}
onChange={event => props.onChange(escapeStringForRegex(event.target.value))}
placeholder={props.placeholder ? props.placeholder : null}
/>
<i className="gf-form-input-icon fa fa-search" />
</label>
))
Example #2
Source File: renderer.ts From grafana-chinese with Apache License 2.0 | 6 votes |
initColumns() {
this.formatters = [];
this.colorState = {};
for (let colIndex = 0; colIndex < this.table.columns.length; colIndex++) {
const column = this.table.columns[colIndex];
column.title = column.text;
for (let i = 0; i < this.panel.styles.length; i++) {
const style = this.panel.styles[i];
const escapedPattern = stringStartsAsRegEx(style.pattern)
? style.pattern
: escapeStringForRegex(unEscapeStringFromRegex(style.pattern));
const regex = stringToJsRegex(escapedPattern);
if (column.text.match(regex)) {
column.style = style;
if (style.alias) {
column.title = escapeHtml(column.text.replace(regex, style.alias));
}
break;
}
}
this.formatters[colIndex] = this.createColumnFormatter(column);
}
}
Example #3
Source File: TagFilter.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
render() {
const tags = this.props.tags.map(tag => ({ value: tag, label: tag, count: 0 }));
const selectOptions = {
classNamePrefix: 'gf-form-select-box',
isMulti: true,
defaultOptions: true,
loadOptions: this.onLoadOptions,
onChange: this.onChange,
className: 'gf-form-input gf-form-input--form-dropdown',
placeholder: 'Tags',
loadingMessage: () => 'Loading...',
noOptionsMessage: () => 'No tags found',
getOptionValue: (i: any) => i.value,
getOptionLabel: (i: any) => i.label,
value: tags,
styles: resetSelectStyles(),
filterOption: (option: any, searchQuery: string) => {
const regex = RegExp(escapeStringForRegex(searchQuery), 'i');
return regex.test(option.value);
},
components: {
Option: TagOption,
IndicatorsContainer,
NoOptionsMessage,
MultiValueLabel: (): any => {
return null; // We want the whole tag to be clickable so we use MultiValueRemove instead
},
MultiValueRemove: (props: any) => {
const { data } = props;
return (
<components.MultiValueRemove {...props}>
<TagBadge key={data.label} label={data.label} removeIcon={true} count={data.count} />
</components.MultiValueRemove>
);
},
},
};
return (
<div className="gf-form gf-form--has-input-icon gf-form--grow">
<div className="tag-filter">
<AsyncSelect {...selectOptions} />
</div>
<i className="gf-form-input-icon fa fa-tag" />
</div>
);
}