autoql-fe-utils 1.0.67 → 1.0.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -124,7 +124,8 @@ declare class AggType {
124
124
  symbol?: string;
125
125
  fn?: Function;
126
126
  icon?: string;
127
- constructor({ type, displayName, tooltip, unit, icon, supportsStrings, symbol, fn, }: AggTypeParams);
127
+ sqlFn?: Function;
128
+ constructor({ type, displayName, tooltip, unit, icon, supportsStrings, symbol, sqlFn, fn, }: AggTypeParams);
128
129
  }
129
130
 
130
131
  declare class DataExplorerSubject {
@@ -160,7 +161,7 @@ declare const DEFAULT_CHART_CONFIG: {
160
161
  declare const MONTH_NAMES: string[];
161
162
  declare const DEFAULT_DATA_PAGE_SIZE = 50000;
162
163
  declare const MAX_DATA_PAGE_SIZE = 50000;
163
- declare const MAX_CHART_ELEMENTS = 300;
164
+ declare const MAX_CHART_ELEMENTS = 500;
164
165
  declare const WEEKDAY_NAMES_MON: string[];
165
166
  declare const WEEKDAY_NAMES_SUN: string[];
166
167
  declare const DOW_STYLES: string[];
@@ -495,6 +496,7 @@ interface RawColumn {
495
496
  is_visible?: boolean;
496
497
  multi_series?: boolean;
497
498
  drill_down?: string;
499
+ alt_name?: string;
498
500
  }
499
501
  interface Column extends RawColumn {
500
502
  aggType?: string;
@@ -511,6 +513,16 @@ interface Column extends RawColumn {
511
513
  pivot?: boolean;
512
514
  formatter?: Function;
513
515
  drilldownGroupby?: any;
516
+ additional?: boolean;
517
+ }
518
+ interface AvailableSelect {
519
+ table_column: string;
520
+ column_type: string;
521
+ display_name: string;
522
+ }
523
+ interface AdditionalSelect {
524
+ insertion: string;
525
+ columns: string[];
514
526
  }
515
527
  interface FilterLock {
516
528
  filter_type: string;
@@ -613,6 +625,7 @@ type AggTypeParams = {
613
625
  symbol?: string;
614
626
  fn?: Function;
615
627
  icon?: string;
628
+ sqlFn?: Function;
616
629
  };
617
630
  interface SubjectSuggestion {
618
631
  name: string;
@@ -1026,6 +1039,7 @@ declare const getNumberColumnIndices: (columns: any, isPivot?: any) => {
1026
1039
  currencyColumnIndex: any;
1027
1040
  quantityColumnIndex: any;
1028
1041
  ratioColumnIndex: any;
1042
+ countColumnIndex: any;
1029
1043
  allNumberColumnIndices: any[];
1030
1044
  };
1031
1045
  declare const getMultiSeriesColumnIndex: (columns: any) => any;
@@ -1063,7 +1077,7 @@ declare const makeEmptyArray: (w: any, h: any, value?: string) => any[];
1063
1077
  declare const removeElementAtIndex: (array: any, index: any) => any;
1064
1078
 
1065
1079
  declare const aggregateOtherCategory: (data: any, columnIndexConfig: any, maxElements?: number) => any;
1066
- declare const aggregateData: ({ data, aggColIndex, columns, numberIndices, dataFormatting, columnIndexConfig, maxElements, truncateAt, useBuckets, }: {
1080
+ declare const aggregateData: ({ data, aggColIndex, columns, numberIndices, dataFormatting, columnIndexConfig, maxElements, useBuckets, }: {
1067
1081
  data: any;
1068
1082
  aggColIndex: any;
1069
1083
  columns: any;
@@ -1071,7 +1085,6 @@ declare const aggregateData: ({ data, aggColIndex, columns, numberIndices, dataF
1071
1085
  dataFormatting: any;
1072
1086
  columnIndexConfig: any;
1073
1087
  maxElements: any;
1074
- truncateAt?: number;
1075
1088
  useBuckets?: boolean;
1076
1089
  }) => any;
1077
1090
  type CreatePivotDataParams = {
@@ -1155,6 +1168,153 @@ declare const initializeQueryValidationOptions: ({ responseBody, initialSelectio
1155
1168
  };
1156
1169
  declare const getQueryValidationQueryText: (newSelectedSuggestions: any, plainTextList: any) => string;
1157
1170
 
1171
+ declare const isError500Type: (referenceId: any) => boolean;
1172
+ declare const fetchSuggestions: ({ query, queryId, domain, apiKey, token, cancelToken, }?: {
1173
+ query?: string;
1174
+ queryId?: string;
1175
+ domain?: string;
1176
+ apiKey?: string;
1177
+ token?: string;
1178
+ cancelToken?: any;
1179
+ }) => Promise<axios.AxiosResponse<any, any>>;
1180
+ declare const runQueryNewPage: ({ queryId, domain, apiKey, token, page, cancelToken, }?: {
1181
+ queryId?: string;
1182
+ domain?: string;
1183
+ apiKey?: string;
1184
+ token?: string;
1185
+ page?: number;
1186
+ cancelToken?: any;
1187
+ }) => Promise<any>;
1188
+ interface QueryParams {
1189
+ query?: string;
1190
+ userSelection?: Object[];
1191
+ userSelectionFinal?: Object[];
1192
+ debug?: boolean;
1193
+ test?: boolean;
1194
+ domain?: string;
1195
+ apiKey?: string;
1196
+ token?: string;
1197
+ source?: string;
1198
+ filters?: Object[];
1199
+ orders?: Object[];
1200
+ tableFilters?: Object[];
1201
+ pageSize?: number;
1202
+ allowSuggestions?: boolean;
1203
+ cancelToken?: any;
1204
+ scope?: string;
1205
+ enableQueryValidation?: boolean;
1206
+ skipQueryValidation?: boolean;
1207
+ newColumns?: AdditionalSelect[];
1208
+ }
1209
+ interface ColumnSelect {
1210
+ display_name: string;
1211
+ column_type: string;
1212
+ table_column: string;
1213
+ }
1214
+ declare const runQueryOnly: ({ query, userSelection, userSelectionFinal, debug, test, domain, apiKey, token, source, filters, orders, tableFilters, pageSize, allowSuggestions, cancelToken, scope, newColumns, }?: QueryParams) => Promise<TransformedAxiosResponse | axios.AxiosResponse<any, any>>;
1215
+ declare const runQueryValidation: ({ text, domain, apiKey, token, cancelToken, }?: {
1216
+ text?: string;
1217
+ domain?: string;
1218
+ apiKey?: string;
1219
+ token?: string;
1220
+ cancelToken?: any;
1221
+ }) => Promise<axios.AxiosResponse<any, any>>;
1222
+ declare const runQuery: ({ query, userSelection, userSelectionFinal, debug, test, domain, apiKey, token, source, filters, orders, tableFilters, pageSize, allowSuggestions, cancelToken, enableQueryValidation, skipQueryValidation, scope, }?: QueryParams) => Promise<TransformedAxiosResponse | axios.AxiosResponse<any, any>>;
1223
+ declare const exportCSV: ({ queryId, domain, apiKey, token, csvProgressCallback, }?: {
1224
+ queryId?: string;
1225
+ domain?: string;
1226
+ apiKey?: string;
1227
+ token?: string;
1228
+ csvProgressCallback?: Function;
1229
+ }) => Promise<axios.AxiosResponse<any, any>>;
1230
+ declare const runDrilldown: ({ queryID, groupBys, debug, test, domain, apiKey, token, orders, source, tableFilters, cancelToken, pageSize, }?: {
1231
+ queryID?: string;
1232
+ groupBys?: Object[];
1233
+ debug?: boolean;
1234
+ test?: boolean;
1235
+ domain?: string;
1236
+ apiKey?: string;
1237
+ token?: string;
1238
+ orders?: Object[];
1239
+ source?: string;
1240
+ tableFilters?: Object[];
1241
+ cancelToken?: any;
1242
+ pageSize?: number;
1243
+ }) => Promise<TransformedAxiosResponse>;
1244
+ declare const fetchTopics: ({ domain, token, apiKey, }?: {
1245
+ domain?: string;
1246
+ apiKey?: string;
1247
+ token?: string;
1248
+ }) => Promise<axios.AxiosResponse<any, any>>;
1249
+ declare const fetchAutocomplete: ({ suggestion, domain, apiKey, token, }?: {
1250
+ suggestion?: string;
1251
+ domain?: string;
1252
+ apiKey?: string;
1253
+ token?: string;
1254
+ }) => Promise<axios.AxiosResponse<any, any>>;
1255
+ declare const fetchVLAutocomplete: ({ suggestion, domain, token, apiKey, context, filter, cancelToken, }?: {
1256
+ suggestion?: string;
1257
+ domain?: string;
1258
+ apiKey?: string;
1259
+ token?: string;
1260
+ context?: string;
1261
+ filter?: string;
1262
+ cancelToken?: any;
1263
+ }) => Promise<axios.AxiosResponse<any, any>>;
1264
+ declare const fetchFilters: ({ apiKey, token, domain, }?: {
1265
+ domain?: string;
1266
+ apiKey?: string;
1267
+ token?: string;
1268
+ }) => Promise<axios.AxiosResponse<any, any>>;
1269
+ declare const setFilters: ({ apiKey, token, domain, filters, }?: {
1270
+ domain?: string;
1271
+ apiKey?: string;
1272
+ token?: string;
1273
+ filters?: Object[];
1274
+ }) => Promise<axios.AxiosResponse<any, any>>;
1275
+ declare const unsetFilterFromAPI: ({ apiKey, token, domain, filter, }?: {
1276
+ domain?: string;
1277
+ apiKey?: string;
1278
+ token?: string;
1279
+ filter?: {
1280
+ id: string;
1281
+ };
1282
+ }) => Promise<axios.AxiosResponse<any, any>>;
1283
+ declare const setColumnVisibility: ({ apiKey, token, domain, columns, }?: {
1284
+ domain?: string;
1285
+ apiKey?: string;
1286
+ token?: string;
1287
+ columns?: any[];
1288
+ }) => Promise<axios.AxiosResponse<any, any>>;
1289
+ declare const sendSuggestion: ({ queryId, suggestion, apiKey, domain, token, }?: {
1290
+ queryId?: string;
1291
+ suggestion?: boolean;
1292
+ domain?: string;
1293
+ apiKey?: string;
1294
+ token?: string;
1295
+ }) => Promise<axios.AxiosResponse<any, any>>;
1296
+ declare const fetchExploreQueries: ({ keywords, pageSize, pageNumber, domain, apiKey, token, skipQueryValidation, }?: {
1297
+ keywords?: string;
1298
+ pageSize?: number;
1299
+ pageNumber?: number;
1300
+ domain?: string;
1301
+ apiKey?: string;
1302
+ token?: string;
1303
+ skipQueryValidation?: boolean;
1304
+ }) => Promise<axios.AxiosResponse<any, any>>;
1305
+ declare const reportProblem: ({ message, queryId, domain, apiKey, token, }?: {
1306
+ message?: string;
1307
+ queryId?: string;
1308
+ domain?: string;
1309
+ apiKey?: string;
1310
+ token?: string;
1311
+ }) => Promise<axios.AxiosResponse<any, any>>;
1312
+
1313
+ declare const formatAdditionalSelectColumn: (column: ColumnSelect, sqlFn?: Function) => {
1314
+ insertion: string;
1315
+ columns: string[];
1316
+ };
1317
+
1158
1318
  declare const dataStructureChanged: (props: any, prevProps: any) => boolean;
1159
1319
  declare const onlySeriesVisibilityChanged: (props: any, prevProps: any) => boolean;
1160
1320
  declare const scaleZero: (scale: any) => any;
@@ -2059,142 +2219,6 @@ declare const removeNotificationChannel: ({ channelId, domain, apiKey, token }:
2059
2219
  token: any;
2060
2220
  }) => Promise<axios.AxiosResponse<any, any>>;
2061
2221
 
2062
- declare const isError500Type: (referenceId: any) => boolean;
2063
- declare const fetchSuggestions: ({ query, queryId, domain, apiKey, token, cancelToken, }?: {
2064
- query?: string;
2065
- queryId?: string;
2066
- domain?: string;
2067
- apiKey?: string;
2068
- token?: string;
2069
- cancelToken?: any;
2070
- }) => Promise<axios.AxiosResponse<any, any>>;
2071
- declare const runQueryNewPage: ({ queryId, domain, apiKey, token, page, cancelToken, }?: {
2072
- queryId?: string;
2073
- domain?: string;
2074
- apiKey?: string;
2075
- token?: string;
2076
- page?: number;
2077
- cancelToken?: any;
2078
- }) => Promise<any>;
2079
- interface QueryParams {
2080
- query?: string;
2081
- userSelection?: Object[];
2082
- userSelectionFinal?: Object[];
2083
- debug?: boolean;
2084
- test?: boolean;
2085
- domain?: string;
2086
- apiKey?: string;
2087
- token?: string;
2088
- source?: string;
2089
- filters?: Object[];
2090
- orders?: Object[];
2091
- tableFilters?: Object[];
2092
- pageSize?: number;
2093
- allowSuggestions?: boolean;
2094
- cancelToken?: any;
2095
- scope?: string;
2096
- enableQueryValidation?: boolean;
2097
- skipQueryValidation?: boolean;
2098
- }
2099
- declare const runQueryOnly: ({ query, userSelection, userSelectionFinal, debug, test, domain, apiKey, token, source, filters, orders, tableFilters, pageSize, allowSuggestions, cancelToken, scope, }?: QueryParams) => Promise<TransformedAxiosResponse | axios.AxiosResponse<any, any>>;
2100
- declare const runQueryValidation: ({ text, domain, apiKey, token, cancelToken, }?: {
2101
- text?: string;
2102
- domain?: string;
2103
- apiKey?: string;
2104
- token?: string;
2105
- cancelToken?: any;
2106
- }) => Promise<axios.AxiosResponse<any, any>>;
2107
- declare const runQuery: ({ query, userSelection, userSelectionFinal, debug, test, domain, apiKey, token, source, filters, orders, tableFilters, pageSize, allowSuggestions, cancelToken, enableQueryValidation, skipQueryValidation, scope, }?: QueryParams) => Promise<TransformedAxiosResponse | axios.AxiosResponse<any, any>>;
2108
- declare const exportCSV: ({ queryId, domain, apiKey, token, csvProgressCallback, }?: {
2109
- queryId?: string;
2110
- domain?: string;
2111
- apiKey?: string;
2112
- token?: string;
2113
- csvProgressCallback?: Function;
2114
- }) => Promise<axios.AxiosResponse<any, any>>;
2115
- declare const runDrilldown: ({ queryID, groupBys, debug, test, domain, apiKey, token, orders, source, tableFilters, cancelToken, pageSize, }?: {
2116
- queryID?: string;
2117
- groupBys?: Object[];
2118
- debug?: boolean;
2119
- test?: boolean;
2120
- domain?: string;
2121
- apiKey?: string;
2122
- token?: string;
2123
- orders?: Object[];
2124
- source?: string;
2125
- tableFilters?: Object[];
2126
- cancelToken?: any;
2127
- pageSize?: number;
2128
- }) => Promise<TransformedAxiosResponse>;
2129
- declare const fetchTopics: ({ domain, token, apiKey, }?: {
2130
- domain?: string;
2131
- apiKey?: string;
2132
- token?: string;
2133
- }) => Promise<axios.AxiosResponse<any, any>>;
2134
- declare const fetchAutocomplete: ({ suggestion, domain, apiKey, token, }?: {
2135
- suggestion?: string;
2136
- domain?: string;
2137
- apiKey?: string;
2138
- token?: string;
2139
- }) => Promise<axios.AxiosResponse<any, any>>;
2140
- declare const fetchVLAutocomplete: ({ suggestion, domain, token, apiKey, context, filter, cancelToken, }?: {
2141
- suggestion?: string;
2142
- domain?: string;
2143
- apiKey?: string;
2144
- token?: string;
2145
- context?: string;
2146
- filter?: string;
2147
- cancelToken?: any;
2148
- }) => Promise<axios.AxiosResponse<any, any>>;
2149
- declare const fetchFilters: ({ apiKey, token, domain, }?: {
2150
- domain?: string;
2151
- apiKey?: string;
2152
- token?: string;
2153
- }) => Promise<axios.AxiosResponse<any, any>>;
2154
- declare const setFilters: ({ apiKey, token, domain, filters, }?: {
2155
- domain?: string;
2156
- apiKey?: string;
2157
- token?: string;
2158
- filters?: Object[];
2159
- }) => Promise<axios.AxiosResponse<any, any>>;
2160
- declare const unsetFilterFromAPI: ({ apiKey, token, domain, filter, }?: {
2161
- domain?: string;
2162
- apiKey?: string;
2163
- token?: string;
2164
- filter?: {
2165
- id: string;
2166
- };
2167
- }) => Promise<axios.AxiosResponse<any, any>>;
2168
- declare const setColumnVisibility: ({ apiKey, token, domain, columns, }?: {
2169
- domain?: string;
2170
- apiKey?: string;
2171
- token?: string;
2172
- columns?: any[];
2173
- }) => Promise<axios.AxiosResponse<any, any>>;
2174
- declare const sendSuggestion: ({ queryId, suggestion, apiKey, domain, token, }?: {
2175
- queryId?: string;
2176
- suggestion?: boolean;
2177
- domain?: string;
2178
- apiKey?: string;
2179
- token?: string;
2180
- }) => Promise<axios.AxiosResponse<any, any>>;
2181
- declare const fetchExploreQueries: ({ keywords, pageSize, pageNumber, domain, apiKey, token, skipQueryValidation, }?: {
2182
- keywords?: string;
2183
- pageSize?: number;
2184
- pageNumber?: number;
2185
- domain?: string;
2186
- apiKey?: string;
2187
- token?: string;
2188
- skipQueryValidation?: boolean;
2189
- }) => Promise<axios.AxiosResponse<any, any>>;
2190
- declare const reportProblem: ({ message, queryId, domain, apiKey, token, }?: {
2191
- message?: string;
2192
- queryId?: string;
2193
- domain?: string;
2194
- apiKey?: string;
2195
- token?: string;
2196
- }) => Promise<axios.AxiosResponse<any, any>>;
2197
-
2198
2222
  declare const getQueryFn: (response: TransformedAxiosResponse | undefined) => ({ authentication, autoQLConfig, originalQueryID, formattedTableParams, clickedFilter, ...args }: {
2199
2223
  [x: string]: any;
2200
2224
  authentication?: {};
@@ -2203,8 +2227,8 @@ declare const getQueryFn: (response: TransformedAxiosResponse | undefined) => ({
2203
2227
  formattedTableParams: any;
2204
2228
  clickedFilter: any;
2205
2229
  }) => any;
2206
- declare const transformQueryResponse: (response: AxiosResponse | undefined, originalQueryID?: string, isDrilldown?: boolean) => TransformedAxiosResponse;
2207
- declare const transformQueryResponseColumns: (response: AxiosResponse) => Column[];
2230
+ declare const transformQueryResponse: (response: AxiosResponse | undefined, originalQueryID?: string, isDrilldown?: boolean, newColumns?: AdditionalSelect[]) => TransformedAxiosResponse;
2231
+ declare const transformQueryResponseColumns: (response: AxiosResponse, addedColumns?: AdditionalSelect[]) => Column[];
2208
2232
 
2209
2233
  declare const sendTrainingData: ({ trainingData, apiKey, domain, token, }?: {
2210
2234
  trainingData?: object;
@@ -2269,4 +2293,4 @@ declare function color(): {
2269
2293
  on(): any;
2270
2294
  };
2271
2295
 
2272
- export { AGG_TYPES, AXIS_TITLE_BORDER_PADDING_LEFT, AXIS_TITLE_BORDER_PADDING_TOP, AXIS_TITLE_PADDING_BOTTOM, AXIS_TITLE_PADDING_TOP, AggType, AggTypeParams, AggTypes, Authentication, AutoQLJWT, AxiosResponse, BUTTON_PADDING, CHARTS_WITHOUT_AGGREGATED_DATA, CHARTS_WITHOUT_AXES, CHARTS_WITHOUT_LEGENDS, CHART_PADDING, CHART_TYPES, COLUMN_TYPES, COMPARE_TYPE, CONTINUOUS_TYPE, CUSTOM_TYPE, Column, Column$1 as ColumnObj, ColumnType, ColumnTypes, DATA_ALERT_CONDITION_TYPES, DATA_ALERT_ENABLED_STATUSES, DATA_ALERT_FREQUENCY_TYPE_OPTIONS, DATA_ALERT_OPERATORS, DATA_ALERT_STATUSES, DATE_ONLY_CHART_TYPES, DAYJS_PRECISION_FORMATS, DEFAULT_AGG_TYPE, DEFAULT_CHART_CONFIG, DEFAULT_CSS_PREFIX, DEFAULT_DATA_PAGE_SIZE, DEFAULT_EVALUATION_FREQUENCY, DEFAULT_LEGEND_PADDING_BOTTOM, DEFAULT_LEGEND_PADDING_LEFT, DEFAULT_LEGEND_PADDING_RIGHT, DEFAULT_LEGEND_PADDING_TOP, DEFAULT_MAX_LEGEND_WIDTH, DEFAULT_SOURCE, DISPLAY_TYPES, DOUBLE_AXIS_CHART_TYPES, DOW_STYLES, DataExplorerSubject, DataExplorerSubjectFilter, DataExplorerSubjectGroups, DataExplorerSubjectInterface, DataExplorerSuggestion, DataExplorerTypes, DataFormatting, DateStringPrecisionTypes, DateUTC, DisplayTypes, EVALUATION_FREQUENCY_OPTIONS, EXISTS_TYPE, FilterLock, FrontendReq, GENERAL_ERROR, GENERAL_HTML_ERROR, GENERAL_QUERY_ERROR, GROUP_TERM_TYPE, HORIZONTAL_LEGEND_SPACING, LABEL_FONT_SIZE, LEGEND_BORDER_PADDING, LEGEND_BORDER_THICKNESS, LEGEND_SHAPE_SIZE, LEGEND_TOP_ADJUSTMENT, LOAD_MORE_DROPDOWN_PADDING_BOTTOM, MAX_CHART_ELEMENTS, MAX_DATA_PAGE_SIZE, MAX_LEGEND_LABELS, MAX_RECENT_SEARCHES, MAX_ROWS_FOR_PIE_CHART, MINIMUM_INNER_HEIGHT, MINIMUM_INNER_WIDTH, MINIMUM_TITLE_LENGTH, MIN_HISTOGRAM_SAMPLE, MONTH_DAY_SELECT_OPTIONS, MONTH_NAMES, NUMBER_TERM_TYPE, PATH_SMOOTHING, PERIODIC_TYPE, PROJECT_TYPE, ParsedInterpretation, ParsedInterpretationChunk, PrecisionTypes, QUERY_TERM_TYPE, QUERY_TIMEOUT_ERROR, QueryData, QueryErrorTypes, QueryResponse, REQUEST_CANCELLED_ERROR, RESET_PERIOD_OPTIONS, RawColumn, Rows, SCHEDULED_TYPE, SCHEDULE_FREQUENCY_OPTIONS, SCHEDULE_INTERVAL_OPTIONS, SEASON_NAMES, SampleQueryReplacementTypes, Scale, SubjectSuggestion, TABLE_TYPES, TITLE_FONT_SIZE, TableConfig, Theme, ThemeType, TransformedAxiosResponse, TransformedQueryResponse, UNAUTHENTICATED_ERROR, VERTICAL_LEGEND_SPACING, ValueLabel, ValueLabelSuggestion, WEEKDAY_NAMES_MON, WEEKDAY_NAMES_SUN, addSubjectToRecentSearches, addUserToProjectRule, adjustBottomTitleToFit, adjustMinAndMaxForScaleRatio, adjustTitleToFit, adjustTopTitleToFit, adjustVerticalTitleToFit, aggregateData, aggregateOtherCategory, animateInputText, applyLegendTitleStyles, applyStylesForHiddenSeries, areAllColumnsHidden, areSomeColumnsHidden, authenticationDefault, autoQLConfigDefault, bezierCommand, calculateMinAndMaxSums, capitalizeFirstChar, cloneObject, configureTheme, constructFilter, constructRTArray, convertToNumber, countDecimals, createDataAlert, createNotificationChannel, createSVGPath, currentEventLoopEnd, dataConfigDefault, dataFormattingDefault, dataStructureChanged, dateSortFn, dateStringSortFn, deepEqual, deleteDataAlert, deleteNotification, difference, dismissAllNotifications, dismissNotification, distributeListsEvenly, doesElementOverflowContainer, exportCSV, fetchAutocomplete, fetchDataAlerts, fetchDataExplorerAutocomplete, fetchDataExplorerSampleQueries, fetchDataExplorerSuggestions, fetchDataPreview, fetchExploreQueries, fetchFilters, fetchNotificationChannels, fetchNotificationCount, fetchNotificationData, fetchNotificationFeed, fetchRule, fetchSubjectList, fetchSubjectListV2, fetchSuggestions, fetchTopics, fetchTopicsForVL, fetchVLAutocomplete, formatChartLabel, formatDatePivotMonth, formatDatePivotYear, formatDateStringType, formatDateType, formatElement, formatEpochDate, formatFiltersForAPI, formatISODateWithPrecision, formatNextScheduleDate, formatNumberFilterValue, formatQueryColumns, formatResetDate, formatSortersForAPI, formatStringDate, formatStringDateWithPrecision, formatTableParams, functionsEqual, generateDatePivotData, generateFilterDrilldownResponse, generatePivotData, generatePivotTableData, getAggConfig, getAuthentication, getAutoQLConfig, getAxis, getAxisLabelsBbox, getBBoxFromRef, getBandScale, getBarRectObj, getBinData, getBinLinearScale, getBubbleObj, getChartColorVars, getChartScaleRatio, getColorScale, getColorScales, getColumnDateRanges, getColumnIndexConfig, getColumnNameForDateRange, getColumnRectObj, getColumnTypeAmounts, getCombinedFilters, getCurrencySymbol, getDataConfig, getDataFormatting, getDateColumnIndex, getDateRangeIntersection, getDateRangesFromInterpretation, getDatesFromRT, getDayJSObj, getDayLocalStartDate, getDayjsObjForStringType, getDefaultBucketConfig, getDefaultDisplayType, getDrilldownData, getDrilldownGroupby, getEpochFromDate, getFilterDrilldown, getFilterPrecision, getFirstChartDisplayType, getGroupBys, getGroupBysFromPivotTable, getGroupBysFromTable, getGroupableColumns, getHeatmapRectObj, getHiddenColumns, getHistogramColumnObj, getHistogramScale, getInitialBucketSize, getInitialSelections, getKey, getKeyByValue, getLabelsBBox, getLegendLabels, getLegendLabelsForGroupbyQuery, getLegendLabelsForMultiSeries, getLegendLabelsForSingleColumn, getLegendLocation, getLegendScale, getLegendTitleFromColumns, getLineVertexObj, getLinearAxisTitle, getLinearScale, getLinearScales, getMaxLegendHeight, getMaxLegendSectionWidth, getMaxTickLabelWidth, getMaxValueFromKeyValueObj, getMinAndMaxValues, getMinValueFromKeyValueObj, getMonthLocalStartDate, getMultiSeriesColumnIndex, getNiceDateTickValues, getNiceTickValues, getNumberAxisUnits, getNumberColumnIndices, getNumberFormatConfig, getNumberOfGroupables, getNumberOfSeries, getObjSize, getOpacityScale, getPadding, getPieChartData, getPivotColumnIndexConfig, getPlainTextList, getPointObj, getPotentialDisplayTypes, getPrecisionForDayJS, getQueryFn, getQueryParams, getQueryRequestParams, getQueryValidationQueryText, getRadiusScale, getRangeForAxis, getRecentSearchesFromLocalStorage, getRecentSelectionID, getRowNumberListForPopover, getSVGBase64, getSampleQueryRegex, getSampleQueryText, getScheduleFrequencyObject, getStartAndEndDateFromDateStrs, getStringColumnIndices, getStringFromSource, getSuggestionLists, getSupportedConditionTypes, getSupportedDisplayTypes, getThemeType, getThemeValue, getTickSizeFromNumTicks, getTickValues, getTimeFrameTextFromChunk, getTimeObjFromTimeStamp, getTimeRangeFromDateArray, getTimeRangeFromRT, getTimeScale, getTitleCase, getTooltipContent, getTotalBottomPadding, getTotalHorizontalPadding, getTotalLeftPadding, getTotalPossibleLegendSections, getTotalRightPadding, getTotalTopPadding, getTotalVerticalPadding, getUniqueYearsForColumn, getUnitSymbol, getUnitsForColumn, getVisibleColumns, getWeekLocalStartDate, getWeekdayFromTimeStamp, getlegendLabelSections, handleTooltipBoundaryCollision, hasColumnIndex, hasData, hasDateColumn, hasMoreData, hasNumberColumn, hasStringColumn, initializeAlert, initializeQueryValidationOptions, invertArray, isAggSeed, isAggregation, isChartType, isColumnDateType, isColumnIndexConfigValid, isColumnIndexValid, isColumnIndicesValid, isColumnNumberType, isColumnStringType, isDataLimited, isDisplayTypeValid, isDrilldown, isError500Type, isExpressionQueryValid, isISODate, isInitialSelectionValid, isListQuery, isNumber, isObject, isSingleValueResponse, isTableType, color as legendColor, lineCommand, makeEmptyArray, markNotificationAsUnread, mergeBboxes, mergeBoundingClientRects, mergeSources, nameValueObject, numberIndicesArraysOverlap, numberSortFn, onTableCellClick, onlySeriesVisibilityChanged, onlyUnique, parseJwt, potentiallySupportsDatePivot, potentiallySupportsPivot, removeElementAtIndex, removeFromDOM, removeHiddenLegendLabels, removeNotificationChannel, removeUserFromProjectRule, reportProblem, resetDateIsFuture, resetNotificationCount, rotateArray, roundDownToNearestMultiple, roundToNearestLog10, roundToNearestMultiple, roundUpToNearestMultiple, runDrilldown, runQuery, runQueryNewPage, runQueryOnly, runQueryValidation, scaleZero, sendDataToChannel, sendSuggestion, sendTrainingData, setCaretPosition, setColumnVisibility, setFilterFunction, setFilters, setHeaderFilterPlaceholder, setRecentSearchesInLocalStorage, setSorterFunction, setTickSize, setTickValues, shouldDisableChartScale, shouldLabelsRotate, shouldPlotMultiSeries, showEvaluationFrequencySetting, sortDataByAlphabet, sortDataByColumn, sortDataByDate, supportsDatePivotTable, supportsPieChart, supportsRegularPivotTable, svgPathD, svgToPng, tableFilterParams, toggleCustomDataAlertStatus, toggleProjectDataAlertStatus, transformLabels, transformQueryResponse, transformQueryResponseColumns, unsetFilterFromAPI, updateDataAlert, updateDataAlertStatus, updateStartAndEndIndexes, usePivotDataForChart, uuidv4, validateExpression };
2296
+ export { AGG_TYPES, AXIS_TITLE_BORDER_PADDING_LEFT, AXIS_TITLE_BORDER_PADDING_TOP, AXIS_TITLE_PADDING_BOTTOM, AXIS_TITLE_PADDING_TOP, AdditionalSelect, AggType, AggTypeParams, AggTypes, Authentication, AutoQLJWT, AvailableSelect, AxiosResponse, BUTTON_PADDING, CHARTS_WITHOUT_AGGREGATED_DATA, CHARTS_WITHOUT_AXES, CHARTS_WITHOUT_LEGENDS, CHART_PADDING, CHART_TYPES, COLUMN_TYPES, COMPARE_TYPE, CONTINUOUS_TYPE, CUSTOM_TYPE, Column, Column$1 as ColumnObj, ColumnSelect, ColumnType, ColumnTypes, DATA_ALERT_CONDITION_TYPES, DATA_ALERT_ENABLED_STATUSES, DATA_ALERT_FREQUENCY_TYPE_OPTIONS, DATA_ALERT_OPERATORS, DATA_ALERT_STATUSES, DATE_ONLY_CHART_TYPES, DAYJS_PRECISION_FORMATS, DEFAULT_AGG_TYPE, DEFAULT_CHART_CONFIG, DEFAULT_CSS_PREFIX, DEFAULT_DATA_PAGE_SIZE, DEFAULT_EVALUATION_FREQUENCY, DEFAULT_LEGEND_PADDING_BOTTOM, DEFAULT_LEGEND_PADDING_LEFT, DEFAULT_LEGEND_PADDING_RIGHT, DEFAULT_LEGEND_PADDING_TOP, DEFAULT_MAX_LEGEND_WIDTH, DEFAULT_SOURCE, DISPLAY_TYPES, DOUBLE_AXIS_CHART_TYPES, DOW_STYLES, DataExplorerSubject, DataExplorerSubjectFilter, DataExplorerSubjectGroups, DataExplorerSubjectInterface, DataExplorerSuggestion, DataExplorerTypes, DataFormatting, DateStringPrecisionTypes, DateUTC, DisplayTypes, EVALUATION_FREQUENCY_OPTIONS, EXISTS_TYPE, FilterLock, FrontendReq, GENERAL_ERROR, GENERAL_HTML_ERROR, GENERAL_QUERY_ERROR, GROUP_TERM_TYPE, HORIZONTAL_LEGEND_SPACING, LABEL_FONT_SIZE, LEGEND_BORDER_PADDING, LEGEND_BORDER_THICKNESS, LEGEND_SHAPE_SIZE, LEGEND_TOP_ADJUSTMENT, LOAD_MORE_DROPDOWN_PADDING_BOTTOM, MAX_CHART_ELEMENTS, MAX_DATA_PAGE_SIZE, MAX_LEGEND_LABELS, MAX_RECENT_SEARCHES, MAX_ROWS_FOR_PIE_CHART, MINIMUM_INNER_HEIGHT, MINIMUM_INNER_WIDTH, MINIMUM_TITLE_LENGTH, MIN_HISTOGRAM_SAMPLE, MONTH_DAY_SELECT_OPTIONS, MONTH_NAMES, NUMBER_TERM_TYPE, PATH_SMOOTHING, PERIODIC_TYPE, PROJECT_TYPE, ParsedInterpretation, ParsedInterpretationChunk, PrecisionTypes, QUERY_TERM_TYPE, QUERY_TIMEOUT_ERROR, QueryData, QueryErrorTypes, QueryResponse, REQUEST_CANCELLED_ERROR, RESET_PERIOD_OPTIONS, RawColumn, Rows, SCHEDULED_TYPE, SCHEDULE_FREQUENCY_OPTIONS, SCHEDULE_INTERVAL_OPTIONS, SEASON_NAMES, SampleQueryReplacementTypes, Scale, SubjectSuggestion, TABLE_TYPES, TITLE_FONT_SIZE, TableConfig, Theme, ThemeType, TransformedAxiosResponse, TransformedQueryResponse, UNAUTHENTICATED_ERROR, VERTICAL_LEGEND_SPACING, ValueLabel, ValueLabelSuggestion, WEEKDAY_NAMES_MON, WEEKDAY_NAMES_SUN, addSubjectToRecentSearches, addUserToProjectRule, adjustBottomTitleToFit, adjustMinAndMaxForScaleRatio, adjustTitleToFit, adjustTopTitleToFit, adjustVerticalTitleToFit, aggregateData, aggregateOtherCategory, animateInputText, applyLegendTitleStyles, applyStylesForHiddenSeries, areAllColumnsHidden, areSomeColumnsHidden, authenticationDefault, autoQLConfigDefault, bezierCommand, calculateMinAndMaxSums, capitalizeFirstChar, cloneObject, configureTheme, constructFilter, constructRTArray, convertToNumber, countDecimals, createDataAlert, createNotificationChannel, createSVGPath, currentEventLoopEnd, dataConfigDefault, dataFormattingDefault, dataStructureChanged, dateSortFn, dateStringSortFn, deepEqual, deleteDataAlert, deleteNotification, difference, dismissAllNotifications, dismissNotification, distributeListsEvenly, doesElementOverflowContainer, exportCSV, fetchAutocomplete, fetchDataAlerts, fetchDataExplorerAutocomplete, fetchDataExplorerSampleQueries, fetchDataExplorerSuggestions, fetchDataPreview, fetchExploreQueries, fetchFilters, fetchNotificationChannels, fetchNotificationCount, fetchNotificationData, fetchNotificationFeed, fetchRule, fetchSubjectList, fetchSubjectListV2, fetchSuggestions, fetchTopics, fetchTopicsForVL, fetchVLAutocomplete, formatAdditionalSelectColumn, formatChartLabel, formatDatePivotMonth, formatDatePivotYear, formatDateStringType, formatDateType, formatElement, formatEpochDate, formatFiltersForAPI, formatISODateWithPrecision, formatNextScheduleDate, formatNumberFilterValue, formatQueryColumns, formatResetDate, formatSortersForAPI, formatStringDate, formatStringDateWithPrecision, formatTableParams, functionsEqual, generateDatePivotData, generateFilterDrilldownResponse, generatePivotData, generatePivotTableData, getAggConfig, getAuthentication, getAutoQLConfig, getAxis, getAxisLabelsBbox, getBBoxFromRef, getBandScale, getBarRectObj, getBinData, getBinLinearScale, getBubbleObj, getChartColorVars, getChartScaleRatio, getColorScale, getColorScales, getColumnDateRanges, getColumnIndexConfig, getColumnNameForDateRange, getColumnRectObj, getColumnTypeAmounts, getCombinedFilters, getCurrencySymbol, getDataConfig, getDataFormatting, getDateColumnIndex, getDateRangeIntersection, getDateRangesFromInterpretation, getDatesFromRT, getDayJSObj, getDayLocalStartDate, getDayjsObjForStringType, getDefaultBucketConfig, getDefaultDisplayType, getDrilldownData, getDrilldownGroupby, getEpochFromDate, getFilterDrilldown, getFilterPrecision, getFirstChartDisplayType, getGroupBys, getGroupBysFromPivotTable, getGroupBysFromTable, getGroupableColumns, getHeatmapRectObj, getHiddenColumns, getHistogramColumnObj, getHistogramScale, getInitialBucketSize, getInitialSelections, getKey, getKeyByValue, getLabelsBBox, getLegendLabels, getLegendLabelsForGroupbyQuery, getLegendLabelsForMultiSeries, getLegendLabelsForSingleColumn, getLegendLocation, getLegendScale, getLegendTitleFromColumns, getLineVertexObj, getLinearAxisTitle, getLinearScale, getLinearScales, getMaxLegendHeight, getMaxLegendSectionWidth, getMaxTickLabelWidth, getMaxValueFromKeyValueObj, getMinAndMaxValues, getMinValueFromKeyValueObj, getMonthLocalStartDate, getMultiSeriesColumnIndex, getNiceDateTickValues, getNiceTickValues, getNumberAxisUnits, getNumberColumnIndices, getNumberFormatConfig, getNumberOfGroupables, getNumberOfSeries, getObjSize, getOpacityScale, getPadding, getPieChartData, getPivotColumnIndexConfig, getPlainTextList, getPointObj, getPotentialDisplayTypes, getPrecisionForDayJS, getQueryFn, getQueryParams, getQueryRequestParams, getQueryValidationQueryText, getRadiusScale, getRangeForAxis, getRecentSearchesFromLocalStorage, getRecentSelectionID, getRowNumberListForPopover, getSVGBase64, getSampleQueryRegex, getSampleQueryText, getScheduleFrequencyObject, getStartAndEndDateFromDateStrs, getStringColumnIndices, getStringFromSource, getSuggestionLists, getSupportedConditionTypes, getSupportedDisplayTypes, getThemeType, getThemeValue, getTickSizeFromNumTicks, getTickValues, getTimeFrameTextFromChunk, getTimeObjFromTimeStamp, getTimeRangeFromDateArray, getTimeRangeFromRT, getTimeScale, getTitleCase, getTooltipContent, getTotalBottomPadding, getTotalHorizontalPadding, getTotalLeftPadding, getTotalPossibleLegendSections, getTotalRightPadding, getTotalTopPadding, getTotalVerticalPadding, getUniqueYearsForColumn, getUnitSymbol, getUnitsForColumn, getVisibleColumns, getWeekLocalStartDate, getWeekdayFromTimeStamp, getlegendLabelSections, handleTooltipBoundaryCollision, hasColumnIndex, hasData, hasDateColumn, hasMoreData, hasNumberColumn, hasStringColumn, initializeAlert, initializeQueryValidationOptions, invertArray, isAggSeed, isAggregation, isChartType, isColumnDateType, isColumnIndexConfigValid, isColumnIndexValid, isColumnIndicesValid, isColumnNumberType, isColumnStringType, isDataLimited, isDisplayTypeValid, isDrilldown, isError500Type, isExpressionQueryValid, isISODate, isInitialSelectionValid, isListQuery, isNumber, isObject, isSingleValueResponse, isTableType, color as legendColor, lineCommand, makeEmptyArray, markNotificationAsUnread, mergeBboxes, mergeBoundingClientRects, mergeSources, nameValueObject, numberIndicesArraysOverlap, numberSortFn, onTableCellClick, onlySeriesVisibilityChanged, onlyUnique, parseJwt, potentiallySupportsDatePivot, potentiallySupportsPivot, removeElementAtIndex, removeFromDOM, removeHiddenLegendLabels, removeNotificationChannel, removeUserFromProjectRule, reportProblem, resetDateIsFuture, resetNotificationCount, rotateArray, roundDownToNearestMultiple, roundToNearestLog10, roundToNearestMultiple, roundUpToNearestMultiple, runDrilldown, runQuery, runQueryNewPage, runQueryOnly, runQueryValidation, scaleZero, sendDataToChannel, sendSuggestion, sendTrainingData, setCaretPosition, setColumnVisibility, setFilterFunction, setFilters, setHeaderFilterPlaceholder, setRecentSearchesInLocalStorage, setSorterFunction, setTickSize, setTickValues, shouldDisableChartScale, shouldLabelsRotate, shouldPlotMultiSeries, showEvaluationFrequencySetting, sortDataByAlphabet, sortDataByColumn, sortDataByDate, supportsDatePivotTable, supportsPieChart, supportsRegularPivotTable, svgPathD, svgToPng, tableFilterParams, toggleCustomDataAlertStatus, toggleProjectDataAlertStatus, transformLabels, transformQueryResponse, transformQueryResponseColumns, unsetFilterFromAPI, updateDataAlert, updateDataAlertStatus, updateStartAndEndIndexes, usePivotDataForChart, uuidv4, validateExpression };
@@ -14345,6 +14345,7 @@
14345
14345
  icon,
14346
14346
  supportsStrings = false,
14347
14347
  symbol,
14348
+ sqlFn,
14348
14349
  fn = () => {
14349
14350
  }
14350
14351
  }) {
@@ -14356,6 +14357,7 @@
14356
14357
  this.symbol = symbol;
14357
14358
  this.fn = fn;
14358
14359
  this.icon = icon;
14360
+ this.sqlFn = sqlFn;
14359
14361
  }
14360
14362
  };
14361
14363
 
@@ -14450,7 +14452,7 @@
14450
14452
  ];
14451
14453
  var DEFAULT_DATA_PAGE_SIZE = 5e4;
14452
14454
  var MAX_DATA_PAGE_SIZE = 5e4;
14453
- var MAX_CHART_ELEMENTS = 300;
14455
+ var MAX_CHART_ELEMENTS = 500;
14454
14456
  var WEEKDAY_NAMES_MON = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
14455
14457
  var WEEKDAY_NAMES_SUN = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
14456
14458
  var DOW_STYLES = ["NUM_1_MON", "NUM_1_SUN", "NUM_0_MON", "NUM_0_SUN", "ALPHA_MON", "ALPHA_SUN"];
@@ -14472,28 +14474,32 @@
14472
14474
  tooltip: "<strong>Sum:</strong> Values that have the same chart axis label will be added up.",
14473
14475
  // symbol: String.fromCharCode(931),
14474
14476
  icon: "sum",
14475
- fn: sum
14477
+ fn: sum,
14478
+ sqlFn: (columnName) => `sum(${columnName})`
14476
14479
  }),
14477
14480
  AVG: new AggType({
14478
14481
  type: "AVG" /* AVG */,
14479
14482
  displayName: "Avg",
14480
14483
  tooltip: "<strong>Average:</strong> Values that have the same chart axis label will be averaged.",
14481
14484
  symbol: String.fromCharCode(956),
14482
- fn: mean
14485
+ fn: mean,
14486
+ sqlFn: (columnName) => `avg(${columnName})`
14483
14487
  }),
14484
14488
  MIN: new AggType({
14485
14489
  type: "MIN" /* MIN */,
14486
14490
  displayName: "Min",
14487
14491
  tooltip: "<strong>Minimum:</strong> The smallest value will be shown for all data points with same label.",
14488
14492
  icon: "minimum",
14489
- fn: min
14493
+ fn: min,
14494
+ sqlFn: (columnName) => `min(${columnName})`
14490
14495
  }),
14491
14496
  MAX: new AggType({
14492
14497
  type: "MAX" /* MAX */,
14493
14498
  displayName: "Max",
14494
14499
  tooltip: "<strong>Maximum:</strong> The largest value will be shown for all data points with same label.",
14495
14500
  icon: "maximum",
14496
- fn: max
14501
+ fn: max,
14502
+ sqlFn: (columnName) => `max(${columnName})`
14497
14503
  }),
14498
14504
  COUNT: new AggType({
14499
14505
  type: "COUNT" /* COUNT */,
@@ -14505,7 +14511,8 @@
14505
14511
  fn: (arr) => {
14506
14512
  var _a, _b;
14507
14513
  return (_b = (_a = arr == null ? void 0 : arr.filter((value) => !!value)) == null ? void 0 : _a.length) != null ? _b : 0;
14508
- }
14514
+ },
14515
+ sqlFn: (columnName) => `count(${columnName})`
14509
14516
  }),
14510
14517
  COUNT_DISTINCT: new AggType({
14511
14518
  type: "COUNT_DISTINCT" /* COUNT_DISTINCT */,
@@ -14517,7 +14524,8 @@
14517
14524
  fn: (arr) => {
14518
14525
  var _a, _b, _c;
14519
14526
  return (_c = (_b = (_a = arr == null ? void 0 : arr.filter((value) => !!value || value == 0)) == null ? void 0 : _a.filter(onlyUnique)) == null ? void 0 : _b.length) != null ? _c : 0;
14520
- }
14527
+ },
14528
+ sqlFn: (columnName) => `count(distinct ${columnName})`
14521
14529
  }),
14522
14530
  MEDIAN: new AggType({
14523
14531
  type: "MEDIAN" /* MEDIAN */,
@@ -14533,7 +14541,8 @@
14533
14541
  unit: "none",
14534
14542
  tooltip: "The standard deviation will be shown for all data points with the same label.",
14535
14543
  symbol: "\u03C3",
14536
- fn: deviation
14544
+ fn: deviation,
14545
+ sqlFn: (columnName) => `stddev(${columnName})`
14537
14546
  }),
14538
14547
  VARIANCE: new AggType({
14539
14548
  type: "VARIANCE" /* VARIANCE */,
@@ -14802,9 +14811,6 @@
14802
14811
  return ["table"];
14803
14812
  }
14804
14813
  const { amountOfNumberColumns, amountOfStringColumns } = getColumnTypeAmounts(visibleColumns);
14805
- if (amountOfNumberColumns === 0) {
14806
- return ["table"];
14807
- }
14808
14814
  const supportedDisplayTypes = ["table"];
14809
14815
  const numRows = dataLength != null ? dataLength : rows.length;
14810
14816
  let pivotDataHasLength = true;
@@ -16245,6 +16251,7 @@
16245
16251
  let quantityColumnIndices = [];
16246
16252
  let currencyColumnIndices = [];
16247
16253
  let ratioColumnIndices = [];
16254
+ let countColumnIndices = [];
16248
16255
  columns.forEach((col, index) => {
16249
16256
  const { type } = col;
16250
16257
  if (col.is_visible && !col.pivot && !col.groupable) {
@@ -16254,6 +16261,8 @@
16254
16261
  quantityColumnIndices.push(index);
16255
16262
  } else if (type === "PERCENT" || type === "RATIO") {
16256
16263
  ratioColumnIndices.push(index);
16264
+ } else {
16265
+ countColumnIndices.push(index);
16257
16266
  }
16258
16267
  }
16259
16268
  });
@@ -16274,6 +16283,10 @@
16274
16283
  numberColumnIndex = ratioColumnIndices[0];
16275
16284
  numberColumnIndices = ratioColumnIndices;
16276
16285
  numberColumnIndexType = "ratio";
16286
+ } else if (countColumnIndices.length) {
16287
+ numberColumnIndex = countColumnIndices[0];
16288
+ numberColumnIndices = countColumnIndices;
16289
+ numberColumnIndexType = "count";
16277
16290
  }
16278
16291
  if (!isPivot) {
16279
16292
  numberColumnIndices = numberColumnIndex >= 0 ? [numberColumnIndex] : [];
@@ -16291,8 +16304,10 @@
16291
16304
  } else if (quantityColumnIndices.length > 1) {
16292
16305
  numberColumnIndex2 = quantityColumnIndices[1];
16293
16306
  }
16294
- } else if (numberColumnIndexType === "ratio" && quantityColumnIndices.length > 1) {
16307
+ } else if (numberColumnIndexType === "ratio" && ratioColumnIndices.length > 1) {
16295
16308
  numberColumnIndex2 = ratioColumnIndices[1];
16309
+ } else if (numberColumnIndexType === "count" && countColumnIndices.length > 1) {
16310
+ numberColumnIndex2 = countColumnIndices[1];
16296
16311
  }
16297
16312
  if (!isNaN(numberColumnIndex2)) {
16298
16313
  numberColumnIndices2 = numberColumnIndex2 >= 0 ? [numberColumnIndex2] : [];
@@ -16304,6 +16319,8 @@
16304
16319
  quantityColumnIndices = [];
16305
16320
  if (!ratioColumnIndices)
16306
16321
  ratioColumnIndices = [];
16322
+ if (!countColumnIndices)
16323
+ countColumnIndices = [];
16307
16324
  return {
16308
16325
  numberColumnIndex,
16309
16326
  numberColumnIndices,
@@ -16315,7 +16332,13 @@
16315
16332
  currencyColumnIndex: currencyColumnIndices[0],
16316
16333
  quantityColumnIndex: quantityColumnIndices[0],
16317
16334
  ratioColumnIndex: ratioColumnIndices[0],
16318
- allNumberColumnIndices: [...currencyColumnIndices, ...quantityColumnIndices, ...ratioColumnIndices]
16335
+ countColumnIndex: countColumnIndices[0],
16336
+ allNumberColumnIndices: [
16337
+ ...currencyColumnIndices,
16338
+ ...quantityColumnIndices,
16339
+ ...ratioColumnIndices,
16340
+ ...countColumnIndices
16341
+ ]
16319
16342
  };
16320
16343
  };
16321
16344
  var getMultiSeriesColumnIndex = (columns) => {
@@ -18954,7 +18977,6 @@
18954
18977
  dataFormatting,
18955
18978
  columnIndexConfig,
18956
18979
  maxElements,
18957
- truncateAt = MAX_CHART_ELEMENTS,
18958
18980
  useBuckets = true
18959
18981
  }) => {
18960
18982
  const aggColumn = aggColIndex != null ? aggColIndex : columnIndexConfig == null ? void 0 : columnIndexConfig.stringColumnIndex;
@@ -18993,9 +19015,6 @@
18993
19015
  if (maxElements && aggregatedData.length > maxElements) {
18994
19016
  return aggregateOtherCategory(aggregatedData, columnIndexConfig, maxElements);
18995
19017
  }
18996
- if (truncateAt && aggregatedData.length > truncateAt) {
18997
- aggregatedData.splice(truncateAt);
18998
- }
18999
19018
  if (useBuckets) {
19000
19019
  }
19001
19020
  return aggregatedData;
@@ -19598,6 +19617,18 @@
19598
19617
  return queryValidationQueryText;
19599
19618
  };
19600
19619
 
19620
+ // src/HelperFns/queryHelpers.ts
19621
+ var formatAdditionalSelectColumn = (column, sqlFn) => {
19622
+ let columnName = column.table_column;
19623
+ if (sqlFn) {
19624
+ columnName = sqlFn(columnName);
19625
+ }
19626
+ return {
19627
+ insertion: "OPTIONAL",
19628
+ columns: [columnName]
19629
+ };
19630
+ };
19631
+
19601
19632
  // src/Charts/chartHelpers.ts
19602
19633
  var import_lodash7 = __toESM(require_lodash2());
19603
19634
  var import_lodash8 = __toESM(require_lodash());
@@ -27568,11 +27599,11 @@
27568
27599
  }
27569
27600
  };
27570
27601
  };
27571
- var transformQueryResponse = (response, originalQueryID, isDrilldown2 = false) => {
27602
+ var transformQueryResponse = (response, originalQueryID, isDrilldown2 = false, newColumns) => {
27572
27603
  var _a, _b;
27573
27604
  const transformedResponse = (0, import_lodash9.default)(response);
27574
27605
  if ((_b = (_a = transformedResponse == null ? void 0 : transformedResponse.data) == null ? void 0 : _a.data) == null ? void 0 : _b.columns) {
27575
- const transformedColumns = transformQueryResponseColumns(transformedResponse);
27606
+ const transformedColumns = transformQueryResponseColumns(transformedResponse, newColumns);
27576
27607
  if (transformedColumns) {
27577
27608
  transformedResponse.data.data.columns = transformedColumns;
27578
27609
  }
@@ -27586,7 +27617,7 @@
27586
27617
  }
27587
27618
  return transformedResponse;
27588
27619
  };
27589
- var transformQueryResponseColumns = (response) => {
27620
+ var transformQueryResponseColumns = (response, addedColumns) => {
27590
27621
  var _a, _b;
27591
27622
  const columns = (_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.columns;
27592
27623
  if (!(columns == null ? void 0 : columns.length)) {
@@ -27594,11 +27625,16 @@
27594
27625
  }
27595
27626
  const transformedColumns = columns.map((col, i) => {
27596
27627
  const drilldownGroupby = getDrilldownGroupby(response, col);
27628
+ let additional = false;
27629
+ if (addedColumns == null ? void 0 : addedColumns.find((select) => select.columns.includes(col.alt_name || col.name))) {
27630
+ additional = true;
27631
+ }
27597
27632
  return new Column({
27598
27633
  ...col,
27599
27634
  field: `${i}`,
27600
27635
  index: i,
27601
- drilldownGroupby
27636
+ drilldownGroupby,
27637
+ additional
27602
27638
  });
27603
27639
  });
27604
27640
  return transformedColumns;
@@ -27748,7 +27784,8 @@
27748
27784
  pageSize = DEFAULT_DATA_PAGE_SIZE,
27749
27785
  allowSuggestions = true,
27750
27786
  cancelToken,
27751
- scope = "null"
27787
+ scope = "null",
27788
+ newColumns
27752
27789
  } = {}) => {
27753
27790
  const url2 = `${domain}/autoql/api/v1/query?key=${apiKey}`;
27754
27791
  const finalUserSelection = userSelectionFinal || transformUserSelection(userSelection);
@@ -27767,7 +27804,8 @@
27767
27804
  filters: tableFilters,
27768
27805
  page_size: pageSize,
27769
27806
  date_format: "ISO8601",
27770
- scope: finalScope
27807
+ scope: finalScope,
27808
+ additional_selects: newColumns
27771
27809
  };
27772
27810
  if (!query || !query.trim()) {
27773
27811
  console.error("No query supplied in request");
@@ -27788,7 +27826,7 @@
27788
27826
  if (!((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data)) {
27789
27827
  throw new Error("Parse error" /* PARSE_ERROR */);
27790
27828
  }
27791
- return Promise.resolve(transformQueryResponse(response));
27829
+ return Promise.resolve(transformQueryResponse(response, void 0, void 0, newColumns));
27792
27830
  }).catch((error) => {
27793
27831
  var _a, _b, _c, _d, _e;
27794
27832
  const referenceId = (_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.reference_id;