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EAAQzF,aAAetzB,KAAKq5B,WAAW1G,UAAUoG,EAAQliB,GAAIsb,EAAQ,CAAE7Y,KAAMyf,EAAQ3H,KAAK9X,QA+E9F,IAAIqf,EAAgB,G,8TC/NpB,MAAM2C,EAAiC,CACrCC,UAAUl9B,GACDA,GAASA,aAAiBm9B,EAAAA,GAGnClF,UAAUj4B,GACR,MAAMo9B,EAAMC,EAAAA,GAAcr9B,IAEpB,MAAEs9B,EAAF,MAASC,GAAU,IAAIC,eAI7B,OAFAH,EAAAA,GAAeD,EAAKE,GAEb,CAACC,EAAO,CAACA,KAGlBE,YAAYz9B,IACVA,EAAM09B,QAECL,EAAAA,GAA0Br9B,KAGrCq9B,EAAAA,GAAAA,IAA6B,oBAAqBJ,I,iECvB3C,SAASU,EAAmBC,EAAsBC,GAEvD,OAAOD,EAAa31B,QADD,wBACqB,CAAC61B,EAAGC,IAAQF,EAAUE,GAAMF,EAAUE,GAAMA,I","sources":["webpack://grafana/./packages/grafana-data/src/datetime/parser.ts","webpack://grafana/./packages/grafana-data/src/events/eventFactory.ts","webpack://grafana/./packages/grafana-data/src/events/types.ts","webpack://grafana/./packages/grafana-data/src/field/FieldConfigOptionsRegistry.tsx","webpack://grafana/./packages/grafana-data/src/field/fieldComparers.ts","webpack://grafana/./packages/grafana-data/src/field/fieldState.ts","webpack://grafana/./packages/grafana-data/src/text/sanitize.ts","webpack://grafana/./packages/grafana-data/src/themes/createComponents.ts","webpack://grafana/./packages/grafana-data/src/themes/createV1Theme.ts","webpack://grafana/./packages/grafana-data/src/themes/createTheme.ts","webpack://grafana/./packages/grafana-data/src/themes/palette.ts","webpack://grafana/./packages/grafana-data/src/transformations/fieldReducer.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/fieldTypeMatcher.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/ids.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/predicates.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/refIdMatcher.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/simpleFieldMatcher.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/equalMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/nullMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/numericMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/rangeMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/matchers/valueMatchers/regexMatchers.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/ensureColumns.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/filter.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/filterByName.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/filterByRefId.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/ids.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/joinDataFrames.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/merge.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/noop.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/organize.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/rename.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/seriesToColumns.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/seriesToRows.ts","webpack://grafana/./packages/grafana-data/src/transformations/transformers/sortBy.ts","webpack://grafana/./packages/grafana-data/src/types/data.ts","webpack://grafana/./packages/grafana-data/src/types/dataFrame.ts","webpack://grafana/./packages/grafana-data/src/types/fieldColor.ts","webpack://grafana/./packages/grafana-data/src/types/theme.ts","webpack://grafana/./packages/grafana-data/src/types/thresholds.ts","webpack://grafana/./packages/grafana-data/src/types/valueMapping.ts","webpack://grafana/./packages/grafana-data/src/utils/Registry.ts","webpack://grafana/./packages/grafana-data/src/utils/anyToNumber.ts","webpack://grafana/./packages/grafana-data/src/utils/binaryOperators.ts","webpack://grafana/./packages/grafana-data/src/utils/fieldParser.ts","webpack://grafana/./packages/grafana-data/src/utils/makeClassES5Compatible.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/arithmeticFormatters.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/categories.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/dateTimeFormatters.ts","webpack://grafana/./packages/grafana-data/src/valueFormats/symbolFormatters.ts","webpack://grafana/./packages/grafana-data/src/vector/ArrayVector.ts","webpack://grafana/./packages/grafana-data/src/vector/AsNumberVector.ts","webpack://grafana/./packages/grafana-data/src/vector/BinaryOperationVector.ts","webpack://grafana/./packages/grafana-data/src/vector/ConstantVector.ts","webpack://grafana/./packages/grafana-data/src/vector/RowVector.ts","webpack://grafana/./packages/grafana-data/src/vector/SortedVector.ts","webpack://grafana/./packages/grafana-data/src/vector/vectorToArray.ts","webpack://grafana/./packages/grafana-runtime/src/utils/toDataQueryError.ts","webpack://grafana/./public/app/features/live/centrifuge/channel.ts","webpack://grafana/./public/app/features/live/centrifuge/LiveDataStream.ts","webpack://grafana/./public/app/features/live/centrifuge/service.ts","webpack://grafana/./public/app/features/live/centrifuge/transferHandlers.ts","webpack://grafana/./public/app/plugins/datasource/prometheus/legend.ts"],"sourcesContent":["/* eslint-disable id-blacklist, no-restricted-imports, @typescript-eslint/ban-types */\nimport moment, { MomentInput } from 'moment-timezone';\nimport { DateTimeInput, DateTime, isDateTime } from './moment_wrapper';\nimport { DateTimeOptions, getTimeZone } from './common';\nimport { parse, isValid } from './datemath';\nimport { lowerCase } from 'lodash';\nimport { systemDateFormats } from './formats';\n\n/**\n * The type that describes options that can be passed when parsing a date and time value.\n * @public\n */\nexport interface DateTimeOptionsWhenParsing extends DateTimeOptions {\n /**\n * If the input is a Grafana quick date, e.g. now-6h, then you can specify this to control\n * whether the last part of the date and time value is included or excluded.\n *\n * Example: now-6h and the current time is 12:20:00 if roundUp is set to true\n * the returned DateTime value will be 06:00:00.\n */\n roundUp?: boolean;\n fiscalYearStartMonth?: number;\n}\n\ntype DateTimeParser = (value: DateTimeInput, options?: T) => DateTime;\n\n/**\n * Helper function to parse a number, text or Date to a DateTime value. If a timeZone is supplied the incoming value\n * is parsed with that timeZone as a base. The only exception to this is if the passed value is in a UTC-based\n * format. Then it will use UTC as the base. If no format is specified the current system format will be assumed.\n *\n * It can also parse the Grafana quick date and time format, e.g. now-6h will be parsed as Date.now() - 6 hours and\n * returned as a valid DateTime value.\n *\n * If no options are supplied, then default values are used. For more details please see {@link DateTimeOptions}.\n *\n * @param value - should be a parsable date and time value\n * @param options\n *\n * @public\n */\nexport const dateTimeParse: DateTimeParser = (value, options?): DateTime => {\n if (isDateTime(value)) {\n return value;\n }\n\n if (typeof value === 'string') {\n return parseString(value, options);\n }\n\n return parseOthers(value, options);\n};\n\nconst parseString = (value: string, options?: DateTimeOptionsWhenParsing): DateTime => {\n if (value.indexOf('now') !== -1) {\n if (!isValid(value)) {\n return moment() as DateTime;\n }\n\n const parsed = parse(value, options?.roundUp, options?.timeZone, options?.fiscalYearStartMonth);\n return parsed || (moment() as DateTime);\n }\n\n const timeZone = getTimeZone(options);\n const zone = moment.tz.zone(timeZone);\n const format = options?.format ?? systemDateFormats.fullDate;\n\n if (zone && zone.name) {\n return moment.tz(value, format, zone.name) as DateTime;\n }\n\n switch (lowerCase(timeZone)) {\n case 'utc':\n return moment.utc(value, format) as DateTime;\n default:\n return moment(value, format) as DateTime;\n }\n};\n\nconst parseOthers = (value: DateTimeInput, options?: DateTimeOptionsWhenParsing): DateTime => {\n const date = value as MomentInput;\n const timeZone = getTimeZone(options);\n const zone = moment.tz.zone(timeZone);\n\n if (zone && zone.name) {\n return moment.tz(date, zone.name) as DateTime;\n }\n\n switch (lowerCase(timeZone)) {\n case 'utc':\n return moment.utc(date) as DateTime;\n default:\n return moment(date) as DateTime;\n }\n};\n","import { AppEvent } from './types';\n\nconst typeList: Set = new Set();\n\nexport function eventFactory(name: string): AppEvent {\n if (typeList.has(name)) {\n throw new Error(`There is already an event defined with type '${name}'`);\n }\n\n typeList.add(name);\n return { name };\n}\n","import { Unsubscribable, Observable } from 'rxjs';\n\n/**\n * @alpha\n * internal interface\n */\nexport interface BusEvent {\n readonly type: string;\n readonly payload?: any;\n readonly origin?: EventBus;\n}\n\n/**\n * @alpha\n * Base event type\n */\nexport abstract class BusEventBase implements BusEvent {\n readonly type: string;\n readonly payload?: any;\n readonly origin?: EventBus;\n\n constructor() {\n //@ts-ignore\n this.type = this.__proto__.constructor.type;\n }\n}\n\n/**\n * @alpha\n * Base event type with payload\n */\nexport abstract class BusEventWithPayload extends BusEventBase {\n readonly payload: T;\n\n constructor(payload: T) {\n super();\n this.payload = payload;\n }\n}\n\n/*\n * Interface for an event type constructor\n */\nexport interface BusEventType {\n type: string;\n new (...args: any[]): T;\n}\n\n/**\n * @alpha\n * Event callback/handler type\n */\nexport interface BusEventHandler {\n (event: T): void;\n}\n\n/**\n * @alpha\n * Main minimal interface\n */\nexport interface EventFilterOptions {\n onlyLocal: boolean;\n}\n\n/**\n * @alpha\n * Main minimal interface\n */\nexport interface EventBus {\n /**\n * Publish single vent\n */\n publish(event: T): void;\n\n /**\n * Get observable of events\n */\n getStream(eventType: BusEventType): Observable;\n\n /**\n * Subscribe to an event stream\n *\n * This function is a wrapper around the `getStream(...)` function\n */\n subscribe(eventType: BusEventType, handler: BusEventHandler): Unsubscribable;\n\n /**\n * Remove all event subscriptions\n */\n removeAllListeners(): void;\n\n /**\n * Returns a new bus scoped that knows where it exists in a heiarchy\n *\n * @internal -- This is included for internal use only should not be used directly\n */\n newScopedBus(key: string, filter: EventFilterOptions): EventBus;\n}\n\n/**\n * @public\n * @deprecated event type\n */\nexport interface AppEvent {\n readonly name: string;\n payload?: T;\n}\n\n/** @public */\nexport interface LegacyEmitter {\n /**\n * @deprecated use $emit\n */\n emit(event: AppEvent | string, payload?: T): void;\n\n /**\n * @deprecated use $on\n */\n on(event: AppEvent | string, handler: LegacyEventHandler, scope?: any): void;\n\n /**\n * @deprecated use $on\n */\n off(event: AppEvent | string, handler: (payload?: T | any) => void): void;\n}\n\n/** @public */\nexport interface LegacyEventHandler {\n (payload: T): void;\n wrapper?: (event: BusEvent) => void;\n}\n\n/** @alpha */\nexport interface EventBusExtended extends EventBus, LegacyEmitter {}\n","import { Registry } from '../utils/Registry';\nimport { FieldConfigPropertyItem } from '../types/fieldOverrides';\n\nexport class FieldConfigOptionsRegistry extends Registry {}\n","import { Field, FieldType } from '../types/dataFrame';\nimport { Vector } from '../types/vector';\nimport { dateTime } from '../datetime';\nimport { isNumber } from 'lodash';\n\ntype IndexComparer = (a: number, b: number) => number;\n\n/** @public */\nexport const fieldIndexComparer = (field: Field, reverse = false): IndexComparer => {\n const values = field.values;\n\n switch (field.type) {\n case FieldType.number:\n return numericIndexComparer(values, reverse);\n case FieldType.string:\n return stringIndexComparer(values, reverse);\n case FieldType.boolean:\n return booleanIndexComparer(values, reverse);\n case FieldType.time:\n return timeIndexComparer(values, reverse);\n default:\n return naturalIndexComparer(reverse);\n }\n};\n\n/** @public */\nexport const timeComparer = (a: any, b: any): number => {\n if (!a || !b) {\n return falsyComparer(a, b);\n }\n\n if (isNumber(a) && isNumber(b)) {\n return numericComparer(a, b);\n }\n\n if (dateTime(a).isBefore(b)) {\n return -1;\n }\n\n if (dateTime(b).isBefore(a)) {\n return 1;\n }\n\n return 0;\n};\n\n/** @public */\nexport const numericComparer = (a: number, b: number): number => {\n return a - b;\n};\n\n/** @public */\nexport const stringComparer = (a: string, b: string): number => {\n if (!a || !b) {\n return falsyComparer(a, b);\n }\n return a.localeCompare(b);\n};\n\nexport const booleanComparer = (a: boolean, b: boolean): number => {\n return falsyComparer(a, b);\n};\n\nconst falsyComparer = (a: any, b: any): number => {\n if (!a && b) {\n return 1;\n }\n\n if (a && !b) {\n return -1;\n }\n\n return 0;\n};\n\nconst timeIndexComparer = (values: Vector, reverse: boolean): IndexComparer => {\n return (a: number, b: number): number => {\n const vA = values.get(a);\n const vB = values.get(b);\n return reverse ? timeComparer(vB, vA) : timeComparer(vA, vB);\n };\n};\n\nconst booleanIndexComparer = (values: Vector, reverse: boolean): IndexComparer => {\n return (a: number, b: number): number => {\n const vA: boolean = values.get(a);\n const vB: boolean = values.get(b);\n return reverse ? booleanComparer(vB, vA) : booleanComparer(vA, vB);\n };\n};\n\nconst numericIndexComparer = (values: Vector, reverse: boolean): IndexComparer => {\n return (a: number, b: number): number => {\n const vA: number = values.get(a);\n const vB: number = values.get(b);\n return reverse ? numericComparer(vB, vA) : numericComparer(vA, vB);\n };\n};\n\nconst stringIndexComparer = (values: Vector, reverse: boolean): IndexComparer => {\n return (a: number, b: number): number => {\n const vA: string = values.get(a);\n const vB: string = values.get(b);\n return reverse ? stringComparer(vB, vA) : stringComparer(vA, vB);\n };\n};\n\nconst naturalIndexComparer = (reverse: boolean): IndexComparer => {\n return (a: number, b: number): number => {\n return reverse ? numericComparer(b, a) : numericComparer(a, b);\n };\n};\n","import { DataFrame, Field, TIME_SERIES_VALUE_FIELD_NAME, FieldType, TIME_SERIES_TIME_FIELD_NAME } from '../types';\nimport { formatLabels } from '../utils/labels';\n\n/**\n * Get an appropriate display title\n */\nexport function getFrameDisplayName(frame: DataFrame, index?: number) {\n if (frame.name) {\n return frame.name;\n }\n\n // Single field with tags\n const valuesWithLabels: Field[] = [];\n for (const field of frame.fields) {\n if (field.labels && Object.keys(field.labels).length > 0) {\n valuesWithLabels.push(field);\n }\n }\n\n if (valuesWithLabels.length === 1) {\n return formatLabels(valuesWithLabels[0].labels!);\n }\n\n // list all the\n if (index === undefined) {\n return frame.fields\n .filter((f) => f.type !== FieldType.time)\n .map((f) => getFieldDisplayName(f, frame))\n .join(', ');\n }\n\n if (frame.refId) {\n return `Series (${frame.refId})`;\n }\n\n return `Series (${index})`;\n}\n\nexport function getFieldDisplayName(field: Field, frame?: DataFrame, allFrames?: DataFrame[]): string {\n const existingTitle = field.state?.displayName;\n\n if (existingTitle) {\n return existingTitle;\n }\n\n const displayName = calculateFieldDisplayName(field, frame, allFrames);\n field.state = field.state || {};\n field.state.displayName = displayName;\n\n return displayName;\n}\n\n/**\n * Get an appropriate display name. If the 'displayName' field config is set, use that.\n */\nfunction calculateFieldDisplayName(field: Field, frame?: DataFrame, allFrames?: DataFrame[]): string {\n const hasConfigTitle = field.config?.displayName && field.config?.displayName.length;\n\n let displayName = hasConfigTitle ? field.config!.displayName! : field.name;\n\n if (hasConfigTitle) {\n return displayName;\n }\n\n if (frame && field.config?.displayNameFromDS) {\n return field.config.displayNameFromDS;\n }\n\n // This is an ugly exception for time field\n // For time series we should normally treat time field with same name\n // But in case it has a join source we should handle it as normal field\n if (field.type === FieldType.time && !field.labels) {\n return displayName ?? TIME_SERIES_TIME_FIELD_NAME;\n }\n\n let parts: string[] = [];\n let frameNamesDiffer = false;\n\n if (allFrames && allFrames.length > 1) {\n for (let i = 1; i < allFrames.length; i++) {\n const frame = allFrames[i];\n if (frame.name !== allFrames[i - 1].name) {\n frameNamesDiffer = true;\n break;\n }\n }\n }\n\n let frameNameAdded = false;\n let labelsAdded = false;\n\n if (frameNamesDiffer && frame?.name) {\n parts.push(frame.name);\n frameNameAdded = true;\n }\n\n if (field.name && field.name !== TIME_SERIES_VALUE_FIELD_NAME) {\n parts.push(field.name);\n }\n\n if (field.labels && frame) {\n let singleLabelName = getSingleLabelName(allFrames ?? [frame]);\n\n if (!singleLabelName) {\n let allLabels = formatLabels(field.labels);\n if (allLabels) {\n parts.push(allLabels);\n labelsAdded = true;\n }\n } else if (field.labels[singleLabelName]) {\n parts.push(field.labels[singleLabelName]);\n labelsAdded = true;\n }\n }\n\n // if we have not added frame name and no labels, and field name = Value, we should add frame name\n if (frame && !frameNameAdded && !labelsAdded && field.name === TIME_SERIES_VALUE_FIELD_NAME) {\n if (frame.name && frame.name.length > 0) {\n parts.push(frame.name);\n frameNameAdded = true;\n }\n }\n\n if (parts.length) {\n displayName = parts.join(' ');\n } else if (field.name) {\n displayName = field.name;\n } else {\n displayName = TIME_SERIES_VALUE_FIELD_NAME;\n }\n\n // Ensure unique field name\n if (displayName === field.name) {\n displayName = getUniqueFieldName(field, frame);\n }\n\n return displayName;\n}\n\nfunction getUniqueFieldName(field: Field, frame?: DataFrame) {\n let dupeCount = 0;\n let foundSelf = false;\n\n if (frame) {\n for (let i = 0; i < frame.fields.length; i++) {\n const otherField = frame.fields[i];\n\n if (field === otherField) {\n foundSelf = true;\n\n if (dupeCount > 0) {\n dupeCount++;\n break;\n }\n } else if (field.name === otherField.name) {\n dupeCount++;\n\n if (foundSelf) {\n break;\n }\n }\n }\n }\n\n if (dupeCount) {\n return `${field.name} ${dupeCount}`;\n }\n\n return field.name;\n}\n\n/**\n * Checks all data frames and return name of label if there is only one label name in all frames\n */\nfunction getSingleLabelName(frames: DataFrame[]): string | null {\n let singleName: string | null = null;\n\n for (let i = 0; i < frames.length; i++) {\n const frame = frames[i];\n\n for (const field of frame.fields) {\n if (!field.labels) {\n continue;\n }\n\n // yes this should be in!\n for (const labelKey in field.labels) {\n if (singleName === null) {\n singleName = labelKey;\n } else if (labelKey !== singleName) {\n return null;\n }\n }\n }\n }\n\n return singleName;\n}\n","import * as xss from 'xss';\nimport { sanitizeUrl as braintreeSanitizeUrl } from '@braintree/sanitize-url';\n\nconst XSSWL = Object.keys(xss.whiteList).reduce((acc, element) => {\n acc[element] = xss.whiteList[element]?.concat(['class', 'style']);\n return acc;\n}, {} as xss.IWhiteList);\n\nconst sanitizeXSS = new xss.FilterXSS({\n whiteList: XSSWL,\n});\n\nconst sanitizeTextPanelWhitelist = new xss.FilterXSS({\n whiteList: XSSWL,\n css: {\n whiteList: {\n ...xss.getDefaultCSSWhiteList(),\n 'flex-direction': true,\n 'flex-wrap': true,\n 'flex-basis': true,\n 'flex-grow': true,\n 'flex-shrink': true,\n 'flex-flow': true,\n gap: true,\n order: true,\n 'justify-content': true,\n 'justify-items': true,\n 'justify-self': true,\n 'align-items': true,\n 'align-content': true,\n 'align-self': true,\n },\n },\n});\n\n/**\n * Returns string safe from XSS attacks.\n *\n * Even though we allow the style-attribute, there's still default filtering applied to it\n * Info: https://github.com/leizongmin/js-xss#customize-css-filter\n * Whitelist: https://github.com/leizongmin/js-css-filter/blob/master/lib/default.js\n */\nexport function sanitize(unsanitizedString: string): string {\n try {\n return sanitizeXSS.process(unsanitizedString);\n } catch (error) {\n console.error('String could not be sanitized', unsanitizedString);\n return unsanitizedString;\n }\n}\n\nexport function sanitizeTextPanelContent(unsanitizedString: string): string {\n try {\n return sanitizeTextPanelWhitelist.process(unsanitizedString);\n } catch (error) {\n console.error('String could not be sanitized', unsanitizedString);\n return 'Text string could not be sanitized';\n }\n}\n\nexport function sanitizeUrl(url: string): string {\n return braintreeSanitizeUrl(url);\n}\n\nexport function hasAnsiCodes(input: string): boolean {\n return /\\u001b\\[\\d{1,2}m/.test(input);\n}\n\nexport function escapeHtml(str: string): string {\n return String(str).replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"');\n}\n","import { ThemeColors } from './createColors';\nimport { ThemeShadows } from './createShadows';\n\n/** @beta */\nexport interface ThemeComponents {\n /** Applies to normal buttons, inputs, radio buttons, etc */\n height: {\n sm: number;\n md: number;\n lg: number;\n };\n input: {\n background: string;\n borderColor: string;\n borderHover: string;\n text: string;\n };\n tooltip: {\n text: string;\n background: string;\n };\n panel: {\n padding: number;\n headerHeight: number;\n borderColor: string;\n boxShadow: string;\n background: string;\n };\n dropdown: {\n background: string;\n };\n overlay: {\n background: string;\n };\n dashboard: {\n background: string;\n padding: number;\n };\n sidemenu: {\n width: number;\n };\n}\n\nexport function createComponents(colors: ThemeColors, shadows: ThemeShadows): ThemeComponents {\n const panel = {\n padding: 1,\n headerHeight: 4,\n background: colors.background.primary,\n borderColor: colors.border.weak,\n boxShadow: 'none',\n };\n\n const input = {\n borderColor: colors.border.medium,\n borderHover: colors.border.strong,\n text: colors.text.primary,\n background: colors.mode === 'dark' ? colors.background.canvas : colors.background.primary,\n };\n\n return {\n height: {\n sm: 3,\n md: 4,\n lg: 6,\n },\n input,\n panel,\n dropdown: {\n background: input.background,\n },\n tooltip: {\n background: colors.mode === 'light' ? '#555' : colors.background.secondary,\n text: colors.mode === 'light' ? '#FFF' : colors.text.primary,\n },\n dashboard: {\n background: colors.background.canvas,\n padding: 1,\n },\n overlay: {\n background: colors.mode === 'dark' ? 'rgba(0, 0, 0, 0.45)' : 'rgba(208, 209, 211, 0.24)',\n },\n sidemenu: {\n width: 48,\n },\n };\n}\n","import { GrafanaTheme, GrafanaThemeCommons, GrafanaThemeType } from '../types';\nimport { GrafanaTheme2 } from './types';\n\nexport function createV1Theme(theme: Omit): GrafanaTheme {\n const oldCommon: GrafanaThemeCommons = {\n name: 'Grafana Default',\n typography: {\n fontFamily: {\n sansSerif: theme.typography.fontFamily,\n monospace: theme.typography.fontFamilyMonospace,\n },\n size: {\n base: `${theme.typography.fontSize}px`,\n xs: theme.typography.size.xs,\n sm: theme.typography.size.sm,\n md: theme.typography.size.md,\n lg: theme.typography.size.lg,\n },\n heading: {\n h1: theme.typography.h1.fontSize,\n h2: theme.typography.h2.fontSize,\n h3: theme.typography.h3.fontSize,\n h4: theme.typography.h4.fontSize,\n h5: theme.typography.h5.fontSize,\n h6: theme.typography.h6.fontSize,\n },\n weight: {\n light: theme.typography.fontWeightLight,\n regular: theme.typography.fontWeightRegular,\n semibold: theme.typography.fontWeightMedium,\n bold: theme.typography.fontWeightBold,\n },\n lineHeight: {\n xs: theme.typography.bodySmall.lineHeight,\n sm: theme.typography.bodySmall.lineHeight,\n md: theme.typography.body.lineHeight,\n lg: theme.typography.h2.lineHeight,\n },\n link: {\n decoration: 'none',\n hoverDecoration: 'none',\n },\n },\n breakpoints: {\n xs: `${theme.breakpoints.values.xs}px`,\n sm: `${theme.breakpoints.values.sm}px`,\n md: `${theme.breakpoints.values.md}px`,\n lg: `${theme.breakpoints.values.lg}px`,\n xl: `${theme.breakpoints.values.xl}px`,\n xxl: `${theme.breakpoints.values.xxl}px`,\n },\n spacing: {\n base: theme.spacing.gridSize,\n insetSquishMd: theme.spacing(0.5, 1),\n d: theme.spacing(2),\n xxs: theme.spacing(0.25),\n xs: theme.spacing(0.5),\n sm: theme.spacing(1),\n md: theme.spacing(2),\n lg: theme.spacing(3),\n xl: theme.spacing(4),\n gutter: theme.spacing(4),\n\n // Next-gen forms spacing variables\n // TODO: Move variables definition to respective components when implementing\n formSpacingBase: theme.spacing.gridSize,\n formMargin: `${theme.spacing.gridSize * 4}px`,\n formFieldsetMargin: `${theme.spacing.gridSize * 2}px`,\n formInputHeight: theme.spacing.gridSize * 4,\n formButtonHeight: theme.spacing.gridSize * 4,\n formInputPaddingHorizontal: `${theme.spacing.gridSize}px`,\n\n // Used for icons do define spacing between icon and input field\n // Applied on the right(prefix) or left(suffix)\n formInputAffixPaddingHorizontal: `${theme.spacing.gridSize / 2}px`,\n\n formInputMargin: `${theme.spacing.gridSize * 2}px`,\n formLabelPadding: '0 0 0 2px',\n formLabelMargin: `0 0 ${theme.spacing.gridSize / 2 + 'px'} 0`,\n formValidationMessagePadding: '4px 8px',\n formValidationMessageMargin: '4px 0 0 0',\n inlineFormMargin: '4px',\n },\n border: {\n radius: {\n sm: theme.shape.borderRadius(1),\n md: theme.shape.borderRadius(2),\n lg: theme.shape.borderRadius(3),\n },\n width: {\n sm: '1px',\n },\n },\n height: {\n sm: theme.spacing.gridSize * theme.components.height.sm,\n md: theme.spacing.gridSize * theme.components.height.md,\n lg: theme.spacing.gridSize * theme.components.height.lg,\n },\n panelPadding: theme.components.panel.padding * theme.spacing.gridSize,\n panelHeaderHeight: theme.spacing.gridSize * theme.components.panel.headerHeight,\n zIndex: theme.zIndex,\n };\n\n const basicColors = {\n ...commonColorsPalette,\n black: '#000000',\n white: '#ffffff',\n dark1: '#141414',\n dark2: '#161719',\n dark3: '#1f1f20',\n dark4: '#212124',\n dark5: '#222426',\n dark6: '#262628',\n dark7: '#292a2d',\n dark8: '#2f2f32',\n dark9: '#343436',\n dark10: '#424345',\n gray1: '#555555',\n gray2: '#8e8e8e',\n gray3: '#b3b3b3',\n gray4: '#d8d9da',\n gray5: '#ececec',\n gray6: '#f4f5f8', // not used in dark theme\n gray7: '#fbfbfb', // not used in dark theme\n redBase: '#e02f44',\n redShade: '#c4162a',\n greenBase: '#299c46',\n greenShade: '#23843b',\n red: '#d44a3a',\n yellow: '#ecbb13',\n purple: '#9933cc',\n variable: '#32d1df',\n orange: '#eb7b18',\n orangeDark: '#ff780a',\n };\n\n const backgrounds = {\n bg1: theme.colors.background.primary,\n bg2: theme.colors.background.secondary,\n bg3: theme.colors.action.hover,\n dashboardBg: theme.colors.background.canvas,\n bgBlue1: theme.colors.primary.main,\n bgBlue2: theme.colors.primary.shade,\n };\n\n const borders = {\n border1: theme.colors.border.weak,\n border2: theme.colors.border.medium,\n border3: theme.colors.border.strong,\n };\n\n const textColors = {\n textStrong: theme.colors.text.maxContrast,\n textHeading: theme.colors.text.primary,\n text: theme.colors.text.primary,\n textSemiWeak: theme.colors.text.secondary,\n textWeak: theme.colors.text.secondary,\n textFaint: theme.colors.text.disabled,\n textBlue: theme.colors.primary.text,\n };\n\n const form = {\n // Next-gen forms functional colors\n formLabel: theme.colors.text.primary,\n formDescription: theme.colors.text.secondary,\n formInputBg: theme.components.input.background,\n formInputBgDisabled: theme.colors.action.disabledBackground,\n formInputBorder: theme.components.input.borderColor,\n formInputBorderHover: theme.components.input.borderHover,\n formInputBorderActive: theme.colors.primary.border,\n formInputBorderInvalid: theme.colors.error.border,\n formInputPlaceholderText: theme.colors.text.disabled,\n formInputText: theme.components.input.text,\n formInputDisabledText: theme.colors.action.disabledText,\n formFocusOutline: theme.colors.primary.main,\n formValidationMessageText: theme.colors.error.contrastText,\n formValidationMessageBg: theme.colors.error.main,\n };\n\n return {\n ...oldCommon,\n type: theme.colors.mode === 'dark' ? GrafanaThemeType.Dark : GrafanaThemeType.Light,\n isDark: theme.isDark,\n isLight: theme.isLight,\n name: theme.name,\n palette: {\n ...basicColors,\n brandPrimary: basicColors.orange,\n brandSuccess: theme.colors.success.main,\n brandWarning: theme.colors.warning.main,\n brandDanger: theme.colors.error.main,\n queryRed: theme.colors.error.text,\n queryGreen: theme.colors.success.text,\n queryPurple: '#fe85fc',\n queryOrange: basicColors.orange,\n online: theme.colors.success.main,\n warn: theme.colors.success.main,\n critical: theme.colors.success.main,\n },\n colors: {\n ...backgrounds,\n ...borders,\n ...form,\n ...textColors,\n\n bodyBg: theme.colors.background.canvas,\n panelBg: theme.components.panel.background,\n panelBorder: theme.components.panel.borderColor,\n pageHeaderBg: theme.colors.background.canvas,\n pageHeaderBorder: theme.colors.background.canvas,\n\n dropdownBg: form.formInputBg,\n dropdownShadow: basicColors.black,\n dropdownOptionHoverBg: backgrounds.bg2,\n\n link: theme.colors.text.primary,\n linkDisabled: theme.colors.text.disabled,\n linkHover: theme.colors.text.maxContrast,\n linkExternal: theme.colors.text.link,\n },\n shadows: {\n listItem: 'none',\n },\n visualization: theme.visualization,\n };\n}\n\nconst commonColorsPalette = {\n // New greys palette used by next-gen form elements\n gray98: '#f7f8fa',\n gray97: '#f1f5f9',\n gray95: '#e9edf2',\n gray90: '#dce1e6',\n gray85: '#c7d0d9',\n gray70: '#9fa7b3',\n gray60: '#7b8087',\n gray33: '#464c54',\n gray25: '#2c3235',\n gray15: '#202226',\n gray10: '#141619',\n gray05: '#0b0c0e',\n\n // New blues palette used by next-gen form elements\n blue95: '#5794f2', // blue95\n blue85: '#33a2e5', // blueText\n blue80: '#3274d9', // blue80\n blue77: '#1f60c4', // blue77\n\n // New reds palette used by next-gen form elements\n red88: '#e02f44',\n};\n","import { createBreakpoints } from './breakpoints';\nimport { createComponents } from './createComponents';\nimport { createColors, ThemeColorsInput } from './createColors';\nimport { createShadows } from './createShadows';\nimport { createShape, ThemeShapeInput } from './createShape';\nimport { createSpacing, ThemeSpacingOptions } from './createSpacing';\nimport { createTransitions } from './createTransitions';\nimport { createTypography, ThemeTypographyInput } from './createTypography';\nimport { createV1Theme } from './createV1Theme';\nimport { GrafanaTheme2 } from './types';\nimport { zIndex } from './zIndex';\nimport { createVisualizationColors } from './createVisualizationColors';\n\n/** @internal */\nexport interface NewThemeOptions {\n name?: string;\n colors?: ThemeColorsInput;\n spacing?: ThemeSpacingOptions;\n shape?: ThemeShapeInput;\n typography?: ThemeTypographyInput;\n}\n\n/** @internal */\nexport function createTheme(options: NewThemeOptions = {}): GrafanaTheme2 {\n const {\n name = 'Dark',\n colors: colorsInput = {},\n spacing: spacingInput = {},\n shape: shapeInput = {},\n typography: typographyInput = {},\n } = options;\n\n const colors = createColors(colorsInput);\n const breakpoints = createBreakpoints();\n const spacing = createSpacing(spacingInput);\n const shape = createShape(shapeInput);\n const typography = createTypography(colors, typographyInput);\n const shadows = createShadows(colors);\n const transitions = createTransitions();\n const components = createComponents(colors, shadows);\n const visualization = createVisualizationColors(colors);\n\n const theme = {\n name,\n isDark: colors.mode === 'dark',\n isLight: colors.mode === 'light',\n colors,\n breakpoints,\n spacing,\n shape,\n components,\n typography,\n shadows,\n transitions,\n visualization,\n zIndex: {\n ...zIndex,\n },\n };\n\n return {\n ...theme,\n v1: createV1Theme(theme),\n };\n}\n","export const palette = {\n white: '#FFFFFF',\n black: '#000000',\n\n gray25: '#2c3235',\n gray15: '#22252b', //'#202226',\n gray10: '#181b1f', // old '#141619',\n gray05: '#111217', // old '#0b0c0e',\n\n // new from figma,\n darkLayer0: '#18181A',\n darkLayer1: '#212124',\n darkLayer2: '#2a2a2f', // figma used #34343B but a bit too bright\n\n darkBorder1: '#34343B',\n darkBorder2: '#64646B',\n\n // Dashboard bg / layer 0 (light theme)\n gray90: '#F4F5F5',\n // Card bg / layer 1\n gray100: '#F4F5F5',\n // divider line\n gray80: '#D0D1D3',\n // from figma\n lightBorder1: '#E4E7E7',\n\n blueDarkMain: '#3D71D9', // '#4165F5',\n blueDarkText: '#6E9FFF', // '#58a6ff', //'#33a2e5', // '#5790FF',\n redDarkMain: '#D10E5C',\n redDarkText: '#FF5286',\n greenDarkMain: '#1A7F4B',\n greenDarkText: '#6CCF8E',\n orangeDarkMain: '#F5B73D',\n orangeDarkText: '#F8D06B',\n\n blueLightMain: '#3871DC',\n blueLightText: '#1F62E0',\n redLightMain: '#E0226E',\n redLightText: '#CF0E5B',\n greenLightMain: '#1B855E',\n greenLightText: '#0A764E',\n orangeLightMain: '#FAD34A',\n orangeLightText: '#8A6C00',\n};\n","// Libraries\nimport { isNumber } from 'lodash';\n\nimport { NullValueMode, Field, FieldState, FieldCalcs, FieldType } from '../types/index';\nimport { Registry, RegistryItem } from '../utils/Registry';\n\nexport enum ReducerID {\n sum = 'sum',\n max = 'max',\n min = 'min',\n logmin = 'logmin',\n mean = 'mean',\n last = 'last',\n first = 'first',\n count = 'count',\n range = 'range',\n diff = 'diff',\n diffperc = 'diffperc',\n delta = 'delta',\n step = 'step',\n firstNotNull = 'firstNotNull',\n lastNotNull = 'lastNotNull',\n changeCount = 'changeCount',\n distinctCount = 'distinctCount',\n allIsZero = 'allIsZero',\n allIsNull = 'allIsNull',\n allValues = 'allValues',\n}\n\n// Internal function\ntype FieldReducer = (field: Field, ignoreNulls: boolean, nullAsZero: boolean) => FieldCalcs;\n\nexport interface FieldReducerInfo extends RegistryItem {\n // Internal details\n emptyInputResult?: any; // typically null, but some things like 'count' & 'sum' should be zero\n standard: boolean; // The most common stats can all be calculated in a single pass\n reduce?: FieldReducer;\n}\n\ninterface ReduceFieldOptions {\n field: Field;\n reducers: string[]; // The stats to calculate\n}\n\n/**\n * @returns an object with a key for each selected stat\n * NOTE: This will also modify the 'field.state' object,\n * leaving values in a cache until cleared.\n */\nexport function reduceField(options: ReduceFieldOptions): FieldCalcs {\n const { field, reducers } = options;\n\n if (!field || !reducers || reducers.length < 1) {\n return {};\n }\n\n if (field.state?.calcs) {\n // Find the values we need to calculate\n const missing: string[] = [];\n for (const s of reducers) {\n if (!field.state.calcs.hasOwnProperty(s)) {\n missing.push(s);\n }\n }\n if (missing.length < 1) {\n return {\n ...field.state.calcs,\n };\n }\n }\n if (!field.state) {\n field.state = {} as FieldState;\n }\n\n const queue = fieldReducers.list(reducers);\n\n // Return early for empty series\n // This lets the concrete implementations assume at least one row\n const data = field.values;\n if (data.length < 1) {\n const calcs = { ...field.state.calcs } as FieldCalcs;\n for (const reducer of queue) {\n calcs[reducer.id] = reducer.emptyInputResult !== null ? reducer.emptyInputResult : null;\n }\n return (field.state.calcs = calcs);\n }\n\n const { nullValueMode } = field.config;\n const ignoreNulls = nullValueMode === NullValueMode.Ignore;\n const nullAsZero = nullValueMode === NullValueMode.AsZero;\n\n // Avoid calculating all the standard stats if possible\n if (queue.length === 1 && queue[0].reduce) {\n const values = queue[0].reduce(field, ignoreNulls, nullAsZero);\n field.state.calcs = {\n ...field.state.calcs,\n ...values,\n };\n return values;\n }\n\n // For now everything can use the standard stats\n let values = doStandardCalcs(field, ignoreNulls, nullAsZero);\n\n for (const reducer of queue) {\n if (!values.hasOwnProperty(reducer.id) && reducer.reduce) {\n values = {\n ...values,\n ...reducer.reduce(field, ignoreNulls, nullAsZero),\n };\n }\n }\n\n field.state.calcs = {\n ...field.state.calcs,\n ...values,\n };\n return values;\n}\n\n// ------------------------------------------------------------------------------\n//\n// No Exported symbols below here.\n//\n// ------------------------------------------------------------------------------\n\nexport const fieldReducers = new Registry(() => [\n {\n id: ReducerID.lastNotNull,\n name: 'Last *',\n description: 'Last non-null value',\n standard: true,\n aliasIds: ['current'],\n reduce: calculateLastNotNull,\n },\n {\n id: ReducerID.last,\n name: 'Last',\n description: 'Last value',\n standard: true,\n reduce: calculateLast,\n },\n { id: ReducerID.first, name: 'First', description: 'First Value', standard: true, reduce: calculateFirst },\n {\n id: ReducerID.firstNotNull,\n name: 'First',\n description: 'First non-null value',\n standard: true,\n reduce: calculateFirstNotNull,\n },\n { id: ReducerID.min, name: 'Min', description: 'Minimum Value', standard: true },\n { id: ReducerID.max, name: 'Max', description: 'Maximum Value', standard: true },\n { id: ReducerID.mean, name: 'Mean', description: 'Average Value', standard: true, aliasIds: ['avg'] },\n {\n id: ReducerID.sum,\n name: 'Total',\n description: 'The sum of all values',\n emptyInputResult: 0,\n standard: true,\n aliasIds: ['total'],\n },\n {\n id: ReducerID.count,\n name: 'Count',\n description: 'Number of values in response',\n emptyInputResult: 0,\n standard: true,\n },\n {\n id: ReducerID.range,\n name: 'Range',\n description: 'Difference between minimum and maximum values',\n standard: true,\n },\n {\n id: ReducerID.delta,\n name: 'Delta',\n description: 'Cumulative change in value',\n standard: true,\n },\n {\n id: ReducerID.step,\n name: 'Step',\n description: 'Minimum interval between values',\n standard: true,\n },\n {\n id: ReducerID.diff,\n name: 'Difference',\n description: 'Difference between first and last values',\n standard: true,\n },\n {\n id: ReducerID.logmin,\n name: 'Min (above zero)',\n description: 'Used for log min scale',\n standard: true,\n },\n {\n id: ReducerID.allIsZero,\n name: 'All Zeros',\n description: 'All values are zero',\n emptyInputResult: false,\n standard: true,\n },\n {\n id: ReducerID.allIsNull,\n name: 'All Nulls',\n description: 'All values are null',\n emptyInputResult: true,\n standard: true,\n },\n {\n id: ReducerID.changeCount,\n name: 'Change Count',\n description: 'Number of times the value changes',\n standard: false,\n reduce: calculateChangeCount,\n },\n {\n id: ReducerID.distinctCount,\n name: 'Distinct Count',\n description: 'Number of distinct values',\n standard: false,\n reduce: calculateDistinctCount,\n },\n {\n id: ReducerID.diffperc,\n name: 'Difference percent',\n description: 'Percentage difference between first and last values',\n standard: true,\n },\n {\n id: ReducerID.allValues,\n name: 'All values',\n description: 'Returns an array with all values',\n standard: false,\n reduce: (field: Field) => ({ allValues: field.values.toArray() }),\n },\n]);\n\nexport function doStandardCalcs(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n const calcs = {\n sum: 0,\n max: -Number.MAX_VALUE,\n min: Number.MAX_VALUE,\n logmin: Number.MAX_VALUE,\n mean: null,\n last: null,\n first: null,\n lastNotNull: null,\n firstNotNull: null,\n count: 0,\n nonNullCount: 0,\n allIsNull: true,\n allIsZero: true,\n range: null,\n diff: null,\n delta: 0,\n step: Number.MAX_VALUE,\n diffperc: 0,\n\n // Just used for calculations -- not exposed as a stat\n previousDeltaUp: true,\n } as FieldCalcs;\n\n const data = field.values;\n calcs.count = data.length;\n\n const isNumberField = field.type === FieldType.number || FieldType.time;\n\n for (let i = 0; i < data.length; i++) {\n let currentValue = data.get(i);\n\n if (i === 0) {\n calcs.first = currentValue;\n }\n\n calcs.last = currentValue;\n\n if (currentValue === null) {\n if (ignoreNulls) {\n continue;\n }\n if (nullAsZero) {\n currentValue = 0;\n }\n }\n\n if (currentValue != null) {\n // null || undefined\n const isFirst = calcs.firstNotNull === null;\n if (isFirst) {\n calcs.firstNotNull = currentValue;\n }\n\n if (isNumberField) {\n calcs.sum += currentValue;\n calcs.allIsNull = false;\n calcs.nonNullCount++;\n\n if (!isFirst) {\n const step = currentValue - calcs.lastNotNull!;\n if (calcs.step > step) {\n calcs.step = step; // the minimum interval\n }\n\n if (calcs.lastNotNull! > currentValue) {\n // counter reset\n calcs.previousDeltaUp = false;\n if (i === data.length - 1) {\n // reset on last\n calcs.delta += currentValue;\n }\n } else {\n if (calcs.previousDeltaUp) {\n calcs.delta += step; // normal increment\n } else {\n calcs.delta += currentValue; // account for counter reset\n }\n calcs.previousDeltaUp = true;\n }\n }\n\n if (currentValue > calcs.max) {\n calcs.max = currentValue;\n }\n\n if (currentValue < calcs.min) {\n calcs.min = currentValue;\n }\n\n if (currentValue < calcs.logmin && currentValue > 0) {\n calcs.logmin = currentValue;\n }\n }\n\n if (currentValue !== 0) {\n calcs.allIsZero = false;\n }\n\n calcs.lastNotNull = currentValue;\n }\n }\n\n if (calcs.max === -Number.MAX_VALUE) {\n calcs.max = null;\n }\n\n if (calcs.min === Number.MAX_VALUE) {\n calcs.min = null;\n }\n\n if (calcs.step === Number.MAX_VALUE) {\n calcs.step = null;\n }\n\n if (calcs.nonNullCount > 0) {\n calcs.mean = calcs.sum! / calcs.nonNullCount;\n }\n\n if (calcs.allIsNull) {\n calcs.allIsZero = false;\n }\n\n if (calcs.max !== null && calcs.min !== null) {\n calcs.range = calcs.max - calcs.min;\n }\n\n if (isNumber(calcs.firstNotNull) && isNumber(calcs.lastNotNull)) {\n calcs.diff = calcs.lastNotNull - calcs.firstNotNull;\n }\n\n if (isNumber(calcs.firstNotNull) && isNumber(calcs.diff)) {\n calcs.diffperc = calcs.diff / calcs.firstNotNull;\n }\n return calcs;\n}\n\nfunction calculateFirst(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n return { first: field.values.get(0) };\n}\n\nfunction calculateFirstNotNull(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n const data = field.values;\n for (let idx = 0; idx < data.length; idx++) {\n const v = data.get(idx);\n if (v != null && v !== undefined) {\n return { firstNotNull: v };\n }\n }\n return { firstNotNull: null };\n}\n\nfunction calculateLast(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n const data = field.values;\n return { last: data.get(data.length - 1) };\n}\n\nfunction calculateLastNotNull(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n const data = field.values;\n let idx = data.length - 1;\n while (idx >= 0) {\n const v = data.get(idx--);\n if (v != null && v !== undefined) {\n return { lastNotNull: v };\n }\n }\n return { lastNotNull: null };\n}\n\nfunction calculateChangeCount(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n const data = field.values;\n let count = 0;\n let first = true;\n let last: any = null;\n for (let i = 0; i < data.length; i++) {\n let currentValue = data.get(i);\n if (currentValue === null) {\n if (ignoreNulls) {\n continue;\n }\n if (nullAsZero) {\n currentValue = 0;\n }\n }\n if (!first && last !== currentValue) {\n count++;\n }\n first = false;\n last = currentValue;\n }\n\n return { changeCount: count };\n}\n\nfunction calculateDistinctCount(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs {\n const data = field.values;\n const distinct = new Set();\n for (let i = 0; i < data.length; i++) {\n let currentValue = data.get(i);\n if (currentValue === null) {\n if (ignoreNulls) {\n continue;\n }\n if (nullAsZero) {\n currentValue = 0;\n }\n }\n distinct.add(currentValue);\n }\n return { distinctCount: distinct.size };\n}\n","import { Field, FieldType, DataFrame } from '../../types/dataFrame';\nimport { FieldMatcherID } from './ids';\nimport { FieldMatcherInfo } from '../../types/transformations';\n\n// General Field matcher\nconst fieldTypeMatcher: FieldMatcherInfo = {\n id: FieldMatcherID.byType,\n name: 'Field Type',\n description: 'match based on the field type',\n defaultOptions: FieldType.number,\n\n get: (type: FieldType) => {\n return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n return type === field.type;\n };\n },\n\n getOptionsDisplayText: (type: FieldType) => {\n return `Field type: ${type}`;\n },\n};\n\n// Numeric Field matcher\n// This gets its own entry so it shows up in the dropdown\nconst numericMatcher: FieldMatcherInfo = {\n id: FieldMatcherID.numeric,\n name: 'Numeric Fields',\n description: 'Fields with type number',\n\n get: () => {\n return fieldTypeMatcher.get(FieldType.number);\n },\n\n getOptionsDisplayText: () => {\n return 'Numeric Fields';\n },\n};\n\n// Time Field matcher\nconst timeMatcher: FieldMatcherInfo = {\n id: FieldMatcherID.time,\n name: 'Time Fields',\n description: 'Fields with type time',\n\n get: () => {\n return fieldTypeMatcher.get(FieldType.time);\n },\n\n getOptionsDisplayText: () => {\n return 'Time Fields';\n },\n};\n\n/**\n * Registry Initialization\n */\nexport function getFieldTypeMatchers(): FieldMatcherInfo[] {\n return [fieldTypeMatcher, numericMatcher, timeMatcher];\n}\n","// This needs to be in its own file to avoid circular references\n\n// Builtin Predicates\n// not using 'any' and 'never' since they are reserved keywords\nexport enum MatcherID {\n anyMatch = 'anyMatch', // checks children\n allMatch = 'allMatch', // checks children\n invertMatch = 'invertMatch', // checks child\n alwaysMatch = 'alwaysMatch',\n neverMatch = 'neverMatch',\n}\n\nexport enum FieldMatcherID {\n // Specific Types\n numeric = 'numeric',\n time = 'time', // Can be multiple times\n first = 'first',\n firstTimeField = 'firstTimeField', // Only the first fime field\n\n // With arguments\n byType = 'byType',\n byName = 'byName',\n byNames = 'byNames',\n byRegexp = 'byRegexp',\n byRegexpOrNames = 'byRegexpOrNames',\n byFrameRefID = 'byFrameRefID',\n // byIndex = 'byIndex',\n // byLabel = 'byLabel',\n}\n\n/**\n * Field name matchers\n */\nexport enum FrameMatcherID {\n byName = 'byName',\n byRefId = 'byRefId',\n byIndex = 'byIndex',\n byLabel = 'byLabel',\n}\n\n/**\n * @public\n */\nexport enum ValueMatcherID {\n regex = 'regex',\n isNull = 'isNull',\n isNotNull = 'isNotNull',\n greater = 'greater',\n greaterOrEqual = 'greaterOrEqual',\n lower = 'lower',\n lowerOrEqual = 'lowerOrEqual',\n equal = 'equal',\n notEqual = 'notEqual',\n between = 'between',\n}\n","import { Field, DataFrame, FieldType } from '../../types/dataFrame';\nimport { MatcherID } from './ids';\nimport { getFieldMatcher, fieldMatchers, getFrameMatchers, frameMatchers } from '../matchers';\nimport { FieldMatcherInfo, MatcherConfig, FrameMatcherInfo } from '../../types/transformations';\n\nconst anyFieldMatcher: FieldMatcherInfo = {\n id: MatcherID.anyMatch,\n name: 'Any',\n description: 'Any child matches (OR)',\n excludeFromPicker: true,\n defaultOptions: [], // empty array\n\n get: (options: MatcherConfig[]) => {\n const children = options.map((option) => {\n return getFieldMatcher(option);\n });\n return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n for (const child of children) {\n if (child(field, frame, allFrames)) {\n return true;\n }\n }\n return false;\n };\n },\n\n getOptionsDisplayText: (options: MatcherConfig[]) => {\n let text = '';\n for (const sub of options) {\n if (text.length > 0) {\n text += ' OR ';\n }\n const matcher = fieldMatchers.get(sub.id);\n text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n }\n return text;\n },\n};\n\nconst anyFrameMatcher: FrameMatcherInfo = {\n id: MatcherID.anyMatch,\n name: 'Any',\n description: 'Any child matches (OR)',\n excludeFromPicker: true,\n defaultOptions: [], // empty array\n\n get: (options: MatcherConfig[]) => {\n const children = options.map((option) => {\n return getFrameMatchers(option);\n });\n return (frame: DataFrame) => {\n for (const child of children) {\n if (child(frame)) {\n return true;\n }\n }\n return false;\n };\n },\n\n getOptionsDisplayText: (options: MatcherConfig[]) => {\n let text = '';\n for (const sub of options) {\n if (text.length > 0) {\n text += ' OR ';\n }\n const matcher = frameMatchers.get(sub.id);\n text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n }\n return text;\n },\n};\n\nconst allFieldsMatcher: FieldMatcherInfo = {\n id: MatcherID.allMatch,\n name: 'All',\n description: 'Everything matches (AND)',\n excludeFromPicker: true,\n defaultOptions: [], // empty array\n\n get: (options: MatcherConfig[]) => {\n const children = options.map((option) => {\n return getFieldMatcher(option);\n });\n return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n for (const child of children) {\n if (!child(field, frame, allFrames)) {\n return false;\n }\n }\n return true;\n };\n },\n\n getOptionsDisplayText: (options: MatcherConfig[]) => {\n let text = '';\n for (const sub of options) {\n if (text.length > 0) {\n text += ' AND ';\n }\n const matcher = fieldMatchers.get(sub.id); // Ugho what about frame\n text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n }\n return text;\n },\n};\n\nconst allFramesMatcher: FrameMatcherInfo = {\n id: MatcherID.allMatch,\n name: 'All',\n description: 'Everything matches (AND)',\n excludeFromPicker: true,\n defaultOptions: [], // empty array\n\n get: (options: MatcherConfig[]) => {\n const children = options.map((option) => {\n return getFrameMatchers(option);\n });\n return (frame: DataFrame) => {\n for (const child of children) {\n if (!child(frame)) {\n return false;\n }\n }\n return true;\n };\n },\n\n getOptionsDisplayText: (options: MatcherConfig[]) => {\n let text = '';\n for (const sub of options) {\n if (text.length > 0) {\n text += ' AND ';\n }\n const matcher = frameMatchers.get(sub.id);\n text += matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(sub) : matcher.name;\n }\n return text;\n },\n};\n\nconst notFieldMatcher: FieldMatcherInfo = {\n id: MatcherID.invertMatch,\n name: 'NOT',\n description: 'Inverts other matchers',\n excludeFromPicker: true,\n\n get: (option: MatcherConfig) => {\n const check = getFieldMatcher(option);\n return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n return !check(field, frame, allFrames);\n };\n },\n\n getOptionsDisplayText: (options: MatcherConfig) => {\n const matcher = fieldMatchers.get(options.id);\n const text = matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(options.options) : matcher.name;\n return 'NOT ' + text;\n },\n};\n\nconst notFrameMatcher: FrameMatcherInfo = {\n id: MatcherID.invertMatch,\n name: 'NOT',\n description: 'Inverts other matchers',\n excludeFromPicker: true,\n\n get: (option: MatcherConfig) => {\n const check = getFrameMatchers(option);\n return (frame: DataFrame) => {\n return !check(frame);\n };\n },\n\n getOptionsDisplayText: (options: MatcherConfig) => {\n const matcher = frameMatchers.get(options.id);\n const text = matcher.getOptionsDisplayText ? matcher.getOptionsDisplayText(options.options) : matcher.name;\n return 'NOT ' + text;\n },\n};\n\nexport const alwaysFieldMatcher = (field: Field) => {\n return true;\n};\n\nexport const alwaysFrameMatcher = (frame: DataFrame) => {\n return true;\n};\n\nexport const neverFieldMatcher = (field: Field) => {\n return false;\n};\n\nexport const notTimeFieldMatcher = (field: Field) => {\n return field.type !== FieldType.time;\n};\n\nexport const neverFrameMatcher = (frame: DataFrame) => {\n return false;\n};\n\nconst alwaysFieldMatcherInfo: FieldMatcherInfo = {\n id: MatcherID.alwaysMatch,\n name: 'All Fields',\n description: 'Always Match',\n\n get: (option: any) => {\n return alwaysFieldMatcher;\n },\n\n getOptionsDisplayText: (options: any) => {\n return 'Always';\n },\n};\n\nconst alwaysFrameMatcherInfo: FrameMatcherInfo = {\n id: MatcherID.alwaysMatch,\n name: 'All Frames',\n description: 'Always Match',\n\n get: (option: any) => {\n return alwaysFrameMatcher;\n },\n\n getOptionsDisplayText: (options: any) => {\n return 'Always';\n },\n};\n\nconst neverFieldMatcherInfo: FieldMatcherInfo = {\n id: MatcherID.neverMatch,\n name: 'No Fields',\n description: 'Never Match',\n excludeFromPicker: true,\n\n get: (option: any) => {\n return neverFieldMatcher;\n },\n\n getOptionsDisplayText: (options: any) => {\n return 'Never';\n },\n};\n\nconst neverFrameMatcherInfo: FrameMatcherInfo = {\n id: MatcherID.neverMatch,\n name: 'No Frames',\n description: 'Never Match',\n\n get: (option: any) => {\n return neverFrameMatcher;\n },\n\n getOptionsDisplayText: (options: any) => {\n return 'Never';\n },\n};\n\nexport function getFieldPredicateMatchers(): FieldMatcherInfo[] {\n return [anyFieldMatcher, allFieldsMatcher, notFieldMatcher, alwaysFieldMatcherInfo, neverFieldMatcherInfo];\n}\n\nexport function getFramePredicateMatchers(): FrameMatcherInfo[] {\n return [anyFrameMatcher, allFramesMatcher, notFrameMatcher, alwaysFrameMatcherInfo, neverFrameMatcherInfo];\n}\n","import { DataFrame } from '../../types/dataFrame';\nimport { FrameMatcherID } from './ids';\nimport { FrameMatcherInfo } from '../../types/transformations';\nimport { stringToJsRegex } from '../../text';\n\n// General Field matcher\nconst refIdMacher: FrameMatcherInfo = {\n id: FrameMatcherID.byRefId,\n name: 'Query refId',\n description: 'match the refId',\n defaultOptions: 'A',\n\n get: (pattern: string) => {\n const regex = stringToJsRegex(pattern);\n return (frame: DataFrame) => {\n return regex.test(frame.refId || '');\n };\n },\n\n getOptionsDisplayText: (pattern: string) => {\n return `RefID: ${pattern}`;\n },\n};\n\nexport function getRefIdMatchers(): FrameMatcherInfo[] {\n return [refIdMacher];\n}\n","import { Field, FieldType, DataFrame } from '../../types/dataFrame';\nimport { FieldMatcherID } from './ids';\nimport { FieldMatcherInfo } from '../../types/transformations';\n\nconst firstFieldMatcher: FieldMatcherInfo = {\n id: FieldMatcherID.first,\n name: 'First Field',\n description: 'The first field in the frame',\n\n get: (type: FieldType) => {\n return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n return field === frame.fields[0];\n };\n },\n\n getOptionsDisplayText: () => {\n return `First field`;\n },\n};\n\nconst firstTimeFieldMatcher: FieldMatcherInfo = {\n id: FieldMatcherID.firstTimeField,\n name: 'First time field',\n description: 'The first field of type time in a frame',\n\n get: (type: FieldType) => {\n return (field: Field, frame: DataFrame, allFrames: DataFrame[]) => {\n return field.type === FieldType.time && field === frame.fields.find((f) => f.type === FieldType.time);\n };\n },\n\n getOptionsDisplayText: () => {\n return `First time field`;\n },\n};\n\n/**\n * Registry Initialization\n */\nexport function getSimpleFieldMatchers(): FieldMatcherInfo[] {\n return [firstFieldMatcher, firstTimeFieldMatcher];\n}\n","import { Field } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\nimport { BasicValueMatcherOptions } from './types';\n\nconst isEqualValueMatcher: ValueMatcherInfo = {\n id: ValueMatcherID.equal,\n name: 'Is equal',\n description: 'Match where value for given field is equal to options value.',\n get: (options) => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n // eslint-disable-next-line eqeqeq\n return value == options.value;\n };\n },\n getOptionsDisplayText: () => {\n return `Matches all rows where field is null.`;\n },\n isApplicable: () => true,\n getDefaultOptions: () => ({ value: '' }),\n};\n\nconst isNotEqualValueMatcher: ValueMatcherInfo = {\n id: ValueMatcherID.notEqual,\n name: 'Is not equal',\n description: 'Match where value for given field is not equal to options value.',\n get: (options) => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n // eslint-disable-next-line eqeqeq\n return value != options.value;\n };\n },\n getOptionsDisplayText: () => {\n return `Matches all rows where field is not null.`;\n },\n isApplicable: () => true,\n getDefaultOptions: () => ({ value: '' }),\n};\n\nexport const getEqualValueMatchers = (): ValueMatcherInfo[] => [isEqualValueMatcher, isNotEqualValueMatcher];\n","import { Field } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\nimport { ValueMatcherOptions } from './types';\n\nconst isNullValueMatcher: ValueMatcherInfo = {\n id: ValueMatcherID.isNull,\n name: 'Is null',\n description: 'Match where value for given field is null.',\n get: () => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n return value == null;\n };\n },\n getOptionsDisplayText: () => {\n return `Matches all rows where field is null.`;\n },\n isApplicable: () => true,\n getDefaultOptions: () => ({}),\n};\n\nconst isNotNullValueMatcher: ValueMatcherInfo = {\n id: ValueMatcherID.isNotNull,\n name: 'Is not null',\n description: 'Match where value for given field is not null.',\n get: () => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n return value != null;\n };\n },\n getOptionsDisplayText: () => {\n return `Matches all rows where field is not null.`;\n },\n isApplicable: () => true,\n getDefaultOptions: () => ({}),\n};\n\nexport const getNullValueMatchers = (): ValueMatcherInfo[] => [isNullValueMatcher, isNotNullValueMatcher];\n","import { Field, FieldType } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\nimport { BasicValueMatcherOptions } from './types';\n\nconst isGreaterValueMatcher: ValueMatcherInfo> = {\n id: ValueMatcherID.greater,\n name: 'Is greater',\n description: 'Match when field value is greater than option.',\n get: (options) => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n if (isNaN(value)) {\n return false;\n }\n return value > options.value;\n };\n },\n getOptionsDisplayText: (options) => {\n return `Matches all rows where field value is greater than: ${options.value}.`;\n },\n isApplicable: (field) => field.type === FieldType.number,\n getDefaultOptions: () => ({ value: 0 }),\n};\n\nconst isGreaterOrEqualValueMatcher: ValueMatcherInfo> = {\n id: ValueMatcherID.greaterOrEqual,\n name: 'Is greater or equal',\n description: 'Match when field value is greater than or equal to option.',\n get: (options) => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n if (isNaN(value)) {\n return false;\n }\n return value >= options.value;\n };\n },\n getOptionsDisplayText: (options) => {\n return `Matches all rows where field value is greater than or equal to: ${options.value}.`;\n },\n isApplicable: (field) => field.type === FieldType.number,\n getDefaultOptions: () => ({ value: 0 }),\n};\n\nconst isLowerValueMatcher: ValueMatcherInfo> = {\n id: ValueMatcherID.lower,\n name: 'Is lower',\n description: 'Match when field value is lower than option.',\n get: (options) => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n if (isNaN(value)) {\n return false;\n }\n return value < options.value;\n };\n },\n getOptionsDisplayText: (options) => {\n return `Matches all rows where field value is lower than: ${options.value}.`;\n },\n isApplicable: (field) => field.type === FieldType.number,\n getDefaultOptions: () => ({ value: 0 }),\n};\n\nconst isLowerOrEqualValueMatcher: ValueMatcherInfo> = {\n id: ValueMatcherID.lowerOrEqual,\n name: 'Is lower or equal',\n description: 'Match when field value is lower or equal than option.',\n get: (options) => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n if (isNaN(value)) {\n return false;\n }\n return value <= options.value;\n };\n },\n getOptionsDisplayText: (options) => {\n return `Matches all rows where field value is lower or equal than: ${options.value}.`;\n },\n isApplicable: (field) => field.type === FieldType.number,\n getDefaultOptions: () => ({ value: 0 }),\n};\n\nexport const getNumericValueMatchers = (): ValueMatcherInfo[] => [\n isGreaterValueMatcher,\n isGreaterOrEqualValueMatcher,\n isLowerValueMatcher,\n isLowerOrEqualValueMatcher,\n];\n","import { Field, FieldType } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\nimport { RangeValueMatcherOptions } from './types';\n\nconst isBetweenValueMatcher: ValueMatcherInfo> = {\n id: ValueMatcherID.between,\n name: 'Is between',\n description: 'Match when field value is between given option values.',\n get: (options) => {\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n if (isNaN(value)) {\n return false;\n }\n return value > options.from && value < options.to;\n };\n },\n getOptionsDisplayText: (options) => {\n return `Matches all rows where field value is between ${options.from} and ${options.to}.`;\n },\n isApplicable: (field) => field.type === FieldType.number,\n getDefaultOptions: () => ({ from: 0, to: 100 }),\n};\n\nexport const getRangeValueMatchers = (): ValueMatcherInfo[] => [isBetweenValueMatcher];\n","import { Field } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\nimport { BasicValueMatcherOptions } from './types';\n\nconst regexValueMatcher: ValueMatcherInfo> = {\n id: ValueMatcherID.regex,\n name: 'Regex',\n description: 'Match when field value is matching regex.',\n get: (options) => {\n const regex = new RegExp(options.value);\n\n return (valueIndex: number, field: Field) => {\n const value = field.values.get(valueIndex);\n return regex.test(value);\n };\n },\n getOptionsDisplayText: (options) => {\n return `Matches all rows where field value is matching regex: ${options.value}`;\n },\n isApplicable: () => true,\n getDefaultOptions: () => ({ value: '.*' }),\n};\n\nexport const getRegexValueMatcher = (): ValueMatcherInfo[] => [regexValueMatcher];\n","import { seriesToColumnsTransformer } from './seriesToColumns';\nimport { DataFrame } from '../../types/dataFrame';\nimport { getTimeField } from '../../dataframe/processDataFrame';\nimport { SynchronousDataTransformerInfo } from '../../types/transformations';\nimport { DataTransformerID } from './ids';\nimport { map } from 'rxjs/operators';\n\nexport const ensureColumnsTransformer: SynchronousDataTransformerInfo = {\n id: DataTransformerID.ensureColumns,\n name: 'Ensure Columns Transformer',\n description: 'Will check if current data frames is series or columns. If in series it will convert to columns.',\n\n operator: (options) => (source) => source.pipe(map((data) => ensureColumnsTransformer.transformer(options)(data))),\n\n transformer: (options: any) => (frames: DataFrame[]) => {\n // Assume timeseries should first be joined by time\n const timeFieldName = findConsistentTimeFieldName(frames);\n\n if (frames.length > 1 && timeFieldName) {\n return seriesToColumnsTransformer.transformer({\n byField: timeFieldName,\n })(frames);\n }\n return frames;\n },\n};\n\n/**\n * Find the name for the time field used in all frames (if one exists)\n */\nfunction findConsistentTimeFieldName(data: DataFrame[]): string | undefined {\n let name: string | undefined = undefined;\n for (const frame of data) {\n const { timeField } = getTimeField(frame);\n if (!timeField) {\n return undefined; // Not timeseries\n }\n if (!name) {\n name = timeField.name;\n } else if (name !== timeField.name) {\n // Second frame has a different time column?!\n return undefined;\n }\n }\n return name;\n}\n","import { map } from 'rxjs/operators';\n\nimport { noopTransformer } from './noop';\nimport { DataFrame, Field } from '../../types/dataFrame';\nimport { DataTransformerID } from './ids';\nimport { DataTransformerInfo, MatcherConfig } from '../../types/transformations';\nimport { getFieldMatcher, getFrameMatchers } from '../matchers';\n\nexport interface FilterOptions {\n include?: MatcherConfig;\n exclude?: MatcherConfig;\n}\n\nexport const filterFieldsTransformer: DataTransformerInfo = {\n id: DataTransformerID.filterFields,\n name: 'Filter Fields',\n description: 'select a subset of fields',\n defaultOptions: {},\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options: FilterOptions) => (source) => {\n if (!options.include && !options.exclude) {\n return source.pipe(noopTransformer.operator({}));\n }\n\n return source.pipe(\n map((data) => {\n const include = options.include ? getFieldMatcher(options.include) : null;\n const exclude = options.exclude ? getFieldMatcher(options.exclude) : null;\n\n const processed: DataFrame[] = [];\n for (const series of data) {\n // Find the matching field indexes\n const fields: Field[] = [];\n for (let i = 0; i < series.fields.length; i++) {\n const field = series.fields[i];\n\n if (exclude) {\n if (exclude(field, series, data)) {\n continue;\n }\n if (!include) {\n fields.push(field);\n }\n }\n if (include && include(field, series, data)) {\n fields.push(field);\n }\n }\n\n if (!fields.length) {\n continue;\n }\n const copy = {\n ...series, // all the other properties\n fields, // but a different set of fields\n };\n processed.push(copy);\n }\n return processed;\n })\n );\n },\n};\n\nexport const filterFramesTransformer: DataTransformerInfo = {\n id: DataTransformerID.filterFrames,\n name: 'Filter Frames',\n description: 'select a subset of frames',\n defaultOptions: {},\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options) => (source) => {\n if (!options.include && !options.exclude) {\n return source.pipe(noopTransformer.operator({}));\n }\n\n return source.pipe(\n map((data) => {\n const include = options.include ? getFrameMatchers(options.include) : null;\n const exclude = options.exclude ? getFrameMatchers(options.exclude) : null;\n\n const processed: DataFrame[] = [];\n for (const series of data) {\n if (exclude) {\n if (exclude(series)) {\n continue;\n }\n if (!include) {\n processed.push(series);\n }\n }\n if (include && include(series)) {\n processed.push(series);\n }\n }\n return processed;\n })\n );\n },\n};\n","import { DataTransformerID } from './ids';\nimport { DataTransformerInfo, MatcherConfig } from '../../types/transformations';\nimport { FieldMatcherID } from '../matchers/ids';\nimport { filterFieldsTransformer } from './filter';\nimport { RegexpOrNamesMatcherOptions } from '../matchers/nameMatcher';\n\nexport interface FilterFieldsByNameTransformerOptions {\n include?: RegexpOrNamesMatcherOptions;\n exclude?: RegexpOrNamesMatcherOptions;\n}\n\nexport const filterFieldsByNameTransformer: DataTransformerInfo = {\n id: DataTransformerID.filterFieldsByName,\n name: 'Filter fields by name',\n description: 'select a subset of fields',\n defaultOptions: {},\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options) => (source) =>\n source.pipe(\n filterFieldsTransformer.operator({\n include: getMatcherConfig(options.include),\n exclude: getMatcherConfig(options.exclude),\n })\n ),\n};\n\nconst getMatcherConfig = (options?: RegexpOrNamesMatcherOptions): MatcherConfig | undefined => {\n if (!options) {\n return undefined;\n }\n\n const { names, pattern } = options;\n\n if ((!Array.isArray(names) || names.length === 0) && !pattern) {\n return undefined;\n }\n\n if (!pattern) {\n return { id: FieldMatcherID.byNames, options: { names } };\n }\n\n if (!Array.isArray(names) || names.length === 0) {\n return { id: FieldMatcherID.byRegexp, options: pattern };\n }\n\n return { id: FieldMatcherID.byRegexpOrNames, options };\n};\n","import { DataTransformerID } from './ids';\nimport { filterFramesTransformer, FilterOptions } from './filter';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport { FrameMatcherID } from '../matchers/ids';\n\nexport interface FilterFramesByRefIdTransformerOptions {\n include?: string;\n exclude?: string;\n}\n\nexport const filterFramesByRefIdTransformer: DataTransformerInfo = {\n id: DataTransformerID.filterByRefId,\n name: 'Filter data by query refId',\n description: 'select a subset of results',\n defaultOptions: {},\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options) => (source) => {\n const filterOptions: FilterOptions = {};\n if (options.include) {\n filterOptions.include = {\n id: FrameMatcherID.byRefId,\n options: options.include,\n };\n }\n if (options.exclude) {\n filterOptions.exclude = {\n id: FrameMatcherID.byRefId,\n options: options.exclude,\n };\n }\n\n return source.pipe(filterFramesTransformer.operator(filterOptions));\n },\n};\n","export enum DataTransformerID {\n // join = 'join', // Pick a field and merge all series based on that field\n append = 'append',\n // rotate = 'rotate', // Columns to rows\n reduce = 'reduce',\n order = 'order',\n organize = 'organize',\n rename = 'rename',\n calculateField = 'calculateField',\n seriesToColumns = 'seriesToColumns',\n seriesToRows = 'seriesToRows',\n merge = 'merge',\n concatenate = 'concatenate',\n labelsToFields = 'labelsToFields',\n filterFields = 'filterFields',\n filterFieldsByName = 'filterFieldsByName',\n filterFrames = 'filterFrames',\n filterByRefId = 'filterByRefId',\n renameByRegex = 'renameByRegex',\n filterByValue = 'filterByValue',\n noop = 'noop',\n ensureColumns = 'ensureColumns',\n groupBy = 'groupBy',\n sortBy = 'sortBy',\n histogram = 'histogram',\n configFromData = 'configFromData',\n rowsToFields = 'rowsToFields',\n prepareTimeSeries = 'prepareTimeSeries',\n convertFieldType = 'convertFieldType',\n fieldLookup = 'fieldLookup',\n spatial = 'spatial',\n extractFields = 'extractFields',\n}\n","import { DataFrame, Field, FieldMatcher, FieldType, Vector } from '../../types';\nimport { ArrayVector } from '../../vector';\nimport { fieldMatchers } from '../matchers';\nimport { FieldMatcherID } from '../matchers/ids';\nimport { getTimeField, sortDataFrame } from '../../dataframe';\n\nexport function pickBestJoinField(data: DataFrame[]): FieldMatcher {\n const { timeField } = getTimeField(data[0]);\n if (timeField) {\n return fieldMatchers.get(FieldMatcherID.firstTimeField).get({});\n }\n let common: string[] = [];\n for (const f of data[0].fields) {\n if (f.type === FieldType.number) {\n common.push(f.name);\n }\n }\n\n for (let i = 1; i < data.length; i++) {\n const names: string[] = [];\n for (const f of data[0].fields) {\n if (f.type === FieldType.number) {\n names.push(f.name);\n }\n }\n common = common.filter((v) => !names.includes(v));\n }\n\n return fieldMatchers.get(FieldMatcherID.byName).get(common[0]);\n}\n\n/**\n * @alpha\n */\nexport interface JoinOptions {\n /**\n * The input fields\n */\n frames: DataFrame[];\n\n /**\n * The field to join -- frames that do not have this field will be droppped\n */\n joinBy?: FieldMatcher;\n\n /**\n * Optionally filter the non-join fields\n */\n keep?: FieldMatcher;\n\n /**\n * When the result is a single frame, this will to a quick check to see if the values are sorted,\n * and sort if necessary. If the first/last values are in order the whole vector is assumed to be\n * sorted\n */\n enforceSort?: boolean;\n\n /**\n * @internal -- used when we need to keep a reference to the original frame/field index\n */\n keepOriginIndices?: boolean;\n}\n\nfunction getJoinMatcher(options: JoinOptions): FieldMatcher {\n return options.joinBy ?? pickBestJoinField(options.frames);\n}\n\n/**\n * This will return a single frame joined by the first matching field. When a join field is not specified,\n * the default will use the first time field\n */\nexport function outerJoinDataFrames(options: JoinOptions): DataFrame | undefined {\n if (!options.frames?.length) {\n return;\n }\n\n if (options.frames.length === 1) {\n let frame = options.frames[0];\n let frameCopy = frame;\n\n const joinFieldMatcher = getJoinMatcher(options);\n let joinIndex = frameCopy.fields.findIndex((f) => joinFieldMatcher(f, frameCopy, options.frames));\n\n if (options.keepOriginIndices) {\n frameCopy = {\n ...frame,\n fields: frame.fields.map((f, fieldIndex) => {\n const copy = { ...f };\n const origin = {\n frameIndex: 0,\n fieldIndex,\n };\n if (copy.state) {\n copy.state.origin = origin;\n } else {\n copy.state = { origin };\n }\n return copy;\n }),\n };\n\n // Make sure the join field is first\n if (joinIndex > 0) {\n const joinField = frameCopy.fields[joinIndex];\n const fields = frameCopy.fields.filter((f, idx) => idx !== joinIndex);\n fields.unshift(joinField);\n frameCopy.fields = fields;\n joinIndex = 0;\n }\n }\n\n if (options.enforceSort) {\n if (joinIndex >= 0) {\n if (!isLikelyAscendingVector(frameCopy.fields[joinIndex].values)) {\n frameCopy = sortDataFrame(frameCopy, joinIndex);\n }\n }\n }\n\n if (options.keep) {\n let fields = frameCopy.fields.filter(\n (f, fieldIdx) => fieldIdx === joinIndex || options.keep!(f, frameCopy, options.frames)\n );\n\n // mutate already copied frame\n if (frame !== frameCopy) {\n frameCopy.fields = fields;\n } else {\n frameCopy = {\n ...frame,\n fields,\n };\n }\n }\n\n return frameCopy;\n }\n\n const nullModes: JoinNullMode[][] = [];\n const allData: AlignedData[] = [];\n const originalFields: Field[] = [];\n const joinFieldMatcher = getJoinMatcher(options);\n\n for (let frameIndex = 0; frameIndex < options.frames.length; frameIndex++) {\n const frame = options.frames[frameIndex];\n\n if (!frame || !frame.fields?.length) {\n continue; // skip the frame\n }\n\n const nullModesFrame: JoinNullMode[] = [NULL_REMOVE];\n let join: Field | undefined = undefined;\n let fields: Field[] = [];\n\n for (let fieldIndex = 0; fieldIndex < frame.fields.length; fieldIndex++) {\n const field = frame.fields[fieldIndex];\n field.state = field.state || {};\n\n if (!join && joinFieldMatcher(field, frame, options.frames)) {\n join = field;\n } else {\n if (options.keep && !options.keep(field, frame, options.frames)) {\n continue; // skip field\n }\n\n // Support the standard graph span nulls field config\n let spanNulls = field.config.custom?.spanNulls;\n nullModesFrame.push(spanNulls === true ? NULL_REMOVE : spanNulls === -1 ? NULL_RETAIN : NULL_EXPAND);\n\n let labels = field.labels ?? {};\n if (frame.name) {\n labels = { ...labels, name: frame.name };\n }\n\n fields.push({\n ...field,\n labels, // add the name label from frame\n });\n }\n\n if (options.keepOriginIndices) {\n field.state.origin = {\n frameIndex,\n fieldIndex,\n };\n }\n }\n\n if (!join) {\n continue; // skip the frame\n }\n\n if (originalFields.length === 0) {\n originalFields.push(join); // first join field\n }\n\n nullModes.push(nullModesFrame);\n const a: AlignedData = [join.values.toArray()]; //\n\n for (const field of fields) {\n a.push(field.values.toArray());\n originalFields.push(field);\n // clear field displayName state\n delete field.state?.displayName;\n }\n\n allData.push(a);\n }\n\n const joined = join(allData, nullModes);\n\n return {\n // ...options.data[0], // keep name, meta?\n length: joined[0].length,\n fields: originalFields.map((f, index) => ({\n ...f,\n values: new ArrayVector(joined[index]),\n })),\n };\n}\n\n//--------------------------------------------------------------------------------\n// Below here is copied from uplot (MIT License)\n// https://github.com/leeoniya/uPlot/blob/master/src/utils.js#L325\n// This avoids needing to import uplot into the data package\n//--------------------------------------------------------------------------------\n\n// Copied from uplot\nexport type AlignedData = [number[], ...Array>];\n\n// nullModes\nconst NULL_REMOVE = 0; // nulls are converted to undefined (e.g. for spanGaps: true)\nconst NULL_RETAIN = 1; // nulls are retained, with alignment artifacts set to undefined (default)\nconst NULL_EXPAND = 2; // nulls are expanded to include any adjacent alignment artifacts\n\ntype JoinNullMode = number; // NULL_IGNORE | NULL_RETAIN | NULL_EXPAND;\n\n// sets undefined values to nulls when adjacent to existing nulls (minesweeper)\nfunction nullExpand(yVals: Array, nullIdxs: number[], alignedLen: number) {\n for (let i = 0, xi, lastNullIdx = -1; i < nullIdxs.length; i++) {\n let nullIdx = nullIdxs[i];\n\n if (nullIdx > lastNullIdx) {\n xi = nullIdx - 1;\n while (xi >= 0 && yVals[xi] == null) {\n yVals[xi--] = null;\n }\n\n xi = nullIdx + 1;\n while (xi < alignedLen && yVals[xi] == null) {\n yVals[(lastNullIdx = xi++)] = null;\n }\n }\n }\n}\n\n// nullModes is a tables-matched array indicating how to treat nulls in each series\nexport function join(tables: AlignedData[], nullModes?: number[][]) {\n const xVals = new Set();\n\n for (let ti = 0; ti < tables.length; ti++) {\n let t = tables[ti];\n let xs = t[0];\n let len = xs.length;\n\n for (let i = 0; i < len; i++) {\n xVals.add(xs[i]);\n }\n }\n\n let data = [Array.from(xVals).sort((a, b) => a - b)];\n\n let alignedLen = data[0].length;\n\n let xIdxs = new Map();\n\n for (let i = 0; i < alignedLen; i++) {\n xIdxs.set(data[0][i], i);\n }\n\n for (let ti = 0; ti < tables.length; ti++) {\n let t = tables[ti];\n let xs = t[0];\n\n for (let si = 1; si < t.length; si++) {\n let ys = t[si];\n\n let yVals = Array(alignedLen).fill(undefined);\n\n let nullMode = nullModes ? nullModes[ti][si] : NULL_RETAIN;\n\n let nullIdxs = [];\n\n for (let i = 0; i < ys.length; i++) {\n let yVal = ys[i];\n let alignedIdx = xIdxs.get(xs[i]);\n\n if (yVal === null) {\n if (nullMode !== NULL_REMOVE) {\n yVals[alignedIdx] = yVal;\n\n if (nullMode === NULL_EXPAND) {\n nullIdxs.push(alignedIdx);\n }\n }\n } else {\n yVals[alignedIdx] = yVal;\n }\n }\n\n nullExpand(yVals, nullIdxs, alignedLen);\n\n data.push(yVals);\n }\n }\n\n return data;\n}\n\n// Quick test if the first and last points look to be ascending\n// Only exported for tests\nexport function isLikelyAscendingVector(data: Vector): boolean {\n let first: any = undefined;\n\n for (let idx = 0; idx < data.length; idx++) {\n const v = data.get(idx);\n if (v != null) {\n if (first != null) {\n if (first > v) {\n return false; // descending\n }\n break;\n }\n first = v;\n }\n }\n\n let idx = data.length - 1;\n while (idx >= 0) {\n const v = data.get(idx--);\n if (v != null) {\n if (first > v) {\n return false;\n }\n return true;\n }\n }\n\n return true; // only one non-null point\n}\n","import { map } from 'rxjs/operators';\n\nimport { DataTransformerID } from './ids';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport { DataFrame, Field } from '../../types/dataFrame';\nimport { omit } from 'lodash';\nimport { ArrayVector } from '../../vector/ArrayVector';\nimport { MutableDataFrame } from '../../dataframe';\n\ninterface ValuePointer {\n key: string;\n index: number;\n}\n\nexport interface MergeTransformerOptions {}\n\nexport const mergeTransformer: DataTransformerInfo = {\n id: DataTransformerID.merge,\n name: 'Merge series/tables',\n description: 'Merges multiple series/tables into a single serie/table',\n defaultOptions: {},\n operator: (options) => (source) =>\n source.pipe(\n map((dataFrames) => {\n if (!Array.isArray(dataFrames) || dataFrames.length <= 1) {\n return dataFrames;\n }\n\n const data = dataFrames.filter((frame) => frame.fields.length > 0);\n\n if (data.length === 0) {\n return [dataFrames[0]];\n }\n\n const fieldNames = new Set();\n const fieldIndexByName: Record> = {};\n const fieldNamesForKey: string[] = [];\n const dataFrame = new MutableDataFrame();\n\n for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n const frame = data[frameIndex];\n\n for (let fieldIndex = 0; fieldIndex < frame.fields.length; fieldIndex++) {\n const field = frame.fields[fieldIndex];\n\n if (!fieldNames.has(field.name)) {\n dataFrame.addField(copyFieldStructure(field));\n fieldNames.add(field.name);\n }\n\n fieldIndexByName[field.name] = fieldIndexByName[field.name] || {};\n fieldIndexByName[field.name][frameIndex] = fieldIndex;\n\n if (data.length - 1 !== frameIndex) {\n continue;\n }\n\n if (fieldExistsInAllFrames(fieldIndexByName, field, data)) {\n fieldNamesForKey.push(field.name);\n }\n }\n }\n\n if (fieldNamesForKey.length === 0) {\n return dataFrames;\n }\n\n const valuesByKey: Record>> = {};\n const valuesInOrder: ValuePointer[] = [];\n const keyFactory = createKeyFactory(data, fieldIndexByName, fieldNamesForKey);\n const valueMapper = createValueMapper(data, fieldNames, fieldIndexByName);\n\n for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n const frame = data[frameIndex];\n\n for (let valueIndex = 0; valueIndex < frame.length; valueIndex++) {\n const key = keyFactory(frameIndex, valueIndex);\n const value = valueMapper(frameIndex, valueIndex);\n\n if (!Array.isArray(valuesByKey[key])) {\n valuesByKey[key] = [value];\n valuesInOrder.push(createPointer(key, valuesByKey));\n continue;\n }\n\n let valueWasMerged = false;\n\n valuesByKey[key] = valuesByKey[key].map((existing) => {\n if (!isMergable(existing, value)) {\n return existing;\n }\n valueWasMerged = true;\n return { ...existing, ...value };\n });\n\n if (!valueWasMerged) {\n valuesByKey[key].push(value);\n valuesInOrder.push(createPointer(key, valuesByKey));\n }\n }\n }\n\n for (const pointer of valuesInOrder) {\n const value = valuesByKey[pointer.key][pointer.index];\n\n if (value) {\n dataFrame.add(value);\n }\n }\n\n return [dataFrame];\n })\n ),\n};\n\nconst copyFieldStructure = (field: Field): Field => {\n return {\n ...omit(field, ['values', 'state', 'labels', 'config']),\n values: new ArrayVector(),\n config: {\n ...omit(field.config, 'displayName'),\n },\n };\n};\n\nconst createKeyFactory = (\n data: DataFrame[],\n fieldPointerByName: Record>,\n keyFieldNames: string[]\n) => {\n const factoryIndex = keyFieldNames.reduce((index: Record, fieldName) => {\n return Object.keys(fieldPointerByName[fieldName]).reduce((index: Record, frameIndex) => {\n index[frameIndex] = index[frameIndex] || [];\n index[frameIndex].push(fieldPointerByName[fieldName][frameIndex]);\n return index;\n }, index);\n }, {});\n\n return (frameIndex: number, valueIndex: number): string => {\n return factoryIndex[frameIndex].reduce((key: string, fieldIndex: number) => {\n return key + data[frameIndex].fields[fieldIndex].values.get(valueIndex);\n }, '');\n };\n};\n\nconst createValueMapper = (\n data: DataFrame[],\n fieldByName: Set,\n fieldIndexByName: Record>\n) => {\n return (frameIndex: number, valueIndex: number) => {\n const value: Record = {};\n const fieldNames = Array.from(fieldByName);\n\n for (const fieldName of fieldNames) {\n const fieldIndexByFrameIndex = fieldIndexByName[fieldName];\n if (!fieldIndexByFrameIndex) {\n continue;\n }\n\n const fieldIndex = fieldIndexByFrameIndex[frameIndex];\n if (typeof fieldIndex !== 'number') {\n continue;\n }\n\n const frame = data[frameIndex];\n if (!frame || !frame.fields) {\n continue;\n }\n\n const field = frame.fields[fieldIndex];\n if (!field || !field.values) {\n continue;\n }\n\n value[fieldName] = field.values.get(valueIndex);\n }\n\n return value;\n };\n};\n\nconst isMergable = (existing: Record, value: Record): boolean => {\n let mergable = true;\n\n for (const prop in value) {\n if (typeof existing[prop] === 'undefined') {\n continue;\n }\n\n if (existing[prop] === null) {\n continue;\n }\n\n if (existing[prop] !== value[prop]) {\n mergable = false;\n break;\n }\n }\n\n return mergable;\n};\n\nconst fieldExistsInAllFrames = (\n fieldIndexByName: Record>,\n field: Field,\n data: DataFrame[]\n) => {\n return Object.keys(fieldIndexByName[field.name]).length === data.length;\n};\n\nconst createPointer = (key: string, valuesByKey: Record>>): ValuePointer => {\n return {\n key,\n index: valuesByKey[key].length - 1,\n };\n};\n","import { DataTransformerID } from './ids';\nimport { DataTransformerInfo } from '../../types/transformations';\n\nexport interface NoopTransformerOptions {\n include?: string;\n exclude?: string;\n}\n\nexport const noopTransformer: DataTransformerInfo = {\n id: DataTransformerID.noop,\n name: 'noop',\n description: 'No-operation transformer',\n defaultOptions: {},\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options: NoopTransformerOptions) => (source) => source,\n};\n","import { DataTransformerID } from './ids';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport { orderFieldsTransformer, OrderFieldsTransformerOptions } from './order';\nimport { filterFieldsByNameTransformer } from './filterByName';\nimport { renameFieldsTransformer, RenameFieldsTransformerOptions } from './rename';\n\nexport interface OrganizeFieldsTransformerOptions\n extends OrderFieldsTransformerOptions,\n RenameFieldsTransformerOptions {\n excludeByName: Record;\n}\n\nexport const organizeFieldsTransformer: DataTransformerInfo = {\n id: DataTransformerID.organize,\n name: 'Organize fields by name',\n description: 'Order, filter and rename fields based on configuration given by user',\n defaultOptions: {\n excludeByName: {},\n indexByName: {},\n renameByName: {},\n },\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options) => (source) =>\n source.pipe(\n filterFieldsByNameTransformer.operator({\n exclude: { names: mapToExcludeArray(options.excludeByName) },\n }),\n orderFieldsTransformer.operator(options),\n renameFieldsTransformer.operator(options)\n ),\n};\n\nconst mapToExcludeArray = (excludeByName: Record): string[] => {\n if (!excludeByName) {\n return [];\n }\n\n return Object.keys(excludeByName).filter((name) => excludeByName[name]);\n};\n","import { DataTransformerID } from './ids';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport { DataFrame, Field } from '../../types/dataFrame';\nimport { getFieldDisplayName } from '../../field/fieldState';\nimport { map } from 'rxjs/operators';\n\nexport interface RenameFieldsTransformerOptions {\n renameByName: Record;\n}\n\nexport const renameFieldsTransformer: DataTransformerInfo = {\n id: DataTransformerID.rename,\n name: 'Rename fields by name',\n description: 'Rename fields based on configuration given by user',\n defaultOptions: {\n renameByName: {},\n },\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options) => (source) =>\n source.pipe(\n map((data) => {\n const renamer = createRenamer(options.renameByName);\n\n if (!Array.isArray(data) || data.length === 0) {\n return data;\n }\n\n return data.map((frame) => ({\n ...frame,\n fields: renamer(frame),\n }));\n })\n ),\n};\n\nconst createRenamer =\n (renameByName: Record) =>\n (frame: DataFrame): Field[] => {\n if (!renameByName || Object.keys(renameByName).length === 0) {\n return frame.fields;\n }\n\n return frame.fields.map((field) => {\n const displayName = getFieldDisplayName(field, frame);\n const renameTo = renameByName[displayName];\n\n if (typeof renameTo !== 'string' || renameTo.length === 0) {\n return field;\n }\n\n return {\n ...field,\n config: {\n ...field.config,\n displayName: renameTo,\n },\n state: {\n ...field.state,\n displayName: renameTo,\n },\n };\n });\n };\n","import { map } from 'rxjs/operators';\n\nimport { DataFrame, SynchronousDataTransformerInfo, FieldMatcher } from '../../types';\nimport { DataTransformerID } from './ids';\nimport { outerJoinDataFrames } from './joinDataFrames';\nimport { fieldMatchers } from '../matchers';\nimport { FieldMatcherID } from '../matchers/ids';\n\nexport interface SeriesToColumnsOptions {\n byField?: string; // empty will pick the field automatically\n}\n\nexport const seriesToColumnsTransformer: SynchronousDataTransformerInfo = {\n id: DataTransformerID.seriesToColumns,\n name: 'Series as columns', // Called 'Outer join' in the UI!\n description: 'Groups series by field and returns values as columns',\n defaultOptions: {\n byField: undefined, // DEFAULT_KEY_FIELD,\n },\n\n operator: (options) => (source) => source.pipe(map((data) => seriesToColumnsTransformer.transformer(options)(data))),\n\n transformer: (options: SeriesToColumnsOptions) => {\n let joinBy: FieldMatcher | undefined = undefined;\n return (data: DataFrame[]) => {\n if (data.length > 1) {\n if (options.byField && !joinBy) {\n joinBy = fieldMatchers.get(FieldMatcherID.byName).get(options.byField);\n }\n const joined = outerJoinDataFrames({ frames: data, joinBy });\n if (joined) {\n return [joined];\n }\n }\n return data;\n };\n },\n};\n","import { omit } from 'lodash';\nimport { map } from 'rxjs/operators';\n\nimport { DataTransformerID } from './ids';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport {\n Field,\n FieldType,\n TIME_SERIES_METRIC_FIELD_NAME,\n TIME_SERIES_TIME_FIELD_NAME,\n TIME_SERIES_VALUE_FIELD_NAME,\n} from '../../types/dataFrame';\nimport { isTimeSeries } from '../../dataframe/utils';\nimport { MutableDataFrame, sortDataFrame } from '../../dataframe';\nimport { ArrayVector } from '../../vector';\nimport { getFrameDisplayName } from '../../field/fieldState';\n\nexport interface SeriesToRowsTransformerOptions {}\n\nexport const seriesToRowsTransformer: DataTransformerInfo = {\n id: DataTransformerID.seriesToRows,\n name: 'Series to rows',\n description: 'Combines multiple series into a single serie and appends a column with metric name per value.',\n defaultOptions: {},\n operator: (options) => (source) =>\n source.pipe(\n map((data) => {\n if (!Array.isArray(data) || data.length <= 1) {\n return data;\n }\n\n if (!isTimeSeries(data)) {\n return data;\n }\n\n const timeFieldByIndex: Record = {};\n const targetFields = new Set();\n const dataFrame = new MutableDataFrame();\n const metricField: Field = {\n name: TIME_SERIES_METRIC_FIELD_NAME,\n values: new ArrayVector(),\n config: {},\n type: FieldType.string,\n };\n\n for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n const frame = data[frameIndex];\n\n for (let fieldIndex = 0; fieldIndex < frame.fields.length; fieldIndex++) {\n const field = frame.fields[fieldIndex];\n\n if (field.type === FieldType.time) {\n timeFieldByIndex[frameIndex] = fieldIndex;\n\n if (!targetFields.has(TIME_SERIES_TIME_FIELD_NAME)) {\n dataFrame.addField(copyFieldStructure(field, TIME_SERIES_TIME_FIELD_NAME));\n dataFrame.addField(metricField);\n targetFields.add(TIME_SERIES_TIME_FIELD_NAME);\n }\n continue;\n }\n\n if (!targetFields.has(TIME_SERIES_VALUE_FIELD_NAME)) {\n dataFrame.addField(copyFieldStructure(field, TIME_SERIES_VALUE_FIELD_NAME));\n targetFields.add(TIME_SERIES_VALUE_FIELD_NAME);\n }\n }\n }\n\n for (let frameIndex = 0; frameIndex < data.length; frameIndex++) {\n const frame = data[frameIndex];\n\n for (let valueIndex = 0; valueIndex < frame.length; valueIndex++) {\n const timeFieldIndex = timeFieldByIndex[frameIndex];\n const valueFieldIndex = timeFieldIndex === 0 ? 1 : 0;\n\n dataFrame.add({\n [TIME_SERIES_TIME_FIELD_NAME]: frame.fields[timeFieldIndex].values.get(valueIndex),\n [TIME_SERIES_METRIC_FIELD_NAME]: getFrameDisplayName(frame),\n [TIME_SERIES_VALUE_FIELD_NAME]: frame.fields[valueFieldIndex].values.get(valueIndex),\n });\n }\n }\n\n return [sortDataFrame(dataFrame, 0, true)];\n })\n ),\n};\n\nconst copyFieldStructure = (field: Field, name: string): Field => {\n return {\n ...omit(field, ['values', 'state', 'labels', 'config', 'name']),\n name: name,\n values: new ArrayVector(),\n config: {\n ...omit(field.config, ['displayName', 'displayNameFromDS']),\n },\n };\n};\n","import { map } from 'rxjs/operators';\n\nimport { DataTransformerID } from './ids';\nimport { DataTransformerInfo } from '../../types/transformations';\nimport { DataFrame } from '../../types';\nimport { getFieldDisplayName } from '../../field';\nimport { sortDataFrame } from '../../dataframe';\n\nexport interface SortByField {\n field: string;\n desc?: boolean;\n index?: number;\n}\n\nexport interface SortByTransformerOptions {\n // NOTE: this structure supports an array, however only the first entry is used\n // future versions may support multi-sort options\n sort: SortByField[];\n}\n\nexport const sortByTransformer: DataTransformerInfo = {\n id: DataTransformerID.sortBy,\n name: 'Sort by',\n description: 'Sort fields in a frame',\n defaultOptions: {\n fields: {},\n },\n\n /**\n * Return a modified copy of the series. If the transform is not or should not\n * be applied, just return the input series\n */\n operator: (options) => (source) =>\n source.pipe(\n map((data) => {\n if (!Array.isArray(data) || data.length === 0 || !options?.sort?.length) {\n return data;\n }\n return sortDataFrames(data, options.sort);\n })\n ),\n};\n\nexport function sortDataFrames(data: DataFrame[], sort: SortByField[]): DataFrame[] {\n return data.map((frame) => {\n const s = attachFieldIndex(frame, sort);\n if (s.length && s[0].index != null) {\n return sortDataFrame(frame, s[0].index, s[0].desc);\n }\n return frame;\n });\n}\n\nfunction attachFieldIndex(frame: DataFrame, sort: SortByField[]): SortByField[] {\n return sort.map((s) => {\n if (s.index != null) {\n // null or undefined\n return s;\n }\n return {\n ...s,\n index: frame.fields.findIndex((f) => s.field === getFieldDisplayName(f, frame)),\n };\n });\n}\n","import { DataFrameDTO, FieldConfig } from './dataFrame';\nimport { DataTransformerConfig } from './transformations';\nimport { ApplyFieldOverrideOptions } from './fieldOverrides';\nimport { PanelPluginDataSupport } from '.';\nimport { DataTopic } from './query';\nimport { DataFrameType } from './dataFrameTypes';\n\nexport type KeyValue = Record;\n\n/**\n * Represent panel data loading state.\n * @public\n */\nexport enum LoadingState {\n NotStarted = 'NotStarted',\n Loading = 'Loading',\n Streaming = 'Streaming',\n Done = 'Done',\n Error = 'Error',\n}\n\n// Should be kept in sync with grafana-plugin-sdk-go/data/frame_meta.go\nexport type PreferredVisualisationType = 'graph' | 'table' | 'logs' | 'trace' | 'nodeGraph';\n\n/**\n * @public\n */\nexport interface QueryResultMeta {\n type?: DataFrameType;\n\n /** DatasSource Specific Values */\n custom?: Record;\n\n /** Stats */\n stats?: QueryResultMetaStat[];\n\n /** Meta Notices */\n notices?: QueryResultMetaNotice[];\n\n /** Used to track transformation ids that where part of the processing */\n transformations?: string[];\n\n /** Currently used to show results in Explore only in preferred visualisation option */\n preferredVisualisationType?: PreferredVisualisationType;\n\n /** The path for live stream updates for this frame */\n channel?: string;\n\n /**\n * Optionally identify which topic the frame should be assigned to.\n * A value specified in the response will override what the request asked for.\n */\n dataTopic?: DataTopic;\n\n /**\n * This is the raw query sent to the underlying system. All macros and templating\n * as been applied. When metadata contains this value, it will be shown in the query inspector\n */\n executedQueryString?: string;\n\n /**\n * A browsable path on the datasource\n */\n path?: string;\n\n /**\n * defaults to '/'\n */\n pathSeparator?: string;\n\n /**\n * Legacy data source specific, should be moved to custom\n * */\n alignmentPeriod?: number; // used by cloud monitoring\n searchWords?: string[]; // used by log models and loki\n limit?: number; // used by log models and loki\n json?: boolean; // used to keep track of old json doc values\n instant?: boolean;\n}\n\nexport interface QueryResultMetaStat extends FieldConfig {\n displayName: string;\n value: number;\n}\n\n/**\n * QueryResultMetaNotice is a structure that provides user notices for query result data\n * @public\n */\nexport interface QueryResultMetaNotice {\n /**\n * Specify the notice severity\n */\n severity: 'info' | 'warning' | 'error';\n\n /**\n * Notice descriptive text\n */\n text: string;\n\n /**\n * An optional link that may be displayed in the UI.\n * This value may be an absolute URL or relative to grafana root\n */\n link?: string;\n\n /**\n * Optionally suggest an appropriate tab for the panel inspector\n */\n inspect?: 'meta' | 'error' | 'data' | 'stats';\n}\n\n/**\n * @public\n */\nexport interface QueryResultBase {\n /**\n * Matches the query target refId\n */\n refId?: string;\n\n /**\n * Used by some backend data sources to communicate back info about the execution (generated sql, timing)\n */\n meta?: QueryResultMeta;\n}\n\nexport interface Labels {\n [key: string]: string;\n}\nexport interface Column {\n text: string; // For a Column, the 'text' is the field name\n filterable?: boolean;\n unit?: string;\n custom?: Record;\n}\n\nexport interface TableData extends QueryResultBase {\n name?: string;\n columns: Column[];\n rows: any[][];\n type?: string;\n}\n\nexport type TimeSeriesValue = number | null;\n\nexport type TimeSeriesPoints = TimeSeriesValue[][];\n\nexport interface TimeSeries extends QueryResultBase {\n target: string;\n /**\n * If name is manually configured via an alias / legend pattern\n */\n title?: string;\n datapoints: TimeSeriesPoints;\n unit?: string;\n tags?: Labels;\n}\n\nexport enum NullValueMode {\n Null = 'null',\n Ignore = 'connected',\n AsZero = 'null as zero',\n}\n\n/**\n * Describes and API for exposing panel specific data configurations.\n */\nexport interface DataConfigSource {\n configRev?: number;\n getDataSupport: () => PanelPluginDataSupport;\n getTransformations: () => DataTransformerConfig[] | undefined;\n getFieldOverrideOptions: () => ApplyFieldOverrideOptions | undefined;\n snapshotData?: DataFrameDTO[];\n}\n","import { ThresholdsConfig } from './thresholds';\nimport { ValueMapping } from './valueMapping';\nimport { QueryResultBase, Labels, NullValueMode } from './data';\nimport { DisplayProcessor, DisplayValue } from './displayValue';\nimport { DataLink, LinkModel } from './dataLink';\nimport { Vector } from './vector';\nimport { FieldColor } from './fieldColor';\nimport { ScopedVars } from './ScopedVars';\n\n/** @public */\nexport enum FieldType {\n time = 'time', // or date\n number = 'number',\n string = 'string',\n boolean = 'boolean',\n // Used to detect that the value is some kind of trace data to help with the visualisation and processing.\n trace = 'trace',\n geo = 'geo',\n other = 'other', // Object, Array, etc\n}\n\n/**\n * @public\n * Every property is optional\n *\n * Plugins may extend this with additional properties. Something like series overrides\n */\nexport interface FieldConfig {\n /**\n * The display value for this field. This supports template variables blank is auto\n */\n displayName?: string;\n\n /**\n * This can be used by data sources that return and explicit naming structure for values and labels\n * When this property is configured, this value is used rather than the default naming strategy.\n */\n displayNameFromDS?: string;\n\n /**\n * Human readable field metadata\n */\n description?: string;\n\n /**\n * An explict path to the field in the datasource. When the frame meta includes a path,\n * This will default to `${frame.meta.path}/${field.name}\n *\n * When defined, this value can be used as an identifier within the datasource scope, and\n * may be used to update the results\n */\n path?: string;\n\n /**\n * True if data source can write a value to the path. Auth/authz are supported separately\n */\n writeable?: boolean;\n\n /**\n * True if data source field supports ad-hoc filters\n */\n filterable?: boolean;\n\n // Numeric Options\n unit?: string;\n decimals?: number | null; // Significant digits (for display)\n min?: number | null;\n max?: number | null;\n\n // Convert input values into a display string\n mappings?: ValueMapping[];\n\n // Map numeric values to states\n thresholds?: ThresholdsConfig;\n\n // Map values to a display color\n color?: FieldColor;\n\n // Used when reducing field values\n nullValueMode?: NullValueMode;\n\n // The behavior when clicking on a result\n links?: DataLink[];\n\n // Alternative to empty string\n noValue?: string;\n\n // Panel Specific Values\n custom?: TOptions;\n}\n\n/** @public */\nexport interface ValueLinkConfig {\n /**\n * Result of field reduction\n */\n calculatedValue?: DisplayValue;\n /**\n * Index of the value row within Field. Should be provided only when value is not a result of a reduction\n */\n valueRowIndex?: number;\n}\n\nexport interface Field> {\n /**\n * Name of the field (column)\n */\n name: string;\n /**\n * Field value type (string, number, etc)\n */\n type: FieldType;\n /**\n * Meta info about how field and how to display it\n */\n config: FieldConfig;\n values: V; // The raw field values\n labels?: Labels;\n\n /**\n * Cached values with appropriate display and id values\n */\n state?: FieldState | null;\n\n /**\n * Convert a value for display\n */\n display?: DisplayProcessor;\n\n /**\n * Get value data links with variables interpolated\n */\n getLinks?: (config: ValueLinkConfig) => Array>;\n}\n\n/** @alpha */\nexport interface FieldState {\n /**\n * An appropriate name for the field (does not include frame info)\n */\n displayName?: string | null;\n\n /**\n * Cache of reduced values\n */\n calcs?: FieldCalcs;\n\n /**\n * The numeric range for values in this field. This value will respect the min/max\n * set in field config, or when set to `auto` this will have the min/max for all data\n * in the response\n */\n range?: NumericRange;\n\n /**\n * Appropriate values for templating\n */\n scopedVars?: ScopedVars;\n\n /**\n * Series index is index for this field in a larger data set that can span multiple DataFrames\n * Useful for assigning color to series by looking up a color in a palette using this index\n */\n seriesIndex?: number;\n\n /**\n * Location of this field within the context frames results\n *\n * @internal -- we will try to make this unnecessary\n */\n origin?: DataFrameFieldIndex;\n}\n\n/** @public */\nexport interface NumericRange {\n min?: number | null;\n max?: number | null;\n delta: number;\n}\n\nexport interface DataFrame extends QueryResultBase {\n name?: string;\n fields: Field[]; // All fields of equal length\n\n // The number of rows\n length: number;\n}\n\n/**\n * @public\n * Like a field, but properties are optional and values may be a simple array\n */\nexport interface FieldDTO {\n name: string; // The column name\n type?: FieldType;\n config?: FieldConfig;\n values?: Vector | T[]; // toJSON will always be T[], input could be either\n labels?: Labels;\n}\n\n/**\n * @public\n * Like a DataFrame, but fields may be a FieldDTO\n */\nexport interface DataFrameDTO extends QueryResultBase {\n name?: string;\n fields: Array;\n}\n\nexport interface FieldCalcs extends Record {}\n\nexport const TIME_SERIES_VALUE_FIELD_NAME = 'Value';\nexport const TIME_SERIES_TIME_FIELD_NAME = 'Time';\nexport const TIME_SERIES_METRIC_FIELD_NAME = 'Metric';\n\n/**\n * Describes where a specific data frame field is located within a\n * dataset of type DataFrame[]\n *\n * @internal -- we will try to make this unnecessary\n */\nexport interface DataFrameFieldIndex {\n frameIndex: number;\n fieldIndex: number;\n}\n","/**\n * @public\n */\nexport enum FieldColorModeId {\n Thresholds = 'thresholds',\n PaletteClassic = 'palette-classic',\n PaletteSaturated = 'palette-saturated',\n ContinuousGrYlRd = 'continuous-GrYlRd',\n Fixed = 'fixed',\n}\n\n/**\n * @public\n */\nexport interface FieldColor {\n /** The main color scheme mode */\n mode: FieldColorModeId | string;\n /** Stores the fixed color value if mode is fixed */\n fixedColor?: string;\n /** Some visualizations need to know how to assign a series color from by value color schemes */\n seriesBy?: FieldColorSeriesByMode;\n}\n\n/**\n * @beta\n */\nexport type FieldColorSeriesByMode = 'min' | 'max' | 'last';\n\nexport const FALLBACK_COLOR = 'gray';\n","import { ThemeVisualizationColors } from '../themes';\n\nexport enum GrafanaThemeType {\n Light = 'light',\n Dark = 'dark',\n}\n\nexport interface GrafanaThemeCommons {\n name: string;\n // TODO: not sure if should be a part of theme\n breakpoints: {\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n xxl: string;\n };\n typography: {\n fontFamily: {\n sansSerif: string;\n monospace: string;\n };\n size: {\n base: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n };\n weight: {\n light: number;\n regular: number;\n semibold: number;\n bold: number;\n };\n lineHeight: {\n xs: number; //1\n sm: number; //1.1\n md: number; // 4/3\n lg: number; // 1.5\n };\n // TODO: Refactor to use size instead of custom defs\n heading: {\n h1: string;\n h2: string;\n h3: string;\n h4: string;\n h5: string;\n h6: string;\n };\n link: {\n decoration: string;\n hoverDecoration: string;\n };\n };\n spacing: {\n base: number;\n insetSquishMd: string;\n d: string;\n xxs: string;\n xs: string;\n sm: string;\n md: string;\n lg: string;\n xl: string;\n gutter: string;\n\n // Next-gen forms spacing variables\n // TODO: Move variables definition to respective components when implementing\n formSpacingBase: number;\n formMargin: string;\n formFieldsetMargin: string;\n formInputHeight: number;\n formButtonHeight: number;\n formInputPaddingHorizontal: string;\n // Used for icons do define spacing between icon and input field\n // Applied on the right(prefix) or left(suffix)\n formInputAffixPaddingHorizontal: string;\n formInputMargin: string;\n formLabelPadding: string;\n formLabelMargin: string;\n formValidationMessagePadding: string;\n formValidationMessageMargin: string;\n inlineFormMargin: string;\n };\n border: {\n radius: {\n sm: string;\n md: string;\n lg: string;\n };\n width: {\n sm: string;\n };\n };\n height: {\n sm: number;\n md: number;\n lg: number;\n };\n panelPadding: number;\n panelHeaderHeight: number;\n zIndex: {\n dropdown: number;\n navbarFixed: number;\n sidemenu: number;\n tooltip: number;\n modalBackdrop: number;\n modal: number;\n portal: number;\n typeahead: number;\n };\n}\n\nexport interface GrafanaTheme extends GrafanaThemeCommons {\n type: GrafanaThemeType;\n isDark: boolean;\n isLight: boolean;\n palette: {\n black: string;\n white: string;\n dark1: string;\n dark2: string;\n dark3: string;\n dark4: string;\n dark5: string;\n dark6: string;\n dark7: string;\n dark8: string;\n dark9: string;\n dark10: string;\n gray1: string;\n gray2: string;\n gray3: string;\n gray4: string;\n gray5: string;\n gray6: string;\n gray7: string;\n\n // New greys palette used by next-gen form elements\n gray98: string;\n gray97: string;\n gray95: string;\n gray90: string;\n gray85: string;\n gray70: string;\n gray60: string;\n gray33: string;\n gray25: string;\n gray15: string;\n gray10: string;\n gray05: string;\n\n // New blues palette used by next-gen form elements\n blue95: string;\n blue85: string;\n blue80: string;\n blue77: string;\n\n // New reds palette used by next-gen form elements\n red88: string;\n\n // Accent colors\n redBase: string;\n redShade: string;\n greenBase: string;\n greenShade: string;\n red: string;\n yellow: string;\n purple: string;\n orange: string;\n orangeDark: string;\n queryRed: string;\n queryGreen: string;\n queryPurple: string;\n queryOrange: string;\n brandPrimary: string;\n brandSuccess: string;\n brandWarning: string;\n brandDanger: string;\n\n // Status colors\n online: string;\n warn: string;\n critical: string;\n };\n colors: {\n bg1: string;\n bg2: string;\n bg3: string;\n border1: string;\n border2: string;\n border3: string;\n\n bgBlue1: string;\n bgBlue2: string;\n\n dashboardBg: string;\n bodyBg: string;\n panelBg: string;\n panelBorder: string;\n pageHeaderBg: string;\n pageHeaderBorder: string;\n\n dropdownBg: string;\n dropdownShadow: string;\n dropdownOptionHoverBg: string;\n\n // Link colors\n link: string;\n linkDisabled: string;\n linkHover: string;\n linkExternal: string;\n\n // Text colors\n textStrong: string;\n textHeading: string;\n text: string;\n textSemiWeak: string;\n textWeak: string;\n textFaint: string;\n textBlue: string;\n\n // Next-gen forms functional colors\n formLabel: string;\n formDescription: string;\n formInputBg: string;\n formInputBgDisabled: string;\n formInputBorder: string;\n formInputBorderHover: string;\n formInputBorderActive: string;\n formInputBorderInvalid: string;\n formFocusOutline: string;\n formInputText: string;\n formInputDisabledText: string;\n formInputPlaceholderText: string;\n formValidationMessageText: string;\n formValidationMessageBg: string;\n };\n shadows: {\n listItem: string;\n };\n visualization: ThemeVisualizationColors;\n}\n","export interface Threshold {\n value: number;\n color: string;\n /**\n * Warning, Error, LowLow, Low, OK, High, HighHigh etc\n */\n state?: string;\n}\n\n/**\n * Display mode\n */\nexport enum ThresholdsMode {\n Absolute = 'absolute',\n /**\n * between 0 and 1 (based on min/max)\n */\n Percentage = 'percentage',\n}\n\n/**\n * Config that is passed to the ThresholdsEditor\n */\nexport interface ThresholdsConfig {\n mode: ThresholdsMode;\n\n /**\n * Must be sorted by 'value', first value is always -Infinity\n */\n steps: Threshold[];\n}\n","/**\n * @alpha\n */\nexport enum MappingType {\n ValueToText = 'value', // was 1\n RangeToText = 'range', // was 2\n RegexToText = 'regex',\n SpecialValue = 'special',\n}\n\n/**\n * @alpha\n */\nexport interface ValueMappingResult {\n text?: string;\n color?: string;\n icon?: string;\n index?: number;\n}\n\n/**\n * @alpha\n */\ninterface BaseValueMap {\n type: MappingType;\n options: T;\n}\n\n/**\n * @alpha\n */\nexport interface ValueMap extends BaseValueMap> {\n type: MappingType.ValueToText;\n}\n\n/**\n * @alpha\n */\nexport interface RangeMapOptions {\n from: number | null; // changed from string\n to: number | null;\n result: ValueMappingResult;\n}\n\n/**\n * @alpha\n */\nexport interface RangeMap extends BaseValueMap {\n type: MappingType.RangeToText;\n}\n\n/**\n * @alpha\n */\nexport interface RegexMapOptions {\n pattern: string;\n result: ValueMappingResult;\n}\n\n/**\n * @alpha\n */\nexport interface RegexMap extends BaseValueMap {\n type: MappingType.RegexToText;\n}\n\n/**\n * @alpha\n */\nexport interface SpecialValueOptions {\n match: SpecialValueMatch;\n result: ValueMappingResult;\n}\n\n/**\n * @alpha\n */\nexport enum SpecialValueMatch {\n True = 'true',\n False = 'false',\n Null = 'null',\n NaN = 'nan',\n NullAndNaN = 'null+nan',\n Empty = 'empty',\n}\n\n/**\n * @alpha\n */\nexport interface SpecialValueMap extends BaseValueMap {\n type: MappingType.SpecialValue;\n}\n\n/**\n * @alpha\n */\nexport type ValueMapping = ValueMap | RangeMap | RegexMap | SpecialValueMap;\n","import { PluginState } from '../types';\nimport { SelectableValue } from '../types/select';\n\nexport interface RegistryItem {\n id: string; // Unique Key -- saved in configs\n name: string; // Display Name, can change without breaking configs\n description?: string;\n aliasIds?: string[]; // when the ID changes, we may want backwards compatibility ('current' => 'last')\n\n /**\n * Some extensions should not be user selectable\n * like: 'all' and 'any' matchers;\n */\n excludeFromPicker?: boolean;\n\n /**\n * Optional feature state\n */\n state?: PluginState;\n}\n\nexport interface RegistryItemWithOptions extends RegistryItem {\n /**\n * Convert the options to a string\n */\n getOptionsDisplayText?: (options: TOptions) => string;\n\n /**\n * Default options used if nothing else is specified\n */\n defaultOptions?: TOptions;\n}\n\ninterface RegistrySelectInfo {\n options: Array>;\n current: Array>;\n}\n\nexport class Registry {\n private ordered: T[] = [];\n private byId = new Map();\n private initialized = false;\n\n constructor(private init?: () => T[]) {}\n\n setInit = (init: () => T[]) => {\n if (this.initialized) {\n throw new Error('Registry already initialized');\n }\n this.init = init;\n };\n\n getIfExists(id: string | undefined): T | undefined {\n if (!this.initialized) {\n this.initialize();\n }\n\n if (id) {\n return this.byId.get(id);\n }\n\n return undefined;\n }\n\n private initialize() {\n if (this.init) {\n for (const ext of this.init()) {\n this.register(ext);\n }\n }\n this.sort();\n this.initialized = true;\n }\n\n get(id: string): T {\n const v = this.getIfExists(id);\n if (!v) {\n throw new Error(`\"${id}\" not found in: ${this.list().map((v) => v.id)}`);\n }\n return v;\n }\n\n selectOptions(current?: string[], filter?: (ext: T) => boolean): RegistrySelectInfo {\n if (!this.initialized) {\n this.initialize();\n }\n\n const select = {\n options: [],\n current: [],\n } as RegistrySelectInfo;\n\n const currentOptions: Record> = {};\n if (current) {\n for (const id of current) {\n currentOptions[id] = {};\n }\n }\n\n for (const ext of this.ordered) {\n if (ext.excludeFromPicker) {\n continue;\n }\n if (filter && !filter(ext)) {\n continue;\n }\n\n const option = {\n value: ext.id,\n label: ext.name,\n description: ext.description,\n };\n\n if (ext.state === PluginState.alpha) {\n option.label += ' (alpha)';\n }\n\n select.options.push(option);\n if (currentOptions[ext.id]) {\n currentOptions[ext.id] = option;\n }\n }\n\n if (current) {\n // this makes sure we preserve the order of ids\n select.current = Object.values(currentOptions);\n }\n\n return select;\n }\n\n /**\n * Return a list of values by ID, or all values if not specified\n */\n list(ids?: any[]): T[] {\n if (!this.initialized) {\n this.initialize();\n }\n\n if (ids) {\n const found: T[] = [];\n for (const id of ids) {\n const v = this.getIfExists(id);\n if (v) {\n found.push(v);\n }\n }\n return found;\n }\n\n return this.ordered;\n }\n\n isEmpty(): boolean {\n if (!this.initialized) {\n this.initialize();\n }\n\n return this.ordered.length === 0;\n }\n\n register(ext: T) {\n if (this.byId.has(ext.id)) {\n throw new Error('Duplicate Key:' + ext.id);\n }\n\n this.byId.set(ext.id, ext);\n this.ordered.push(ext);\n\n if (ext.aliasIds) {\n for (const alias of ext.aliasIds) {\n if (!this.byId.has(alias)) {\n this.byId.set(alias, ext);\n }\n }\n }\n\n if (this.initialized) {\n this.sort();\n }\n }\n\n private sort() {\n // TODO sort the list\n }\n}\n","import { toNumber } from 'lodash';\n\n/**\n * Will return any value as a number or NaN\n *\n * @internal\n * */\nexport function anyToNumber(value: any): number {\n if (typeof value === 'number') {\n return value;\n }\n\n if (value === '' || value === null || value === undefined || Array.isArray(value)) {\n return NaN; // lodash calls them 0\n }\n\n if (typeof value === 'boolean') {\n return value ? 1 : 0;\n }\n\n return toNumber(value);\n}\n","import { RegistryItem, Registry } from './Registry';\n\nexport enum BinaryOperationID {\n Add = '+',\n Subtract = '-',\n Divide = '/',\n Multiply = '*',\n}\n\nexport type BinaryOperation = (left: number, right: number) => number;\n\ninterface BinaryOperatorInfo extends RegistryItem {\n operation: BinaryOperation;\n}\n\nexport const binaryOperators = new Registry(() => {\n return [\n {\n id: BinaryOperationID.Add,\n name: 'Add',\n operation: (a: number, b: number) => a + b,\n },\n {\n id: BinaryOperationID.Subtract,\n name: 'Subtract',\n operation: (a: number, b: number) => a - b,\n },\n {\n id: BinaryOperationID.Multiply,\n name: 'Multiply',\n operation: (a: number, b: number) => a * b,\n },\n {\n id: BinaryOperationID.Divide,\n name: 'Divide',\n operation: (a: number, b: number) => a / b,\n },\n ];\n});\n","import { Field, FieldType } from '../types/dataFrame';\nimport { guessFieldTypeFromValue } from '../dataframe/processDataFrame';\n\nexport function makeFieldParser(value: any, field: Field): (value: string) => any {\n if (!field.type) {\n if (field.name === 'time' || field.name === 'Time') {\n field.type = FieldType.time;\n } else {\n field.type = guessFieldTypeFromValue(value);\n }\n }\n\n if (field.type === FieldType.number) {\n return (value: string) => {\n return parseFloat(value);\n };\n }\n\n // Will convert anything that starts with \"T\" to true\n if (field.type === FieldType.boolean) {\n return (value: string) => {\n return !(value[0] === 'F' || value[0] === 'f' || value[0] === '0');\n };\n }\n\n // Just pass the string back\n return (value: string) => value;\n}\n","/**\n * @beta\n * Proxies a ES6 class so that it can be used as a base class for an ES5 class\n */\nexport function makeClassES5Compatible(ES6Class: T): T {\n return new Proxy(ES6Class as any, {\n // ES5 code will call it like a function using super\n apply(target, self, argumentsList) {\n if (typeof Reflect === 'undefined' || !Reflect.construct) {\n alert('Browser is too old');\n }\n\n return Reflect.construct(target, argumentsList, self.constructor);\n },\n }) as unknown as T;\n}\n","import { toFixed, FormattedValue } from './valueFormats';\nimport { DecimalCount } from '../types/displayValue';\n\nexport function toPercent(size: number, decimals: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n return { text: toFixed(size, decimals), suffix: '%' };\n}\n\nexport function toPercentUnit(size: number, decimals: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n return { text: toFixed(100 * size, decimals), suffix: '%' };\n}\n\nexport function toHex0x(value: number, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: '' };\n }\n const asHex = toHex(value, decimals);\n if (asHex.text.substring(0, 1) === '-') {\n asHex.text = '-0x' + asHex.text.substring(1);\n } else {\n asHex.text = '0x' + asHex.text;\n }\n return asHex;\n}\n\nexport function toHex(value: number, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: '' };\n }\n return {\n text: parseFloat(toFixed(value, decimals)).toString(16).toUpperCase(),\n };\n}\n\nexport function sci(value: number, decimals: DecimalCount): FormattedValue {\n if (value == null) {\n return { text: '' };\n }\n return { text: value.toExponential(decimals as number) };\n}\n","import {\n locale,\n scaledUnits,\n simpleCountUnit,\n toFixedUnit,\n ValueFormatCategory,\n stringFormater,\n booleanValueFormatter,\n} from './valueFormats';\nimport {\n dateTimeAsIso,\n dateTimeAsIsoNoDateIfToday,\n dateTimeAsUS,\n dateTimeAsUSNoDateIfToday,\n getDateTimeAsLocalFormat,\n getDateTimeAsLocalFormatNoDateIfToday,\n dateTimeFromNow,\n toClockMilliseconds,\n toClockSeconds,\n toDays,\n toDurationInDaysHoursMinutesSeconds,\n toDurationInHoursMinutesSeconds,\n toDurationInMilliseconds,\n toDurationInSeconds,\n toHours,\n toMicroSeconds,\n toMilliSeconds,\n toMinutes,\n toNanoSeconds,\n toSeconds,\n toTimeTicks,\n dateTimeSystemFormatter,\n} from './dateTimeFormatters';\nimport { toHex, sci, toHex0x, toPercent, toPercentUnit } from './arithmeticFormatters';\nimport { binaryPrefix, currency, SIPrefix } from './symbolFormatters';\n\nexport const getCategories = (): ValueFormatCategory[] => [\n {\n name: 'Misc',\n formats: [\n { name: 'none', id: 'none', fn: toFixedUnit('') },\n { name: 'String', id: 'string', fn: stringFormater },\n {\n name: 'short',\n id: 'short',\n fn: scaledUnits(1000, ['', ' K', ' Mil', ' Bil', ' Tri', ' Quadr', ' Quint', ' Sext', ' Sept']),\n },\n { name: 'Percent (0-100)', id: 'percent', fn: toPercent },\n { name: 'Percent (0.0-1.0)', id: 'percentunit', fn: toPercentUnit },\n { name: 'Humidity (%H)', id: 'humidity', fn: toFixedUnit('%H') },\n { name: 'Decibel', id: 'dB', fn: toFixedUnit('dB') },\n { name: 'Hexadecimal (0x)', id: 'hex0x', fn: toHex0x },\n { name: 'Hexadecimal', id: 'hex', fn: toHex },\n { name: 'Scientific notation', id: 'sci', fn: sci },\n { name: 'Locale format', id: 'locale', fn: locale },\n { name: 'Pixels', id: 'pixel', fn: toFixedUnit('px') },\n ],\n },\n {\n name: 'Acceleration',\n formats: [\n { name: 'Meters/sec²', id: 'accMS2', fn: toFixedUnit('m/sec²') },\n { name: 'Feet/sec²', id: 'accFS2', fn: toFixedUnit('f/sec²') },\n { name: 'G unit', id: 'accG', fn: toFixedUnit('g') },\n ],\n },\n {\n name: 'Angle',\n formats: [\n { name: 'Degrees (°)', id: 'degree', fn: toFixedUnit('°') },\n { name: 'Radians', id: 'radian', fn: toFixedUnit('rad') },\n { name: 'Gradian', id: 'grad', fn: toFixedUnit('grad') },\n { name: 'Arc Minutes', id: 'arcmin', fn: toFixedUnit('arcmin') },\n { name: 'Arc Seconds', id: 'arcsec', fn: toFixedUnit('arcsec') },\n ],\n },\n {\n name: 'Area',\n formats: [\n { name: 'Square Meters (m²)', id: 'areaM2', fn: toFixedUnit('m²') },\n { name: 'Square Feet (ft²)', id: 'areaF2', fn: toFixedUnit('ft²') },\n { name: 'Square Miles (mi²)', id: 'areaMI2', fn: toFixedUnit('mi²') },\n ],\n },\n {\n name: 'Computation',\n formats: [\n { name: 'FLOP/s', id: 'flops', fn: SIPrefix('FLOPS') },\n { name: 'MFLOP/s', id: 'mflops', fn: SIPrefix('FLOPS', 2) },\n { name: 'GFLOP/s', id: 'gflops', fn: SIPrefix('FLOPS', 3) },\n { name: 'TFLOP/s', id: 'tflops', fn: SIPrefix('FLOPS', 4) },\n { name: 'PFLOP/s', id: 'pflops', fn: SIPrefix('FLOPS', 5) },\n { name: 'EFLOP/s', id: 'eflops', fn: SIPrefix('FLOPS', 6) },\n { name: 'ZFLOP/s', id: 'zflops', fn: SIPrefix('FLOPS', 7) },\n { name: 'YFLOP/s', id: 'yflops', fn: SIPrefix('FLOPS', 8) },\n ],\n },\n {\n name: 'Concentration',\n formats: [\n { name: 'parts-per-million (ppm)', id: 'ppm', fn: toFixedUnit('ppm') },\n { name: 'parts-per-billion (ppb)', id: 'conppb', fn: toFixedUnit('ppb') },\n { name: 'nanogram per cubic meter (ng/m³)', id: 'conngm3', fn: toFixedUnit('ng/m³') },\n { name: 'nanogram per normal cubic meter (ng/Nm³)', id: 'conngNm3', fn: toFixedUnit('ng/Nm³') },\n { name: 'microgram per cubic meter (μg/m³)', id: 'conμgm3', fn: toFixedUnit('μg/m³') },\n { name: 'microgram per normal cubic meter (μg/Nm³)', id: 'conμgNm3', fn: toFixedUnit('μg/Nm³') },\n { name: 'milligram per cubic meter (mg/m³)', id: 'conmgm3', fn: toFixedUnit('mg/m³') },\n { name: 'milligram per normal cubic meter (mg/Nm³)', id: 'conmgNm3', fn: toFixedUnit('mg/Nm³') },\n { name: 'gram per cubic meter (g/m³)', id: 'congm3', fn: toFixedUnit('g/m³') },\n { name: 'gram per normal cubic meter (g/Nm³)', id: 'congNm3', fn: toFixedUnit('g/Nm³') },\n { name: 'milligrams per decilitre (mg/dL)', id: 'conmgdL', fn: toFixedUnit('mg/dL') },\n { name: 'millimoles per litre (mmol/L)', id: 'conmmolL', fn: toFixedUnit('mmol/L') },\n ],\n },\n {\n name: 'Currency',\n formats: [\n { name: 'Dollars ($)', id: 'currencyUSD', fn: currency('$') },\n { name: 'Pounds (£)', id: 'currencyGBP', fn: currency('£') },\n { name: 'Euro (€)', id: 'currencyEUR', fn: currency('€') },\n { name: 'Yen (¥)', id: 'currencyJPY', fn: currency('¥') },\n { name: 'Rubles (₽)', id: 'currencyRUB', fn: currency('₽') },\n { name: 'Hryvnias (₴)', id: 'currencyUAH', fn: currency('₴') },\n { name: 'Real (R$)', id: 'currencyBRL', fn: currency('R$') },\n { name: 'Danish Krone (kr)', id: 'currencyDKK', fn: currency('kr', true) },\n { name: 'Icelandic Króna (kr)', id: 'currencyISK', fn: currency('kr', true) },\n { name: 'Norwegian Krone (kr)', id: 'currencyNOK', fn: currency('kr', true) },\n { name: 'Swedish Krona (kr)', id: 'currencySEK', fn: currency('kr', true) },\n { name: 'Czech koruna (czk)', id: 'currencyCZK', fn: currency('czk') },\n { name: 'Swiss franc (CHF)', id: 'currencyCHF', fn: currency('CHF') },\n { name: 'Polish Złoty (PLN)', id: 'currencyPLN', fn: currency('PLN') },\n { name: 'Bitcoin (฿)', id: 'currencyBTC', fn: currency('฿') },\n { name: 'Milli Bitcoin (฿)', id: 'currencymBTC', fn: currency('mBTC') },\n { name: 'Micro Bitcoin (฿)', id: 'currencyμBTC', fn: currency('μBTC') },\n { name: 'South African Rand (R)', id: 'currencyZAR', fn: currency('R') },\n { name: 'Indian Rupee (₹)', id: 'currencyINR', fn: currency('₹') },\n { name: 'South Korean Won (₩)', id: 'currencyKRW', fn: currency('₩') },\n { name: 'Indonesian Rupiah (Rp)', id: 'currencyIDR', fn: currency('Rp') },\n { name: 'Philippine Peso (PHP)', id: 'currencyPHP', fn: currency('PHP') },\n { name: 'Vietnamese Dong (VND)', id: 'currencyVND', fn: currency('đ', true) },\n ],\n },\n {\n name: 'Data',\n formats: [\n { name: 'bytes(IEC)', id: 'bytes', fn: binaryPrefix('B') },\n { name: 'bytes(SI)', id: 'decbytes', fn: SIPrefix('B') },\n { name: 'bits(IEC)', id: 'bits', fn: binaryPrefix('b') },\n { name: 'bits(SI)', id: 'decbits', fn: SIPrefix('b') },\n { name: 'kibibytes', id: 'kbytes', fn: binaryPrefix('B', 1) },\n { name: 'kilobytes', id: 'deckbytes', fn: SIPrefix('B', 1) },\n { name: 'mebibytes', id: 'mbytes', fn: binaryPrefix('B', 2) },\n { name: 'megabytes', id: 'decmbytes', fn: SIPrefix('B', 2) },\n { name: 'gibibytes', id: 'gbytes', fn: binaryPrefix('B', 3) },\n { name: 'gigabytes', id: 'decgbytes', fn: SIPrefix('B', 3) },\n { name: 'tebibytes', id: 'tbytes', fn: binaryPrefix('B', 4) },\n { name: 'terabytes', id: 'dectbytes', fn: SIPrefix('B', 4) },\n { name: 'pebibytes', id: 'pbytes', fn: binaryPrefix('B', 5) },\n { name: 'petabytes', id: 'decpbytes', fn: SIPrefix('B', 5) },\n ],\n },\n {\n name: 'Data rate',\n formats: [\n { name: 'packets/sec', id: 'pps', fn: SIPrefix('p/s') },\n { name: 'bytes/sec(IEC)', id: 'binBps', fn: binaryPrefix('B/s') },\n { name: 'bytes/sec(SI)', id: 'Bps', fn: SIPrefix('B/s') },\n { name: 'bits/sec(IEC)', id: 'binbps', fn: binaryPrefix('b/s') },\n { name: 'bits/sec(SI)', id: 'bps', fn: SIPrefix('b/s') },\n { name: 'kibibytes/sec', id: 'KiBs', fn: binaryPrefix('B/s', 1) },\n { name: 'kibibits/sec', id: 'Kibits', fn: binaryPrefix('b/s', 1) },\n { name: 'kilobytes/sec', id: 'KBs', fn: SIPrefix('B/s', 1) },\n { name: 'kilobits/sec', id: 'Kbits', fn: SIPrefix('b/s', 1) },\n { name: 'mebibytes/sec', id: 'MiBs', fn: binaryPrefix('B/s', 2) },\n { name: 'mebibits/sec', id: 'Mibits', fn: binaryPrefix('b/s', 2) },\n { name: 'megabytes/sec', id: 'MBs', fn: SIPrefix('B/s', 2) },\n { name: 'megabits/sec', id: 'Mbits', fn: SIPrefix('b/s', 2) },\n { name: 'gibibytes/sec', id: 'GiBs', fn: binaryPrefix('B/s', 3) },\n { name: 'gibibits/sec', id: 'Gibits', fn: binaryPrefix('b/s', 3) },\n { name: 'gigabytes/sec', id: 'GBs', fn: SIPrefix('B/s', 3) },\n { name: 'gigabits/sec', id: 'Gbits', fn: SIPrefix('b/s', 3) },\n { name: 'tebibytes/sec', id: 'TiBs', fn: binaryPrefix('B/s', 4) },\n { name: 'tebibits/sec', id: 'Tibits', fn: binaryPrefix('b/s', 4) },\n { name: 'terabytes/sec', id: 'TBs', fn: SIPrefix('B/s', 4) },\n { name: 'terabits/sec', id: 'Tbits', fn: SIPrefix('b/s', 4) },\n { name: 'pebibytes/sec', id: 'PiBs', fn: binaryPrefix('B/s', 5) },\n { name: 'pebibits/sec', id: 'Pibits', fn: binaryPrefix('b/s', 5) },\n { name: 'petabytes/sec', id: 'PBs', fn: SIPrefix('B/s', 5) },\n { name: 'petabits/sec', id: 'Pbits', fn: SIPrefix('b/s', 5) },\n ],\n },\n {\n name: 'Date & time',\n formats: [\n { name: 'Datetime ISO', id: 'dateTimeAsIso', fn: dateTimeAsIso },\n { name: 'Datetime ISO (No date if today)', id: 'dateTimeAsIsoNoDateIfToday', fn: dateTimeAsIsoNoDateIfToday },\n { name: 'Datetime US', id: 'dateTimeAsUS', fn: dateTimeAsUS },\n { name: 'Datetime US (No date if today)', id: 'dateTimeAsUSNoDateIfToday', fn: dateTimeAsUSNoDateIfToday },\n { name: 'Datetime local', id: 'dateTimeAsLocal', fn: getDateTimeAsLocalFormat() },\n {\n name: 'Datetime local (No date if today)',\n id: 'dateTimeAsLocalNoDateIfToday',\n fn: getDateTimeAsLocalFormatNoDateIfToday(),\n },\n { name: 'Datetime default', id: 'dateTimeAsSystem', fn: dateTimeSystemFormatter },\n { name: 'From Now', id: 'dateTimeFromNow', fn: dateTimeFromNow },\n ],\n },\n {\n name: 'Energy',\n formats: [\n { name: 'Watt (W)', id: 'watt', fn: SIPrefix('W') },\n { name: 'Kilowatt (kW)', id: 'kwatt', fn: SIPrefix('W', 1) },\n { name: 'Megawatt (MW)', id: 'megwatt', fn: SIPrefix('W', 2) },\n { name: 'Gigawatt (GW)', id: 'gwatt', fn: SIPrefix('W', 3) },\n { name: 'Milliwatt (mW)', id: 'mwatt', fn: SIPrefix('W', -1) },\n { name: 'Watt per square meter (W/m²)', id: 'Wm2', fn: toFixedUnit('W/m²') },\n { name: 'Volt-Ampere (VA)', id: 'voltamp', fn: SIPrefix('VA') },\n { name: 'Kilovolt-Ampere (kVA)', id: 'kvoltamp', fn: SIPrefix('VA', 1) },\n { name: 'Volt-Ampere reactive (VAr)', id: 'voltampreact', fn: SIPrefix('VAr') },\n { name: 'Kilovolt-Ampere reactive (kVAr)', id: 'kvoltampreact', fn: SIPrefix('VAr', 1) },\n { name: 'Watt-hour (Wh)', id: 'watth', fn: SIPrefix('Wh') },\n { name: 'Watt-hour per Kilogram (Wh/kg)', id: 'watthperkg', fn: SIPrefix('Wh/kg') },\n { name: 'Kilowatt-hour (kWh)', id: 'kwatth', fn: SIPrefix('Wh', 1) },\n { name: 'Kilowatt-min (kWm)', id: 'kwattm', fn: SIPrefix('W-Min', 1) },\n { name: 'Ampere-hour (Ah)', id: 'amph', fn: SIPrefix('Ah') },\n { name: 'Kiloampere-hour (kAh)', id: 'kamph', fn: SIPrefix('Ah', 1) },\n { name: 'Milliampere-hour (mAh)', id: 'mamph', fn: SIPrefix('Ah', -1) },\n { name: 'Joule (J)', id: 'joule', fn: SIPrefix('J') },\n { name: 'Electron volt (eV)', id: 'ev', fn: SIPrefix('eV') },\n { name: 'Ampere (A)', id: 'amp', fn: SIPrefix('A') },\n { name: 'Kiloampere (kA)', id: 'kamp', fn: SIPrefix('A', 1) },\n { name: 'Milliampere (mA)', id: 'mamp', fn: SIPrefix('A', -1) },\n { name: 'Volt (V)', id: 'volt', fn: SIPrefix('V') },\n { name: 'Kilovolt (kV)', id: 'kvolt', fn: SIPrefix('V', 1) },\n { name: 'Millivolt (mV)', id: 'mvolt', fn: SIPrefix('V', -1) },\n { name: 'Decibel-milliwatt (dBm)', id: 'dBm', fn: SIPrefix('dBm') },\n { name: 'Ohm (Ω)', id: 'ohm', fn: SIPrefix('Ω') },\n { name: 'Kiloohm (kΩ)', id: 'kohm', fn: SIPrefix('Ω', 1) },\n { name: 'Megaohm (MΩ)', id: 'Mohm', fn: SIPrefix('Ω', 2) },\n { name: 'Farad (F)', id: 'farad', fn: SIPrefix('F') },\n { name: 'Microfarad (µF)', id: 'µfarad', fn: SIPrefix('F', -2) },\n { name: 'Nanofarad (nF)', id: 'nfarad', fn: SIPrefix('F', -3) },\n { name: 'Picofarad (pF)', id: 'pfarad', fn: SIPrefix('F', -4) },\n { name: 'Femtofarad (fF)', id: 'ffarad', fn: SIPrefix('F', -5) },\n { name: 'Henry (H)', id: 'henry', fn: SIPrefix('H') },\n { name: 'Millihenry (mH)', id: 'mhenry', fn: SIPrefix('H', -1) },\n { name: 'Microhenry (µH)', id: 'µhenry', fn: SIPrefix('H', -2) },\n { name: 'Lumens (Lm)', id: 'lumens', fn: SIPrefix('Lm') },\n ],\n },\n {\n name: 'Flow',\n formats: [\n { name: 'Gallons/min (gpm)', id: 'flowgpm', fn: toFixedUnit('gpm') },\n { name: 'Cubic meters/sec (cms)', id: 'flowcms', fn: toFixedUnit('cms') },\n { name: 'Cubic feet/sec (cfs)', id: 'flowcfs', fn: toFixedUnit('cfs') },\n { name: 'Cubic feet/min (cfm)', id: 'flowcfm', fn: toFixedUnit('cfm') },\n { name: 'Litre/hour', id: 'litreh', fn: toFixedUnit('L/h') },\n { name: 'Litre/min (L/min)', id: 'flowlpm', fn: toFixedUnit('L/min') },\n { name: 'milliLitre/min (mL/min)', id: 'flowmlpm', fn: toFixedUnit('mL/min') },\n { name: 'Lux (lx)', id: 'lux', fn: toFixedUnit('lux') },\n ],\n },\n {\n name: 'Force',\n formats: [\n { name: 'Newton-meters (Nm)', id: 'forceNm', fn: SIPrefix('Nm') },\n { name: 'Kilonewton-meters (kNm)', id: 'forcekNm', fn: SIPrefix('Nm', 1) },\n { name: 'Newtons (N)', id: 'forceN', fn: SIPrefix('N') },\n { name: 'Kilonewtons (kN)', id: 'forcekN', fn: SIPrefix('N', 1) },\n ],\n },\n {\n name: 'Hash rate',\n formats: [\n { name: 'hashes/sec', id: 'Hs', fn: SIPrefix('H/s') },\n { name: 'kilohashes/sec', id: 'KHs', fn: SIPrefix('H/s', 1) },\n { name: 'megahashes/sec', id: 'MHs', fn: SIPrefix('H/s', 2) },\n { name: 'gigahashes/sec', id: 'GHs', fn: SIPrefix('H/s', 3) },\n { name: 'terahashes/sec', id: 'THs', fn: SIPrefix('H/s', 4) },\n { name: 'petahashes/sec', id: 'PHs', fn: SIPrefix('H/s', 5) },\n { name: 'exahashes/sec', id: 'EHs', fn: SIPrefix('H/s', 6) },\n ],\n },\n {\n name: 'Mass',\n formats: [\n { name: 'milligram (mg)', id: 'massmg', fn: SIPrefix('g', -1) },\n { name: 'gram (g)', id: 'massg', fn: SIPrefix('g') },\n { name: 'pound (lb)', id: 'masslb', fn: toFixedUnit('lb') },\n { name: 'kilogram (kg)', id: 'masskg', fn: SIPrefix('g', 1) },\n { name: 'metric ton (t)', id: 'masst', fn: toFixedUnit('t') },\n ],\n },\n {\n name: 'Length',\n formats: [\n { name: 'millimeter (mm)', id: 'lengthmm', fn: SIPrefix('m', -1) },\n { name: 'inch (in)', id: 'lengthin', fn: toFixedUnit('in') },\n { name: 'feet (ft)', id: 'lengthft', fn: toFixedUnit('ft') },\n { name: 'meter (m)', id: 'lengthm', fn: SIPrefix('m') },\n { name: 'kilometer (km)', id: 'lengthkm', fn: SIPrefix('m', 1) },\n { name: 'mile (mi)', id: 'lengthmi', fn: toFixedUnit('mi') },\n ],\n },\n {\n name: 'Pressure',\n formats: [\n { name: 'Millibars', id: 'pressurembar', fn: SIPrefix('bar', -1) },\n { name: 'Bars', id: 'pressurebar', fn: SIPrefix('bar') },\n { name: 'Kilobars', id: 'pressurekbar', fn: SIPrefix('bar', 1) },\n { name: 'Pascals', id: 'pressurepa', fn: SIPrefix('Pa') },\n { name: 'Hectopascals', id: 'pressurehpa', fn: toFixedUnit('hPa') },\n { name: 'Kilopascals', id: 'pressurekpa', fn: toFixedUnit('kPa') },\n { name: 'Inches of mercury', id: 'pressurehg', fn: toFixedUnit('\"Hg') },\n { name: 'PSI', id: 'pressurepsi', fn: scaledUnits(1000, ['psi', 'ksi', 'Mpsi']) },\n ],\n },\n {\n name: 'Radiation',\n formats: [\n { name: 'Becquerel (Bq)', id: 'radbq', fn: SIPrefix('Bq') },\n { name: 'curie (Ci)', id: 'radci', fn: SIPrefix('Ci') },\n { name: 'Gray (Gy)', id: 'radgy', fn: SIPrefix('Gy') },\n { name: 'rad', id: 'radrad', fn: SIPrefix('rad') },\n { name: 'Sievert (Sv)', id: 'radsv', fn: SIPrefix('Sv') },\n { name: 'milliSievert (mSv)', id: 'radmsv', fn: SIPrefix('Sv', -1) },\n { name: 'microSievert (µSv)', id: 'radusv', fn: SIPrefix('Sv', -2) },\n { name: 'rem', id: 'radrem', fn: SIPrefix('rem') },\n { name: 'Exposure (C/kg)', id: 'radexpckg', fn: SIPrefix('C/kg') },\n { name: 'roentgen (R)', id: 'radr', fn: SIPrefix('R') },\n { name: 'Sievert/hour (Sv/h)', id: 'radsvh', fn: SIPrefix('Sv/h') },\n { name: 'milliSievert/hour (mSv/h)', id: 'radmsvh', fn: SIPrefix('Sv/h', -1) },\n { name: 'microSievert/hour (µSv/h)', id: 'radusvh', fn: SIPrefix('Sv/h', -2) },\n ],\n },\n {\n name: 'Rotational Speed',\n formats: [\n { name: 'Revolutions per minute (rpm)', id: 'rotrpm', fn: toFixedUnit('rpm') },\n { name: 'Hertz (Hz)', id: 'rothz', fn: SIPrefix('Hz') },\n { name: 'Radians per second (rad/s)', id: 'rotrads', fn: toFixedUnit('rad/s') },\n { name: 'Degrees per second (°/s)', id: 'rotdegs', fn: toFixedUnit('°/s') },\n ],\n },\n {\n name: 'Temperature',\n formats: [\n { name: 'Celsius (°C)', id: 'celsius', fn: toFixedUnit('°C') },\n { name: 'Fahrenheit (°F)', id: 'fahrenheit', fn: toFixedUnit('°F') },\n { name: 'Kelvin (K)', id: 'kelvin', fn: toFixedUnit('K') },\n ],\n },\n {\n name: 'Time',\n formats: [\n { name: 'Hertz (1/s)', id: 'hertz', fn: SIPrefix('Hz') },\n { name: 'nanoseconds (ns)', id: 'ns', fn: toNanoSeconds },\n { name: 'microseconds (µs)', id: 'µs', fn: toMicroSeconds },\n { name: 'milliseconds (ms)', id: 'ms', fn: toMilliSeconds },\n { name: 'seconds (s)', id: 's', fn: toSeconds },\n { name: 'minutes (m)', id: 'm', fn: toMinutes },\n { name: 'hours (h)', id: 'h', fn: toHours },\n { name: 'days (d)', id: 'd', fn: toDays },\n { name: 'duration (ms)', id: 'dtdurationms', fn: toDurationInMilliseconds },\n { name: 'duration (s)', id: 'dtdurations', fn: toDurationInSeconds },\n { name: 'duration (hh:mm:ss)', id: 'dthms', fn: toDurationInHoursMinutesSeconds },\n { name: 'duration (d hh:mm:ss)', id: 'dtdhms', fn: toDurationInDaysHoursMinutesSeconds },\n { name: 'Timeticks (s/100)', id: 'timeticks', fn: toTimeTicks },\n { name: 'clock (ms)', id: 'clockms', fn: toClockMilliseconds },\n { name: 'clock (s)', id: 'clocks', fn: toClockSeconds },\n ],\n },\n {\n name: 'Throughput',\n formats: [\n { name: 'counts/sec (cps)', id: 'cps', fn: simpleCountUnit('c/s') },\n { name: 'ops/sec (ops)', id: 'ops', fn: simpleCountUnit('ops/s') },\n { name: 'requests/sec (rps)', id: 'reqps', fn: simpleCountUnit('req/s') },\n { name: 'reads/sec (rps)', id: 'rps', fn: simpleCountUnit('rd/s') },\n { name: 'writes/sec (wps)', id: 'wps', fn: simpleCountUnit('wr/s') },\n { name: 'I/O ops/sec (iops)', id: 'iops', fn: simpleCountUnit('io/s') },\n { name: 'counts/min (cpm)', id: 'cpm', fn: simpleCountUnit('c/m') },\n { name: 'ops/min (opm)', id: 'opm', fn: simpleCountUnit('ops/m') },\n { name: 'reads/min (rpm)', id: 'rpm', fn: simpleCountUnit('rd/m') },\n { name: 'writes/min (wpm)', id: 'wpm', fn: simpleCountUnit('wr/m') },\n ],\n },\n {\n name: 'Velocity',\n formats: [\n { name: 'meters/second (m/s)', id: 'velocityms', fn: toFixedUnit('m/s') },\n { name: 'kilometers/hour (km/h)', id: 'velocitykmh', fn: toFixedUnit('km/h') },\n { name: 'miles/hour (mph)', id: 'velocitymph', fn: toFixedUnit('mph') },\n { name: 'knot (kn)', id: 'velocityknot', fn: toFixedUnit('kn') },\n ],\n },\n {\n name: 'Volume',\n formats: [\n { name: 'millilitre (mL)', id: 'mlitre', fn: SIPrefix('L', -1) },\n { name: 'litre (L)', id: 'litre', fn: SIPrefix('L') },\n { name: 'cubic meter', id: 'm3', fn: toFixedUnit('m³') },\n { name: 'Normal cubic meter', id: 'Nm3', fn: toFixedUnit('Nm³') },\n { name: 'cubic decimeter', id: 'dm3', fn: toFixedUnit('dm³') },\n { name: 'gallons', id: 'gallons', fn: toFixedUnit('gal') },\n ],\n },\n {\n name: 'Boolean',\n formats: [\n { name: 'True / False', id: 'bool', fn: booleanValueFormatter('True', 'False') },\n { name: 'Yes / No', id: 'bool_yes_no', fn: booleanValueFormatter('Yes', 'No') },\n { name: 'On / Off', id: 'bool_on_off', fn: booleanValueFormatter('On', 'Off') },\n ],\n },\n];\n","import { toDuration as duration, toUtc, dateTime } from '../datetime/moment_wrapper';\n\nimport { toFixed, toFixedScaled, FormattedValue, ValueFormatter } from './valueFormats';\nimport { DecimalCount } from '../types/displayValue';\nimport { TimeZone } from '../types';\nimport { dateTimeFormat, dateTimeFormatTimeAgo, localTimeFormat, systemDateFormats } from '../datetime';\n\ninterface IntervalsInSeconds {\n [interval: string]: number;\n}\n\nexport enum Interval {\n Year = 'year',\n Month = 'month',\n Week = 'week',\n Day = 'day',\n Hour = 'hour',\n Minute = 'minute',\n Second = 'second',\n Millisecond = 'millisecond',\n}\n\nconst UNITS = [\n Interval.Year,\n Interval.Month,\n Interval.Week,\n Interval.Day,\n Interval.Hour,\n Interval.Minute,\n Interval.Second,\n Interval.Millisecond,\n];\n\nconst INTERVALS_IN_SECONDS: IntervalsInSeconds = {\n [Interval.Year]: 31536000,\n [Interval.Month]: 2592000,\n [Interval.Week]: 604800,\n [Interval.Day]: 86400,\n [Interval.Hour]: 3600,\n [Interval.Minute]: 60,\n [Interval.Second]: 1,\n [Interval.Millisecond]: 0.001,\n};\n\nexport function toNanoSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: ' ns' };\n } else if (Math.abs(size) < 1000000) {\n return toFixedScaled(size / 1000, decimals, ' µs');\n } else if (Math.abs(size) < 1000000000) {\n return toFixedScaled(size / 1000000, decimals, ' ms');\n } else if (Math.abs(size) < 60000000000) {\n return toFixedScaled(size / 1000000000, decimals, ' s');\n } else if (Math.abs(size) < 3600000000000) {\n return toFixedScaled(size / 60000000000, decimals, ' min');\n } else if (Math.abs(size) < 86400000000000) {\n return toFixedScaled(size / 3600000000000, decimals, ' hour');\n } else {\n return toFixedScaled(size / 86400000000000, decimals, ' day');\n }\n}\n\nexport function toMicroSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: ' µs' };\n } else if (Math.abs(size) < 1000000) {\n return toFixedScaled(size / 1000, decimals, ' ms');\n } else {\n return toFixedScaled(size / 1000000, decimals, ' s');\n }\n}\n\nexport function toMilliSeconds(size: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 1000) {\n return { text: toFixed(size, decimals), suffix: ' ms' };\n } else if (Math.abs(size) < 60000) {\n // Less than 1 min\n return toFixedScaled(size / 1000, decimals, ' s');\n } else if (Math.abs(size) < 3600000) {\n // Less than 1 hour, divide in minutes\n return toFixedScaled(size / 60000, decimals, ' min');\n } else if (Math.abs(size) < 86400000) {\n // Less than one day, divide in hours\n return toFixedScaled(size / 3600000, decimals, ' hour');\n } else if (Math.abs(size) < 31536000000) {\n // Less than one year, divide in days\n return toFixedScaled(size / 86400000, decimals, ' day');\n }\n\n return toFixedScaled(size / 31536000000, decimals, ' year');\n}\n\nexport function trySubstract(value1: DecimalCount, value2: DecimalCount): DecimalCount {\n if (value1 !== null && value1 !== undefined && value2 !== null && value2 !== undefined) {\n return value1 - value2;\n }\n return undefined;\n}\n\nexport function toSeconds(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n // If 0, use s unit instead of ns\n if (size === 0) {\n return { text: '0', suffix: ' s' };\n }\n\n // Less than 1 µs, divide in ns\n if (Math.abs(size) < 0.000001) {\n return toFixedScaled(size * 1e9, decimals, ' ns');\n }\n // Less than 1 ms, divide in µs\n if (Math.abs(size) < 0.001) {\n return toFixedScaled(size * 1e6, decimals, ' µs');\n }\n // Less than 1 second, divide in ms\n if (Math.abs(size) < 1) {\n return toFixedScaled(size * 1e3, decimals, ' ms');\n }\n\n if (Math.abs(size) < 60) {\n return { text: toFixed(size, decimals), suffix: ' s' };\n } else if (Math.abs(size) < 3600) {\n // Less than 1 hour, divide in minutes\n return toFixedScaled(size / 60, decimals, ' min');\n } else if (Math.abs(size) < 86400) {\n // Less than one day, divide in hours\n return toFixedScaled(size / 3600, decimals, ' hour');\n } else if (Math.abs(size) < 604800) {\n // Less than one week, divide in days\n return toFixedScaled(size / 86400, decimals, ' day');\n } else if (Math.abs(size) < 31536000) {\n // Less than one year, divide in week\n return toFixedScaled(size / 604800, decimals, ' week');\n }\n\n return toFixedScaled(size / 3.15569e7, decimals, ' year');\n}\n\nexport function toMinutes(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 60) {\n return { text: toFixed(size, decimals), suffix: ' min' };\n } else if (Math.abs(size) < 1440) {\n return toFixedScaled(size / 60, decimals, ' hour');\n } else if (Math.abs(size) < 10080) {\n return toFixedScaled(size / 1440, decimals, ' day');\n } else if (Math.abs(size) < 604800) {\n return toFixedScaled(size / 10080, decimals, ' week');\n } else {\n return toFixedScaled(size / 5.25948e5, decimals, ' year');\n }\n}\n\nexport function toHours(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 24) {\n return { text: toFixed(size, decimals), suffix: ' hour' };\n } else if (Math.abs(size) < 168) {\n return toFixedScaled(size / 24, decimals, ' day');\n } else if (Math.abs(size) < 8760) {\n return toFixedScaled(size / 168, decimals, ' week');\n } else {\n return toFixedScaled(size / 8760, decimals, ' year');\n }\n}\n\nexport function toDays(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (Math.abs(size) < 7) {\n return { text: toFixed(size, decimals), suffix: ' day' };\n } else if (Math.abs(size) < 365) {\n return toFixedScaled(size / 7, decimals, ' week');\n } else {\n return toFixedScaled(size / 365, decimals, ' year');\n }\n}\n\nexport function toDuration(size: number, decimals: DecimalCount, timeScale: Interval): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n if (size === 0) {\n return { text: '0', suffix: ' ' + timeScale + 's' };\n }\n\n if (size < 0) {\n const v = toDuration(-size, decimals, timeScale);\n if (!v.suffix) {\n v.suffix = '';\n }\n v.suffix += ' ago';\n return v;\n }\n\n // convert $size to milliseconds\n // intervals_in_seconds uses seconds (duh), convert them to milliseconds here to minimize floating point errors\n size *= INTERVALS_IN_SECONDS[timeScale] * 1000;\n\n const strings = [];\n\n // after first value >= 1 print only $decimals more\n let decrementDecimals = false;\n let decimalsCount = 0;\n\n if (decimals !== null && decimals !== undefined) {\n decimalsCount = decimals as number;\n }\n\n for (let i = 0; i < UNITS.length && decimalsCount >= 0; i++) {\n const interval = INTERVALS_IN_SECONDS[UNITS[i]] * 1000;\n const value = size / interval;\n if (value >= 1 || decrementDecimals) {\n decrementDecimals = true;\n const floor = Math.floor(value);\n const unit = UNITS[i] + (floor !== 1 ? 's' : '');\n strings.push(floor + ' ' + unit);\n size = size % interval;\n decimalsCount--;\n }\n }\n\n return { text: strings.join(', ') };\n}\n\nexport function toClock(size: number, decimals?: DecimalCount): FormattedValue {\n if (size === null) {\n return { text: '' };\n }\n\n // < 1 second\n if (size < 1000) {\n return {\n text: toUtc(size).format('SSS\\\\m\\\\s'),\n };\n }\n\n // < 1 minute\n if (size < 60000) {\n let format = 'ss\\\\s:SSS\\\\m\\\\s';\n if (decimals === 0) {\n format = 'ss\\\\s';\n }\n return { text: toUtc(size).format(format) };\n }\n\n // < 1 hour\n if (size < 3600000) {\n let format = 'mm\\\\m:ss\\\\s:SSS\\\\m\\\\s';\n if (decimals === 0) {\n format = 'mm\\\\m';\n } else if (decimals === 1) {\n format = 'mm\\\\m:ss\\\\s';\n }\n return { text: toUtc(size).format(format) };\n }\n\n let format = 'mm\\\\m:ss\\\\s:SSS\\\\m\\\\s';\n\n const hours = `${('0' + Math.floor(duration(size, 'milliseconds').asHours())).slice(-2)}h`;\n\n if (decimals === 0) {\n format = '';\n } else if (decimals === 1) {\n format = 'mm\\\\m';\n } else if (decimals === 2) {\n format = 'mm\\\\m:ss\\\\s';\n }\n\n const text = format ? `${hours}:${toUtc(size).format(format)}` : hours;\n return { text };\n}\n\nexport function toDurationInMilliseconds(size: number, decimals: DecimalCount): FormattedValue {\n return toDuration(size, decimals, Interval.Millisecond);\n}\n\nexport function toDurationInSeconds(size: number, decimals: DecimalCount): FormattedValue {\n return toDuration(size, decimals, Interval.Second);\n}\n\nexport function toDurationInHoursMinutesSeconds(size: number): FormattedValue {\n if (size < 0) {\n const v = toDurationInHoursMinutesSeconds(-size);\n if (!v.suffix) {\n v.suffix = '';\n }\n v.suffix += ' ago';\n return v;\n }\n const strings = [];\n const numHours = Math.floor(size / 3600);\n const numMinutes = Math.floor((size % 3600) / 60);\n const numSeconds = Math.floor((size % 3600) % 60);\n numHours > 9 ? strings.push('' + numHours) : strings.push('0' + numHours);\n numMinutes > 9 ? strings.push('' + numMinutes) : strings.push('0' + numMinutes);\n numSeconds > 9 ? strings.push('' + numSeconds) : strings.push('0' + numSeconds);\n return { text: strings.join(':') };\n}\n\nexport function toDurationInDaysHoursMinutesSeconds(size: number): FormattedValue {\n if (size < 0) {\n const v = toDurationInDaysHoursMinutesSeconds(-size);\n if (!v.suffix) {\n v.suffix = '';\n }\n v.suffix += ' ago';\n return v;\n }\n let dayString = '';\n const numDays = Math.floor(size / (24 * 3600));\n if (numDays > 0) {\n dayString = numDays + ' d ';\n }\n const hmsString = toDurationInHoursMinutesSeconds(size - numDays * 24 * 3600);\n return { text: dayString + hmsString.text };\n}\n\nexport function toTimeTicks(size: number, decimals: DecimalCount): FormattedValue {\n return toSeconds(size / 100, decimals);\n}\n\nexport function toClockMilliseconds(size: number, decimals: DecimalCount): FormattedValue {\n return toClock(size, decimals);\n}\n\nexport function toClockSeconds(size: number, decimals: DecimalCount): FormattedValue {\n return toClock(size * 1000, decimals);\n}\n\nexport function toDateTimeValueFormatter(pattern: string, todayPattern?: string): ValueFormatter {\n return (value: number, decimals: DecimalCount, scaledDecimals: DecimalCount, timeZone?: TimeZone): FormattedValue => {\n if (todayPattern) {\n if (dateTime().isSame(value, 'day')) {\n return {\n text: dateTimeFormat(value, { format: todayPattern, timeZone }),\n };\n }\n }\n return { text: dateTimeFormat(value, { format: pattern, timeZone }) };\n };\n}\n\nexport const dateTimeAsIso = toDateTimeValueFormatter('YYYY-MM-DD HH:mm:ss');\nexport const dateTimeAsIsoNoDateIfToday = toDateTimeValueFormatter('YYYY-MM-DD HH:mm:ss', 'HH:mm:ss');\nexport const dateTimeAsUS = toDateTimeValueFormatter('MM/DD/YYYY h:mm:ss a');\nexport const dateTimeAsUSNoDateIfToday = toDateTimeValueFormatter('MM/DD/YYYY h:mm:ss a', 'h:mm:ss a');\n\nexport function getDateTimeAsLocalFormat() {\n return toDateTimeValueFormatter(\n localTimeFormat({\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n })\n );\n}\n\nexport function getDateTimeAsLocalFormatNoDateIfToday() {\n return toDateTimeValueFormatter(\n localTimeFormat({\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n }),\n localTimeFormat({\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n })\n );\n}\n\nexport function dateTimeSystemFormatter(\n value: number,\n decimals: DecimalCount,\n scaledDecimals: DecimalCount,\n timeZone?: TimeZone,\n showMs?: boolean\n): FormattedValue {\n return {\n text: dateTimeFormat(value, {\n format: showMs ? systemDateFormats.fullDateMS : systemDateFormats.fullDate,\n timeZone,\n }),\n };\n}\n\nexport function dateTimeFromNow(\n value: number,\n decimals: DecimalCount,\n scaledDecimals: DecimalCount,\n timeZone?: TimeZone\n): FormattedValue {\n return { text: dateTimeFormatTimeAgo(value, { timeZone }) };\n}\n","import { scaledUnits, ValueFormatter } from './valueFormats';\nimport { DecimalCount } from '../types/displayValue';\n\nexport function currency(symbol: string, asSuffix?: boolean): ValueFormatter {\n const units = ['', 'K', 'M', 'B', 'T'];\n const scaler = scaledUnits(1000, units);\n return (size: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount) => {\n if (size === null) {\n return { text: '' };\n }\n const scaled = scaler(size, decimals, scaledDecimals);\n if (asSuffix) {\n scaled.suffix = scaled.suffix !== undefined ? `${scaled.suffix}${symbol}` : undefined;\n } else {\n scaled.prefix = symbol;\n }\n return scaled;\n };\n}\n\nexport function getOffsetFromSIPrefix(c: string): number {\n switch (c) {\n case 'f':\n return -5;\n case 'p':\n return -4;\n case 'n':\n return -3;\n case 'μ': // Two different unicode chars for µ\n case 'µ':\n return -2;\n case 'm':\n return -1;\n case '':\n return 0;\n case 'k':\n return 1;\n case 'M':\n return 2;\n case 'G':\n return 3;\n case 'T':\n return 4;\n case 'P':\n return 5;\n case 'E':\n return 6;\n case 'Z':\n return 7;\n case 'Y':\n return 8;\n }\n return 0;\n}\n\nexport function binaryPrefix(unit: string, offset = 0): ValueFormatter {\n const prefixes = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'].slice(offset);\n const units = prefixes.map((p) => {\n return ' ' + p + unit;\n });\n return scaledUnits(1024, units);\n}\n\nexport function SIPrefix(unit: string, offset = 0): ValueFormatter {\n let prefixes = ['f', 'p', 'n', 'µ', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];\n prefixes = prefixes.slice(5 + (offset || 0));\n const units = prefixes.map((p) => {\n return ' ' + p + unit;\n });\n return scaledUnits(1000, units);\n}\n","import { MutableVector } from '../types/vector';\nimport { FunctionalVector } from './FunctionalVector';\n\n/**\n * @public\n */\nexport class ArrayVector extends FunctionalVector implements MutableVector {\n buffer: T[];\n\n constructor(buffer?: T[]) {\n super();\n this.buffer = buffer ? buffer : [];\n }\n\n get length() {\n return this.buffer.length;\n }\n\n add(value: T) {\n this.buffer.push(value);\n }\n\n get(index: number): T {\n return this.buffer[index];\n }\n\n set(index: number, value: T) {\n this.buffer[index] = value;\n }\n\n reverse() {\n this.buffer.reverse();\n }\n\n toArray(): T[] {\n return this.buffer;\n }\n\n toJSON(): T[] {\n return this.buffer;\n }\n}\n","import { Vector } from '../types';\nimport { FunctionalVector } from './FunctionalVector';\n\n/**\n * This will force all values to be numbers\n *\n * @public\n */\nexport class AsNumberVector extends FunctionalVector {\n constructor(private field: Vector) {\n super();\n }\n\n get length() {\n return this.field.length;\n }\n\n get(index: number) {\n return +this.field.get(index);\n }\n}\n","import { Vector } from '../types/vector';\nimport { vectorToArray } from './vectorToArray';\nimport { BinaryOperation } from '../utils/binaryOperators';\n\n/**\n * @public\n */\nexport class BinaryOperationVector implements Vector {\n constructor(private left: Vector, private right: Vector, private operation: BinaryOperation) {}\n\n get length(): number {\n return this.left.length;\n }\n\n get(index: number): number {\n return this.operation(this.left.get(index), this.right.get(index));\n }\n\n toArray(): number[] {\n return vectorToArray(this);\n }\n\n toJSON(): number[] {\n return vectorToArray(this);\n }\n}\n","import { Vector } from '../types/vector';\n\n/**\n * @public\n */\nexport class ConstantVector implements Vector {\n constructor(private value: T, private len: number) {}\n\n get length() {\n return this.len;\n }\n\n get(index: number): T {\n return this.value;\n }\n\n toArray(): T[] {\n const arr = new Array(this.length);\n return arr.fill(this.value);\n }\n\n toJSON(): T[] {\n return this.toArray();\n }\n}\n","import { Vector } from '../types';\nimport { vectorToArray } from './vectorToArray';\n\n/**\n * RowVector makes the row values look like a vector\n * @internal\n */\nexport class RowVector implements Vector {\n constructor(private columns: Vector[]) {}\n\n rowIndex = 0;\n\n get length(): number {\n return this.columns.length;\n }\n\n get(index: number): number {\n return this.columns[index].get(this.rowIndex);\n }\n\n toArray(): number[] {\n return vectorToArray(this);\n }\n\n toJSON(): number[] {\n return vectorToArray(this);\n }\n}\n","import { Vector } from '../types/vector';\nimport { vectorToArray } from './vectorToArray';\n\n/**\n * Values are returned in the order defined by the input parameter\n */\nexport class SortedVector implements Vector {\n constructor(private source: Vector, private order: number[]) {}\n\n get length(): number {\n return this.source.length;\n }\n\n get(index: number): T {\n return this.source.get(this.order[index]);\n }\n\n toArray(): T[] {\n return vectorToArray(this);\n }\n\n toJSON(): T[] {\n return vectorToArray(this);\n }\n}\n","import { Vector } from '../types/vector';\n\nexport function vectorToArray(v: Vector): T[] {\n const arr: T[] = Array(v.length);\n for (let i = 0; i < v.length; i++) {\n arr[i] = v.get(i);\n }\n return arr;\n}\n","import { DataQueryError } from '@grafana/data';\n\n/**\n * Convert an object into a DataQueryError -- if this is an HTTP response,\n * it will put the correct values in the error field\n *\n * @public\n */\nexport function toDataQueryError(err: DataQueryError | string | Object): DataQueryError {\n const error = (err || {}) as DataQueryError;\n\n if (!error.message) {\n if (typeof err === 'string' || err instanceof String) {\n return { message: err } as DataQueryError;\n }\n\n let message = 'Query error';\n if (error.message) {\n message = error.message;\n } else if (error.data && error.data.message) {\n message = error.data.message;\n } else if (error.data && error.data.error) {\n message = error.data.error;\n } else if (error.status) {\n message = `Query error: ${error.status} ${error.statusText}`;\n }\n error.message = message;\n }\n\n return error;\n}\n","import {\n LiveChannelStatusEvent,\n LiveChannelEvent,\n LiveChannelEventType,\n LiveChannelConnectionState,\n LiveChannelPresenceStatus,\n LiveChannelAddress,\n DataFrameJSON,\n isValidLiveChannelAddress,\n} from '@grafana/data';\nimport Centrifuge, {\n JoinLeaveContext,\n PublicationContext,\n SubscribeErrorContext,\n SubscribeSuccessContext,\n SubscriptionEvents,\n UnsubscribeContext,\n} from 'centrifuge/dist/centrifuge';\n\nimport { Subject, of, Observable } from 'rxjs';\n\n/**\n * Internal class that maps Centrifuge support to GrafanaLive\n */\nexport class CentrifugeLiveChannel {\n readonly currentStatus: LiveChannelStatusEvent;\n\n readonly opened = Date.now();\n readonly id: string;\n readonly addr: LiveChannelAddress;\n\n readonly stream = new Subject>();\n\n // Hold on to the last header with schema\n lastMessageWithSchema?: DataFrameJSON;\n\n subscription?: Centrifuge.Subscription;\n shutdownCallback?: () => void;\n initalized?: boolean;\n\n constructor(id: string, addr: LiveChannelAddress) {\n this.id = id;\n this.addr = addr;\n this.currentStatus = {\n type: LiveChannelEventType.Status,\n id,\n timestamp: this.opened,\n state: LiveChannelConnectionState.Pending,\n };\n if (!isValidLiveChannelAddress(addr)) {\n this.currentStatus.state = LiveChannelConnectionState.Invalid;\n this.currentStatus.error = 'invalid channel address';\n }\n }\n\n // This should only be called when centrifuge is connected\n initalize(): SubscriptionEvents {\n if (this.initalized) {\n throw new Error('Channel already initalized: ' + this.id);\n }\n this.initalized = true;\n\n const events: SubscriptionEvents = {\n // Called when a message is recieved from the socket\n publish: (ctx: PublicationContext) => {\n try {\n if (ctx.data) {\n if (ctx.data.schema) {\n this.lastMessageWithSchema = ctx.data as DataFrameJSON;\n }\n\n this.stream.next({\n type: LiveChannelEventType.Message,\n message: ctx.data,\n });\n }\n\n // Clear any error messages\n if (this.currentStatus.error) {\n this.currentStatus.timestamp = Date.now();\n delete this.currentStatus.error;\n this.sendStatus();\n }\n } catch (err) {\n console.log('publish error', this.addr, err);\n this.currentStatus.error = err;\n this.currentStatus.timestamp = Date.now();\n this.sendStatus();\n }\n },\n error: (ctx: SubscribeErrorContext) => {\n this.currentStatus.timestamp = Date.now();\n this.currentStatus.error = ctx.error;\n this.sendStatus();\n },\n subscribe: (ctx: SubscribeSuccessContext) => {\n this.currentStatus.timestamp = Date.now();\n this.currentStatus.state = LiveChannelConnectionState.Connected;\n delete this.currentStatus.error;\n\n if (ctx.data?.schema) {\n this.lastMessageWithSchema = ctx.data as DataFrameJSON;\n }\n\n this.sendStatus(ctx.data);\n },\n unsubscribe: (ctx: UnsubscribeContext) => {\n this.currentStatus.timestamp = Date.now();\n this.currentStatus.state = LiveChannelConnectionState.Disconnected;\n this.sendStatus();\n },\n };\n\n events.join = (ctx: JoinLeaveContext) => {\n this.stream.next({ type: LiveChannelEventType.Join, user: ctx.info.user });\n };\n events.leave = (ctx: JoinLeaveContext) => {\n this.stream.next({ type: LiveChannelEventType.Leave, user: ctx.info.user });\n };\n return events;\n }\n\n private sendStatus(message?: any) {\n const copy = { ...this.currentStatus };\n if (message) {\n copy.message = message;\n }\n this.stream.next(copy);\n }\n\n disconnectIfNoListeners = () => {\n const count = this.stream.observers.length;\n if (count === 0) {\n this.disconnect();\n }\n };\n\n /**\n * Get the stream of events and\n */\n getStream() {\n return new Observable((subscriber) => {\n const initialMessage = { ...this.currentStatus };\n if (this.lastMessageWithSchema?.schema) {\n // send just schema instead of schema+data to avoid having data gaps\n initialMessage.message = { schema: this.lastMessageWithSchema?.schema };\n }\n\n subscriber.next({ ...this.currentStatus, message: this.lastMessageWithSchema });\n\n const sub = this.stream.subscribe(subscriber);\n return () => {\n sub.unsubscribe();\n const count = this.stream.observers.length;\n\n // Wait 1/4 second to fully disconnect\n if (count === 0) {\n setTimeout(this.disconnectIfNoListeners, 250);\n }\n };\n }) as Observable>;\n }\n\n /**\n * This is configured by the server when the config supports presence\n */\n async getPresence(): Promise {\n if (!this.subscription) {\n return Promise.reject('not subscribed');\n }\n\n return this.subscription!.presence().then((v) => {\n return {\n users: Object.keys(v.presence),\n };\n });\n }\n\n /**\n * This will close and terminate all streams for this channel\n */\n disconnect() {\n this.currentStatus.state = LiveChannelConnectionState.Shutdown;\n this.currentStatus.timestamp = Date.now();\n\n if (this.subscription) {\n this.subscription.unsubscribe();\n this.subscription.removeAllListeners(); // they keep all listeners attached after unsubscribe\n this.subscription = undefined;\n }\n\n this.stream.complete();\n\n this.stream.next({ ...this.currentStatus });\n this.stream.complete();\n\n if (this.shutdownCallback) {\n this.shutdownCallback();\n }\n }\n\n shutdownWithError(err: string) {\n this.currentStatus.error = err;\n this.sendStatus();\n this.disconnect();\n }\n}\n\nexport function getErrorChannel(msg: string, id: string, addr: LiveChannelAddress) {\n return {\n id,\n opened: Date.now(),\n addr,\n\n // return an error\n getStream: () =>\n of({\n type: LiveChannelEventType.Status,\n id,\n timestamp: Date.now(),\n state: LiveChannelConnectionState.Invalid,\n error: msg,\n }),\n\n // already disconnected\n disconnect: () => {},\n };\n}\n","import type { LiveDataStreamOptions, StreamingFrameOptions } from '@grafana/runtime/src/services/live';\nimport { toDataQueryError } from '@grafana/runtime/src/utils/toDataQueryError';\nimport {\n DataFrameJSON,\n DataQueryError,\n Field,\n isLiveChannelMessageEvent,\n isLiveChannelStatusEvent,\n LiveChannelConnectionState,\n LiveChannelEvent,\n LiveChannelId,\n LoadingState,\n} from '@grafana/data';\nimport { map, Observable, ReplaySubject, Subject, Subscriber, Subscription } from 'rxjs';\nimport { DataStreamSubscriptionKey, StreamingDataQueryResponse } from './service';\nimport { getStreamingFrameOptions, StreamingDataFrame } from '../data/StreamingDataFrame';\nimport { StreamingResponseDataType } from '../data/utils';\n\nconst bufferIfNot =\n (canEmitObservable: Observable) =>\n (source: Observable): Observable => {\n return new Observable((subscriber: Subscriber) => {\n let buffer: T[] = [];\n let canEmit = true;\n\n const emitBuffer = () => {\n subscriber.next(buffer);\n buffer = [];\n };\n\n const canEmitSub = canEmitObservable.subscribe({\n next: (val) => {\n canEmit = val;\n\n if (canEmit && buffer.length) {\n emitBuffer();\n }\n },\n });\n\n const sourceSub = source.subscribe({\n next(value) {\n if (canEmit) {\n if (!buffer.length) {\n subscriber.next([value]);\n } else {\n emitBuffer();\n }\n } else {\n buffer.push(value);\n }\n },\n error(error) {\n subscriber.error(error);\n },\n complete() {\n subscriber.complete();\n },\n });\n\n return () => {\n sourceSub.unsubscribe();\n canEmitSub.unsubscribe();\n };\n });\n };\n\nexport type DataStreamHandlerDeps = {\n channelId: LiveChannelId;\n liveEventsObservable: Observable>;\n onShutdown: () => void;\n subscriberReadiness: Observable;\n defaultStreamingFrameOptions: Readonly;\n shutdownDelayInMs: number;\n};\n\nenum InternalStreamMessageType {\n Error,\n NewValuesSameSchema,\n ChangedSchema,\n}\n\ntype InternalStreamMessageTypeToData = {\n [InternalStreamMessageType.Error]: {\n error: DataQueryError;\n };\n [InternalStreamMessageType.ChangedSchema]: {};\n [InternalStreamMessageType.NewValuesSameSchema]: {\n values: unknown[][];\n };\n};\n\ntype InternalStreamMessage = T extends InternalStreamMessageType\n ? {\n type: T;\n } & InternalStreamMessageTypeToData[T]\n : never;\n\nconst reduceNewValuesSameSchemaMessages = (\n packets: Array>\n) => ({\n values: packets.reduce((acc, { values }) => {\n for (let i = 0; i < values.length; i++) {\n if (!acc[i]) {\n acc[i] = [];\n }\n for (let j = 0; j < values[i].length; j++) {\n acc[i].push(values[i][j]);\n }\n }\n return acc;\n }, [] as unknown[][]),\n type: InternalStreamMessageType.NewValuesSameSchema,\n});\n\nconst filterMessages = (\n packets: InternalStreamMessage[],\n type: T\n): Array> => packets.filter((p) => p.type === type) as Array>;\n\nexport class LiveDataStream {\n private frameBuffer: StreamingDataFrame;\n private liveEventsSubscription: Subscription;\n private stream: Subject = new ReplaySubject(1);\n private shutdownTimeoutId: ReturnType | undefined;\n\n constructor(private deps: DataStreamHandlerDeps) {\n this.frameBuffer = StreamingDataFrame.empty(deps.defaultStreamingFrameOptions);\n this.liveEventsSubscription = deps.liveEventsObservable.subscribe({\n error: this.onError,\n complete: this.onComplete,\n next: this.onNext,\n });\n }\n\n private shutdown = () => {\n this.stream.complete();\n this.liveEventsSubscription.unsubscribe();\n this.deps.onShutdown();\n };\n\n private shutdownIfNoSubscribers = () => {\n if (!this.stream.observed) {\n this.shutdown();\n }\n };\n\n private onError = (err: any) => {\n console.log('LiveQuery [error]', { err }, this.deps.channelId);\n this.stream.next({\n type: InternalStreamMessageType.Error,\n error: toDataQueryError(err),\n });\n this.shutdown();\n };\n\n private onComplete = () => {\n console.log('LiveQuery [complete]', this.deps.channelId);\n this.shutdown();\n };\n\n private onNext = (evt: LiveChannelEvent) => {\n if (isLiveChannelMessageEvent(evt)) {\n this.process(evt.message);\n return;\n }\n\n const liveChannelStatusEvent = isLiveChannelStatusEvent(evt);\n if (liveChannelStatusEvent && evt.error) {\n this.stream.next({\n type: InternalStreamMessageType.Error,\n error: {\n ...toDataQueryError(evt.error),\n message: `Streaming channel error: ${evt.error.message}`,\n },\n });\n return;\n }\n\n if (\n liveChannelStatusEvent &&\n (evt.state === LiveChannelConnectionState.Connected || evt.state === LiveChannelConnectionState.Pending) &&\n evt.message\n ) {\n this.process(evt.message);\n }\n };\n\n private process = (msg: DataFrameJSON) => {\n const packetInfo = this.frameBuffer.push(msg);\n\n if (packetInfo.schemaChanged) {\n this.stream.next({\n type: InternalStreamMessageType.ChangedSchema,\n });\n } else {\n this.stream.next({\n type: InternalStreamMessageType.NewValuesSameSchema,\n values: this.frameBuffer.getValuesFromLastPacket(),\n });\n }\n };\n\n private resizeBuffer = (bufferOptions: StreamingFrameOptions) => {\n if (bufferOptions && this.frameBuffer.needsResizing(bufferOptions)) {\n this.frameBuffer.resize(bufferOptions);\n }\n };\n\n private prepareInternalStreamForNewSubscription = (options: LiveDataStreamOptions): void => {\n if (!this.frameBuffer.hasAtLeastOnePacket() && options.frame) {\n // will skip initial frames from subsequent subscribers\n this.process(options.frame);\n }\n };\n\n private clearShutdownTimeout = () => {\n if (this.shutdownTimeoutId) {\n clearTimeout(this.shutdownTimeoutId);\n this.shutdownTimeoutId = undefined;\n }\n };\n\n get = (options: LiveDataStreamOptions, subKey: DataStreamSubscriptionKey): Observable => {\n this.clearShutdownTimeout();\n const buffer = getStreamingFrameOptions(options.buffer);\n\n this.resizeBuffer(buffer);\n this.prepareInternalStreamForNewSubscription(options);\n\n const fieldsNamesFilter = options.filter?.fields;\n const dataNeedsFiltering = fieldsNamesFilter?.length;\n const fieldFilterPredicate = dataNeedsFiltering ? ({ name }: Field) => fieldsNamesFilter.includes(name) : undefined;\n let matchingFieldIndexes: number[] | undefined = undefined;\n\n const getFullFrameResponseData = (error?: DataQueryError): StreamingDataQueryResponse => {\n matchingFieldIndexes = fieldFilterPredicate\n ? this.frameBuffer.getMatchingFieldIndexes(fieldFilterPredicate)\n : undefined;\n\n return {\n key: subKey,\n state: error ? LoadingState.Error : LoadingState.Streaming,\n data: [\n {\n type: StreamingResponseDataType.FullFrame,\n frame: this.frameBuffer.serialize(fieldFilterPredicate, buffer),\n },\n ],\n error,\n };\n };\n\n const getNewValuesSameSchemaResponseData = (values: unknown[][]): StreamingDataQueryResponse => {\n const filteredValues = matchingFieldIndexes\n ? values.filter((v, i) => (matchingFieldIndexes as number[]).includes(i))\n : values;\n\n return {\n key: subKey,\n state: LoadingState.Streaming,\n data: [\n {\n type: StreamingResponseDataType.NewValuesSameSchema,\n values: filteredValues,\n },\n ],\n };\n };\n\n let shouldSendFullFrame = true;\n const transformedInternalStream = this.stream.pipe(\n bufferIfNot(this.deps.subscriberReadiness),\n map((messages, i) => {\n const errors = filterMessages(messages, InternalStreamMessageType.Error);\n const lastError = errors.length ? errors[errors.length - 1].error : undefined;\n\n if (shouldSendFullFrame) {\n shouldSendFullFrame = false;\n return getFullFrameResponseData(lastError);\n }\n\n if (errors.length) {\n // send the latest frame with the last error, discard everything else\n return getFullFrameResponseData(lastError);\n }\n\n const schemaChanged = messages.some((n) => n.type === InternalStreamMessageType.ChangedSchema);\n if (schemaChanged) {\n // send the latest frame, discard intermediate appends\n return getFullFrameResponseData();\n }\n\n const newValueSameSchemaMessages = filterMessages(messages, InternalStreamMessageType.NewValuesSameSchema);\n if (newValueSameSchemaMessages.length !== messages.length) {\n console.warn(`unsupported message type ${messages.map(({ type }) => type)}`);\n }\n\n return getNewValuesSameSchemaResponseData(reduceNewValuesSameSchemaMessages(newValueSameSchemaMessages).values);\n })\n );\n\n return new Observable((subscriber) => {\n const sub = transformedInternalStream.subscribe({\n next: (n) => {\n subscriber.next(n);\n },\n error: (err) => {\n subscriber.error(err);\n },\n complete: () => {\n subscriber.complete();\n },\n });\n\n return () => {\n // TODO: potentially resize (downsize) the buffer on unsubscribe\n sub.unsubscribe();\n if (!this.stream.observed) {\n this.clearShutdownTimeout();\n this.shutdownTimeoutId = setTimeout(this.shutdownIfNoSubscribers, this.deps.shutdownDelayInMs);\n }\n };\n });\n };\n}\n","import Centrifuge from 'centrifuge/dist/centrifuge';\nimport {\n GrafanaLiveSrv,\n LiveDataStreamOptions,\n LiveQueryDataOptions,\n StreamingFrameAction,\n StreamingFrameOptions,\n} from '@grafana/runtime/src/services/live';\nimport { BehaviorSubject, Observable, share, startWith } from 'rxjs';\nimport {\n DataQueryError,\n DataQueryResponse,\n LiveChannelAddress,\n LiveChannelConnectionState,\n LiveChannelId,\n toLiveChannelId,\n} from '@grafana/data';\nimport { CentrifugeLiveChannel } from './channel';\nimport { LiveDataStream } from './LiveDataStream';\nimport { StreamingResponseData } from '../data/utils';\nimport { BackendDataSourceResponse } from '@grafana/runtime/src/utils/queryResponse';\nimport { FetchResponse } from '@grafana/runtime/src/services/backendSrv';\n\nexport type CentrifugeSrvDeps = {\n appUrl: string;\n orgId: number;\n orgRole: string;\n sessionId: string;\n liveEnabled: boolean;\n dataStreamSubscriberReadiness: Observable;\n};\n\nexport type StreamingDataQueryResponse = Omit & { data: [StreamingResponseData] };\n\nexport type CentrifugeSrv = Omit & {\n getDataStream: (options: LiveDataStreamOptions) => Observable;\n getQueryData: (\n options: LiveQueryDataOptions\n ) => Promise<\n | { data: BackendDataSourceResponse | undefined }\n | FetchResponse\n | DataQueryError\n >;\n};\n\nexport type DataStreamSubscriptionKey = string;\n\nconst defaultStreamingFrameOptions: Readonly = {\n maxLength: 100,\n maxDelta: Infinity,\n action: StreamingFrameAction.Append,\n};\n\nconst dataStreamShutdownDelayInMs = 5000;\n\nexport class CentrifugeService implements CentrifugeSrv {\n readonly open = new Map();\n private readonly liveDataStreamByChannelId: Record = {};\n readonly centrifuge: Centrifuge;\n readonly connectionState: BehaviorSubject;\n readonly connectionBlocker: Promise;\n private readonly dataStreamSubscriberReadiness: Observable;\n\n constructor(private deps: CentrifugeSrvDeps) {\n this.dataStreamSubscriberReadiness = deps.dataStreamSubscriberReadiness.pipe(share(), startWith(true));\n const liveUrl = `${deps.appUrl.replace(/^http/, 'ws')}/api/live/ws`;\n this.centrifuge = new Centrifuge(liveUrl, {\n timeout: 30000,\n });\n this.centrifuge.setConnectData({\n sessionId: deps.sessionId,\n orgId: deps.orgId,\n });\n // orgRole is set when logged in *or* anonomus users can use grafana\n if (deps.liveEnabled && deps.orgRole !== '') {\n this.centrifuge.connect(); // do connection\n }\n this.connectionState = new BehaviorSubject(this.centrifuge.isConnected());\n this.connectionBlocker = new Promise((resolve) => {\n if (this.centrifuge.isConnected()) {\n return resolve();\n }\n const connectListener = () => {\n resolve();\n this.centrifuge.removeListener('connect', connectListener);\n };\n this.centrifuge.addListener('connect', connectListener);\n });\n\n // Register global listeners\n this.centrifuge.on('connect', this.onConnect);\n this.centrifuge.on('disconnect', this.onDisconnect);\n this.centrifuge.on('publish', this.onServerSideMessage);\n }\n\n //----------------------------------------------------------\n // Internal functions\n //----------------------------------------------------------\n\n private onConnect = (context: any) => {\n this.connectionState.next(true);\n };\n\n private onDisconnect = (context: any) => {\n this.connectionState.next(false);\n };\n\n private onServerSideMessage = (context: any) => {\n console.log('Publication from server-side channel', context);\n };\n\n /**\n * Get a channel. If the scope, namespace, or path is invalid, a shutdown\n * channel will be returned with an error state indicated in its status\n */\n private getChannel(addr: LiveChannelAddress): CentrifugeLiveChannel {\n const id = `${this.deps.orgId}/${addr.scope}/${addr.namespace}/${addr.path}`;\n let channel = this.open.get(id);\n if (channel != null) {\n return channel;\n }\n\n channel = new CentrifugeLiveChannel(id, addr);\n if (channel.currentStatus.state === LiveChannelConnectionState.Invalid) {\n return channel;\n }\n channel.shutdownCallback = () => {\n this.open.delete(id); // remove it from the list of open channels\n };\n this.open.set(id, channel);\n\n // Initialize the channel in the background\n this.initChannel(channel).catch((err) => {\n if (channel) {\n channel.currentStatus.state = LiveChannelConnectionState.Invalid;\n channel.shutdownWithError(err);\n }\n this.open.delete(id);\n });\n\n // return the not-yet initialized channel\n return channel;\n }\n\n private async initChannel(channel: CentrifugeLiveChannel): Promise {\n const events = channel.initalize();\n if (!this.centrifuge.isConnected()) {\n await this.connectionBlocker;\n }\n channel.subscription = this.centrifuge.subscribe(channel.id, events, { data: channel.addr.data });\n return;\n }\n\n //----------------------------------------------------------\n // Exported functions\n //----------------------------------------------------------\n\n /**\n * Listen for changes to the connection state\n */\n getConnectionState = () => {\n return this.connectionState.asObservable();\n };\n\n /**\n * Watch for messages in a channel\n */\n getStream: CentrifugeSrv['getStream'] = (address: LiveChannelAddress) => {\n return this.getChannel(address).getStream();\n };\n\n private createSubscriptionKey = (options: LiveDataStreamOptions): DataStreamSubscriptionKey =>\n options.key ?? `xstr/${streamCounter++}`;\n\n private getLiveDataStream = (options: LiveDataStreamOptions): LiveDataStream => {\n const channelId = toLiveChannelId(options.addr);\n const existingStream = this.liveDataStreamByChannelId[channelId];\n\n if (existingStream) {\n return existingStream;\n }\n\n const channel = this.getChannel(options.addr);\n this.liveDataStreamByChannelId[channelId] = new LiveDataStream({\n channelId,\n onShutdown: () => {\n delete this.liveDataStreamByChannelId[channelId];\n },\n liveEventsObservable: channel.getStream(),\n subscriberReadiness: this.dataStreamSubscriberReadiness,\n defaultStreamingFrameOptions,\n shutdownDelayInMs: dataStreamShutdownDelayInMs,\n });\n return this.liveDataStreamByChannelId[channelId];\n };\n /**\n * Connect to a channel and return results as DataFrames\n */\n getDataStream: CentrifugeSrv['getDataStream'] = (options) => {\n const subscriptionKey = this.createSubscriptionKey(options);\n\n const stream = this.getLiveDataStream(options);\n return stream.get(options, subscriptionKey);\n };\n\n /**\n * Executes a query over the live websocket. Query response can contain live channels we can subscribe to for further updates\n *\n * Since the initial request and subscription are on the same socket, this will support HA setups\n */\n getQueryData: CentrifugeSrv['getQueryData'] = async (options) => {\n if (!this.centrifuge.isConnected()) {\n await this.connectionBlocker;\n }\n return this.centrifuge.namedRPC('grafana.query', options.body);\n };\n\n /**\n * For channels that support presence, this will request the current state from the server.\n *\n * Join and leave messages will be sent to the open stream\n */\n getPresence: CentrifugeSrv['getPresence'] = (address) => {\n return this.getChannel(address).getPresence();\n };\n}\n\n// This is used to give a unique key for each stream. The actual value does not matter\nlet streamCounter = 0;\n","import * as comlink from 'comlink';\nimport { Subscriber } from 'rxjs';\n\n// Observers, ie. functions passed to `observable.subscribe(...)`, are converted to a subclass of `Subscriber` before they are sent to the source Observable.\n// The conversion happens internally in the RxJS library - this transfer handler is catches them and wraps them with a proxy\nconst subscriberTransferHandler: any = {\n canHandle(value: any): boolean {\n return value && value instanceof Subscriber;\n },\n\n serialize(value: Function): [MessagePort, Transferable[]] {\n const obj = comlink.proxy(value);\n\n const { port1, port2 } = new MessageChannel();\n\n comlink.expose(obj, port1);\n\n return [port2, [port2]];\n },\n\n deserialize(value: MessagePort): comlink.Remote {\n value.start();\n\n return comlink.wrap(value);\n },\n};\ncomlink.transferHandlers.set('SubscriberHandler', subscriberTransferHandler);\n","import { Labels } from '@grafana/data';\n\n/** replace labels in a string. Used for loki+prometheus legend formats */\nexport function renderLegendFormat(aliasPattern: string, aliasData: Labels): string {\n const aliasRegex = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return aliasPattern.replace(aliasRegex, (_, g1) => (aliasData[g1] ? aliasData[g1] : g1));\n}\n"],"names":["dateTimeParse","value","options","isDateTime","parseString","parseOthers","indexOf","isValid","moment","parse","roundUp","timeZone","fiscalYearStartMonth","getTimeZone","zone","format","systemDateFormats","name","lowerCase","date","typeList","Set","eventFactory","has","Error","add","BusEventBase","constructor","this","type","__proto__","BusEventWithPayload","payload","super","FieldConfigOptionsRegistry","Registry","fieldIndexComparer","field","reverse","values","FieldType","numericIndexComparer","stringIndexComparer","booleanIndexComparer","timeIndexComparer","naturalIndexComparer","timeComparer","a","b","isNumber","numericComparer","dateTime","isBefore","falsyComparer","stringComparer","localeCompare","booleanComparer","vA","get","vB","getFrameDisplayName","frame","index","valuesWithLabels","fields","labels","Object","keys","length","push","formatLabels","undefined","filter","f","map","getFieldDisplayName","join","refId","allFrames","existingTitle","state","displayName","hasConfigTitle","config","displayNameFromDS","TIME_SERIES_TIME_FIELD_NAME","parts","frameNamesDiffer","i","frameNameAdded","labelsAdded","TIME_SERIES_VALUE_FIELD_NAME","singleLabelName","frames","singleName","labelKey","getSingleLabelName","allLabels","dupeCount","foundSelf","otherField","getUniqueFieldName","calculateFieldDisplayName","XSSWL","xss","reduce","acc","element","concat","sanitizeXSS","whiteList","sanitizeTextPanelWhitelist","css","gap","order","sanitize","unsanitizedString","process","error","console","sanitizeTextPanelContent","sanitizeUrl","url","braintreeSanitizeUrl","hasAnsiCodes","input","test","escapeHtml","str","String","replace","createComponents","colors","shadows","panel","padding","headerHeight","background","primary","borderColor","border","weak","boxShadow","medium","borderHover","strong","text","mode","canvas","height","sm","md","lg","dropdown","tooltip","secondary","dashboard","overlay","sidemenu","width","createV1Theme","theme","oldCommon","typography","fontFamily","sansSerif","monospace","fontFamilyMonospace","size","base","fontSize","xs","heading","h1","h2","h3","h4","h5","h6","weight","light","fontWeightLight","regular","fontWeightRegular","semibold","fontWeightMedium","bold","fontWeightBold","lineHeight","bodySmall","body","link","decoration","hoverDecoration","breakpoints","xl","xxl","spacing","gridSize","insetSquishMd","d","xxs","gutter","formSpacingBase","formMargin","formFieldsetMargin","formInputHeight","formButtonHeight","formInputPaddingHorizontal","formInputAffixPaddingHorizontal","formInputMargin","formLabelPadding","formLabelMargin","formValidationMessagePadding","formValidationMessageMargin","inlineFormMargin","radius","shape","borderRadius","components","panelPadding","panelHeaderHeight","zIndex","basicColors","commonColorsPalette","black","white","dark1","dark2","dark3","dark4","dark5","dark6","dark7","dark8","dark9","dark10","gray1","gray2","gray3","gray4","gray5","gray6","gray7","redBase","redShade","greenBase","greenShade","red","yellow","purple","variable","orange","orangeDark","backgrounds","bg1","bg2","bg3","action","hover","dashboardBg","bgBlue1","main","bgBlue2","shade","borders","border1","border2","border3","textColors","textStrong","maxContrast","textHeading","textSemiWeak","textWeak","textFaint","disabled","textBlue","form","formLabel","formDescription","formInputBg","formInputBgDisabled","disabledBackground","formInputBorder","formInputBorderHover","formInputBorderActive","formInputBorderInvalid","formInputPlaceholderText","formInputText","formInputDisabledText","disabledText","formFocusOutline","formValidationMessageText","contrastText","formValidationMessageBg","GrafanaThemeType","isDark","isLight","palette","brandPrimary","brandSuccess","success","brandWarning","warning","brandDanger","queryRed","queryGreen","queryPurple","queryOrange","online","warn","critical","bodyBg","panelBg","panelBorder","pageHeaderBg","pageHeaderBorder","dropdownBg","dropdownShadow","dropdownOptionHoverBg","linkDisabled","linkHover","linkExternal","listItem","visualization","gray98","gray97","gray95","gray90","gray85","gray70","gray60","gray33","gray25","gray15","gray10","gray05","blue95","blue85","blue80","blue77","red88","createTheme","colorsInput","spacingInput","shapeInput","typographyInput","createColors","createBreakpoints","createSpacing","createShape","createTypography","createShadows","transitions","createTransitions","createVisualizationColors","v1","darkLayer0","darkLayer1","darkLayer2","darkBorder1","darkBorder2","gray100","gray80","lightBorder1","blueDarkMain","blueDarkText","redDarkMain","redDarkText","greenDarkMain","greenDarkText","orangeDarkMain","orangeDarkText","blueLightMain","blueLightText","redLightMain","redLightText","greenLightMain","greenLightText","orangeLightMain","orangeLightText","ReducerID","reduceField","reducers","calcs","missing","s","hasOwnProperty","queue","fieldReducers","list","reducer","id","emptyInputResult","nullValueMode","ignoreNulls","NullValueMode","nullAsZero","doStandardCalcs","lastNotNull","description","standard","aliasIds","calculateLastNotNull","last","calculateLast","first","calculateFirst","firstNotNull","calculateFirstNotNull","min","max","mean","sum","count","range","delta","step","diff","logmin","allIsZero","allIsNull","changeCount","calculateChangeCount","distinctCount","calculateDistinctCount","diffperc","allValues","toArray","Number","MAX_VALUE","nonNullCount","previousDeltaUp","data","isNumberField","currentValue","isFirst","idx","v","distinct","fieldTypeMatcher","FieldMatcherID","defaultOptions","getOptionsDisplayText","numericMatcher","timeMatcher","getFieldTypeMatchers","MatcherID","FrameMatcherID","ValueMatcherID","anyFieldMatcher","excludeFromPicker","children","option","getFieldMatcher","child","sub","matcher","fieldMatchers","anyFrameMatcher","getFrameMatchers","frameMatchers","allFieldsMatcher","allFramesMatcher","notFieldMatcher","check","notFrameMatcher","alwaysFieldMatcher","alwaysFrameMatcher","neverFieldMatcher","notTimeFieldMatcher","neverFrameMatcher","alwaysFieldMatcherInfo","alwaysFrameMatcherInfo","neverFieldMatcherInfo","neverFrameMatcherInfo","getFieldPredicateMatchers","getFramePredicateMatchers","refIdMacher","pattern","regex","stringToJsRegex","getRefIdMatchers","firstFieldMatcher","firstTimeFieldMatcher","find","getSimpleFieldMatchers","isEqualValueMatcher","valueIndex","isApplicable","getDefaultOptions","isNotEqualValueMatcher","getEqualValueMatchers","isNullValueMatcher","isNotNullValueMatcher","getNullValueMatchers","isGreaterValueMatcher","isNaN","isGreaterOrEqualValueMatcher","isLowerValueMatcher","isLowerOrEqualValueMatcher","getNumericValueMatchers","isBetweenValueMatcher","from","to","getRangeValueMatchers","regexValueMatcher","RegExp","getRegexValueMatcher","ensureColumnsTransformer","DataTransformerID","operator","source","pipe","transformer","timeFieldName","timeField","getTimeField","findConsistentTimeFieldName","seriesToColumnsTransformer","byField","filterFieldsTransformer","include","exclude","processed","series","copy","noopTransformer","filterFramesTransformer","filterFieldsByNameTransformer","getMatcherConfig","names","Array","isArray","filterFramesByRefIdTransformer","filterOptions","getJoinMatcher","joinBy","common","includes","pickBestJoinField","outerJoinDataFrames","frameCopy","joinFieldMatcher","joinIndex","findIndex","keepOriginIndices","fieldIndex","origin","frameIndex","joinField","unshift","enforceSort","isLikelyAscendingVector","sortDataFrame","keep","fieldIdx","nullModes","allData","originalFields","nullModesFrame","NULL_REMOVE","spanNulls","custom","NULL_RETAIN","NULL_EXPAND","joined","ArrayVector","nullExpand","yVals","nullIdxs","alignedLen","xi","lastNullIdx","nullIdx","tables","xVals","ti","len","sort","xIdxs","Map","set","t","si","ys","fill","nullMode","yVal","alignedIdx","mergeTransformer","dataFrames","fieldNames","fieldIndexByName","fieldNamesForKey","dataFrame","MutableDataFrame","addField","copyFieldStructure","fieldExistsInAllFrames","valuesByKey","valuesInOrder","keyFactory","createKeyFactory","valueMapper","createValueMapper","key","createPointer","valueWasMerged","existing","isMergable","pointer","omit","fieldPointerByName","keyFieldNames","factoryIndex","fieldName","fieldByName","fieldIndexByFrameIndex","mergable","prop","organizeFieldsTransformer","excludeByName","indexByName","renameByName","mapToExcludeArray","orderFieldsTransformer","renameFieldsTransformer","renamer","createRenamer","renameTo","seriesToRowsTransformer","isTimeSeries","timeFieldByIndex","targetFields","metricField","TIME_SERIES_METRIC_FIELD_NAME","timeFieldIndex","valueFieldIndex","sortByTransformer","attachFieldIndex","desc","sortDataFrames","LoadingState","FieldColorModeId","FALLBACK_COLOR","ThresholdsMode","MappingType","SpecialValueMatch","init","initialized","getIfExists","initialize","byId","ext","register","selectOptions","current","select","currentOptions","ordered","label","PluginState","ids","found","isEmpty","alias","anyToNumber","NaN","toNumber","BinaryOperationID","binaryOperators","Add","operation","Subtract","Multiply","Divide","makeFieldParser","guessFieldTypeFromValue","parseFloat","makeClassES5Compatible","ES6Class","Proxy","apply","target","self","argumentsList","Reflect","construct","alert","toPercent","decimals","toFixed","suffix","toPercentUnit","toHex0x","asHex","toHex","substring","toString","toUpperCase","sci","toExponential","getCategories","formats","fn","toFixedUnit","stringFormater","scaledUnits","locale","SIPrefix","currency","binaryPrefix","dateTimeAsIso","dateTimeAsIsoNoDateIfToday","dateTimeAsUS","dateTimeAsUSNoDateIfToday","getDateTimeAsLocalFormat","getDateTimeAsLocalFormatNoDateIfToday","dateTimeSystemFormatter","dateTimeFromNow","toNanoSeconds","toMicroSeconds","toMilliSeconds","toSeconds","toMinutes","toHours","toDays","toDurationInMilliseconds","toDurationInSeconds","toDurationInHoursMinutesSeconds","toDurationInDaysHoursMinutesSeconds","toTimeTicks","toClockMilliseconds","toClockSeconds","simpleCountUnit","booleanValueFormatter","Interval","UNITS","Year","Month","Week","Day","Hour","Minute","Second","Millisecond","INTERVALS_IN_SECONDS","Math","abs","toFixedScaled","scaledDecimals","toDuration","timeScale","strings","decrementDecimals","decimalsCount","interval","floor","unit","toClock","toUtc","hours","duration","asHours","slice","numHours","numMinutes","numSeconds","dayString","numDays","toDateTimeValueFormatter","todayPattern","isSame","dateTimeFormat","localTimeFormat","year","month","day","hour","minute","second","showMs","dateTimeFormatTimeAgo","symbol","asSuffix","scaler","scaled","prefix","getOffsetFromSIPrefix","c","offset","prefixes","units","p","FunctionalVector","buffer","toJSON","AsNumberVector","BinaryOperationVector","left","right","vectorToArray","ConstantVector","RowVector","columns","rowIndex","SortedVector","arr","toDataQueryError","err","message","status","statusText","CentrifugeLiveChannel","addr","Date","now","Subject","stream","observers","disconnect","currentStatus","LiveChannelEventType","timestamp","opened","LiveChannelConnectionState","isValidLiveChannelAddress","initalize","initalized","events","publish","ctx","schema","lastMessageWithSchema","next","sendStatus","log","subscribe","unsubscribe","user","info","leave","getStream","Observable","subscriber","initialMessage","setTimeout","disconnectIfNoListeners","subscription","presence","then","users","Promise","reject","removeAllListeners","complete","shutdownCallback","shutdownWithError","InternalStreamMessageType","filterMessages","packets","LiveDataStream","deps","ReplaySubject","liveEventsSubscription","onShutdown","observed","shutdown","channelId","evt","isLiveChannelMessageEvent","liveChannelStatusEvent","isLiveChannelStatusEvent","msg","frameBuffer","schemaChanged","ChangedSchema","NewValuesSameSchema","getValuesFromLastPacket","bufferOptions","needsResizing","resize","hasAtLeastOnePacket","shutdownTimeoutId","clearTimeout","subKey","clearShutdownTimeout","getStreamingFrameOptions","resizeBuffer","prepareInternalStreamForNewSubscription","fieldsNamesFilter","fieldFilterPredicate","matchingFieldIndexes","getFullFrameResponseData","getMatchingFieldIndexes","StreamingResponseDataType","serialize","shouldSendFullFrame","transformedInternalStream","canEmitObservable","subscriberReadiness","canEmit","emitBuffer","canEmitSub","val","sourceSub","messages","errors","lastError","some","n","newValueSameSchemaMessages","filteredValues","getNewValuesSameSchemaResponseData","j","shutdownIfNoSubscribers","shutdownDelayInMs","StreamingDataFrame","defaultStreamingFrameOptions","liveEventsObservable","onError","onComplete","onNext","maxLength","maxDelta","Infinity","StreamingFrameAction","CentrifugeService","context","connectionState","asObservable","address","getChannel","streamCounter","toLiveChannelId","existingStream","liveDataStreamByChannelId","channel","dataStreamSubscriberReadiness","subscriptionKey","createSubscriptionKey","getLiveDataStream","async","centrifuge","isConnected","connectionBlocker","namedRPC","getPresence","share","startWith","liveUrl","appUrl","Centrifuge","timeout","setConnectData","sessionId","orgId","liveEnabled","orgRole","connect","BehaviorSubject","resolve","connectListener","removeListener","addListener","on","onConnect","onDisconnect","onServerSideMessage","scope","namespace","path","open","delete","initChannel","catch","subscriberTransferHandler","canHandle","Subscriber","obj","comlink","port1","port2","MessageChannel","deserialize","start","renderLegendFormat","aliasPattern","aliasData","_","g1"],"sourceRoot":""}