autoql-fe-utils 1.0.0 → 1.0.2

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
@@ -28,6 +28,176 @@ declare const AGG_TYPES: {
28
28
  declare const MAX_LEGEND_LABELS = 22;
29
29
  declare const MIN_HISTOGRAM_SAMPLE = 20;
30
30
 
31
+ declare const CUSTOM_TYPE = "CUSTOM";
32
+ declare const PROJECT_TYPE = "PROJECT";
33
+ declare const PERIODIC_TYPE = "PERIODIC";
34
+ declare const CONTINUOUS_TYPE = "CONTINUOUS";
35
+ declare const SCHEDULED_TYPE = "SCHEDULED";
36
+ declare const COMPARE_TYPE = "COMPARE";
37
+ declare const EXISTS_TYPE = "EXISTS";
38
+ declare const NUMBER_TERM_TYPE = "CONSTANT";
39
+ declare const QUERY_TERM_TYPE = "QUERY";
40
+ declare const GROUP_TERM_TYPE = "GROUP";
41
+ declare const DEFAULT_EVALUATION_FREQUENCY = 5;
42
+ declare const DATA_ALERT_STATUSES: {
43
+ ACTIVE: string;
44
+ RETRY: string;
45
+ WAITING: string;
46
+ INACTIVE: string;
47
+ EVALUATION_ERROR: string;
48
+ DATA_RETURN_ERROR: string;
49
+ GENERAL_ERROR: string;
50
+ };
51
+ declare const DATA_ALERT_ENABLED_STATUSES: string[];
52
+ declare const DATA_ALERT_OPERATORS: {
53
+ GREATER_THAN: {
54
+ displayName: string;
55
+ symbol: string;
56
+ conditionText: string;
57
+ conditionTextPast: string;
58
+ };
59
+ GREATER_THAN_EQUAL_TO: {
60
+ displayName: string;
61
+ symbol: string;
62
+ conditionText: string;
63
+ conditionTextPast: string;
64
+ };
65
+ LESS_THAN: {
66
+ displayName: string;
67
+ symbol: string;
68
+ conditionText: string;
69
+ conditionTextPast: string;
70
+ };
71
+ LESS_THAN_EQUAL_TO: {
72
+ displayName: string;
73
+ symbol: string;
74
+ conditionText: string;
75
+ conditionTextPast: string;
76
+ };
77
+ EQUAL_TO: {
78
+ displayName: string;
79
+ symbol: string;
80
+ conditionText: string;
81
+ conditionTextPast: string;
82
+ };
83
+ };
84
+ declare const DATA_ALERT_CONDITION_TYPES: {
85
+ COMPARE: {
86
+ displayName: string;
87
+ };
88
+ EXISTS: {
89
+ displayName: string;
90
+ };
91
+ };
92
+ declare const DATA_ALERT_FREQUENCY_TYPE_OPTIONS: {
93
+ SCHEDULED: {
94
+ label: string;
95
+ listLabel: string;
96
+ };
97
+ CONTINUOUS: {
98
+ label: string;
99
+ listLabel: string;
100
+ };
101
+ };
102
+ declare const SCHEDULE_INTERVAL_OPTIONS: {
103
+ DAY: {
104
+ displayName: string;
105
+ getLocalStartDate: ({ timeObj, timezone, daysToAdd }: {
106
+ timeObj: any;
107
+ timezone: any;
108
+ daysToAdd?: number;
109
+ }) => string;
110
+ };
111
+ WEEK: {
112
+ displayName: string;
113
+ getLocalStartDate: ({ weekDay, timeObj, timezone }: {
114
+ weekDay: any;
115
+ timeObj: any;
116
+ timezone: any;
117
+ }) => string;
118
+ };
119
+ MONTH: {
120
+ displayName: string;
121
+ getLocalStartDate: ({ monthDay, timeObj, timezone }: {
122
+ monthDay: any;
123
+ timeObj: any;
124
+ timezone: any;
125
+ }) => string;
126
+ };
127
+ };
128
+ declare const SCHEDULE_FREQUENCY_OPTIONS: {
129
+ DAY: {
130
+ displayText: string;
131
+ };
132
+ WEEK: {
133
+ displayText: string;
134
+ };
135
+ MONTH: {
136
+ displayText: string;
137
+ };
138
+ MONTH_LAST_DAY: {
139
+ displayText: string;
140
+ };
141
+ YEAR: {
142
+ displayText: string;
143
+ };
144
+ };
145
+ declare const RESET_PERIOD_OPTIONS: {
146
+ DAY: {
147
+ displayName: string;
148
+ displayText: string;
149
+ };
150
+ WEEK: {
151
+ displayName: string;
152
+ displayText: string;
153
+ };
154
+ MONTH: {
155
+ displayName: string;
156
+ displayText: string;
157
+ };
158
+ NONE: {
159
+ displayName: string;
160
+ displayText: string;
161
+ };
162
+ };
163
+ declare const MONTH_DAY_SELECT_OPTIONS: {
164
+ FIRST: string;
165
+ LAST: string;
166
+ };
167
+ declare const EVALUATION_FREQUENCY_OPTIONS: {
168
+ 1: {
169
+ value: number;
170
+ label: string;
171
+ };
172
+ 2: {
173
+ value: number;
174
+ label: string;
175
+ };
176
+ 3: {
177
+ value: number;
178
+ label: string;
179
+ };
180
+ 5: {
181
+ value: number;
182
+ label: string;
183
+ listLabel: string;
184
+ };
185
+ 10: {
186
+ value: number;
187
+ label: string;
188
+ };
189
+ 30: {
190
+ value: number;
191
+ label: string;
192
+ };
193
+ 60: {
194
+ value: number;
195
+ label: string;
196
+ };
197
+ };
198
+
199
+ declare const DEFAULT_SOURCE = "widgets";
200
+
31
201
  declare enum TimestampFormats {
32
202
  epoch = "EPOCH",
33
203
  iso8601 = "ISO8601"
@@ -55,6 +225,10 @@ declare enum NumberColumnTypeDisplayNames {
55
225
  RATIO = "Ratio",
56
226
  PERCENT = "Percent"
57
227
  }
228
+ declare enum DataExplorerTypes {
229
+ SUBJECT_TYPE = "subject",
230
+ VL_TYPE = "VL"
231
+ }
58
232
 
59
233
  interface Column {
60
234
  dow_style: string;
@@ -352,4 +526,216 @@ declare const rotateArray: (array: any, n: any) => any[];
352
526
  declare const onlyUnique: (value: any, index: any, self: any) => boolean;
353
527
  declare const makeEmptyArray: (w: any, h: any, value?: string) => any[];
354
528
 
355
- export { AGG_TYPES, AxiosResponse, CHART_TYPES, Column, Columns, DATE_ONLY_CHART_TYPES, DAYJS_PRECISION_FORMATS, DEFAULT_AGG_TYPE, DEFAULT_DATA_PAGE_SIZE, DOUBLE_AXIS_CHART_TYPES, DOW_STYLES, DataFormatting, FilterLock, FrontendReq, MAX_DATA_PAGE_SIZE, MAX_LEGEND_LABELS, MIN_HISTOGRAM_SAMPLE, MONTH_NAMES, NumberColumnTypeDisplayNames, NumberColumnTypes, PrecisionTypes, QueryData, QueryResponse, Rows, SEASON_NAMES, Scale, TABLE_TYPES, TimestampFormats, WEEKDAY_NAMES_MON, WEEKDAY_NAMES_SUN, animateInputText, authenticationDefault, autoQLConfigDefault, capitalizeFirstChar, currentEventLoopEnd, dataConfigDefault, dataFormattingDefault, dateSortFn, dateStringSortFn, deepEqual, difference, formatChartLabel, formatDateStringType, formatDateType, formatElement, formatEpochDate, formatISODateWithPrecision, formatStringDate, formatStringDateWithPrecision, functionsEqual, getAuthentication, getAutoQLConfig, getBBoxFromRef, getColumnTypeAmounts, getCurrencySymbol, getDataConfig, getDataFormatting, getDateColumnIndex, getDayJSObj, getDayjsObjForStringType, getDefaultDisplayType, getEpochFromDate, getFirstChartDisplayType, getGroupBys, getGroupBysFromPivotTable, getGroupBysFromTable, getGroupableColumns, getKeyByValue, getNumberFormatConfig, getNumberOfGroupables, getPadding, getQueryParams, getSVGBase64, getStringFromSource, getSupportedDisplayTypes, getVisibleColumns, handleTooltipBoundaryCollision, hasData, hasDateColumn, hasNumberColumn, hasStringColumn, invertArray, isAggregation, isChartType, isColumnDateType, isColumnNumberType, isColumnStringType, isDisplayTypeValid, isListQuery, isNumber, isObject, isSingleValueResponse, isTableType, makeEmptyArray, mergeSources, nameValueObject, onlyUnique, removeFromDOM, rotateArray, setCaretPosition, shouldPlotMultiSeries, sortDataByDate, supports2DCharts, supportsDatePivotTable, supportsPieChart, supportsRegularPivotTable, svgToPng };
529
+ declare const dataStructureChanged: (props: any, prevProps: any) => boolean;
530
+ declare const onlySeriesVisibilityChanged: (props: any, prevProps: any) => boolean;
531
+ declare const scaleZero: (scale: any) => any;
532
+ declare const getKey: (rowIndex: any, cellIndex: any, extraIndex?: number) => string;
533
+ declare const shouldLabelsRotate: (axisElement: any) => boolean;
534
+ declare const getTooltipContent: ({ row, columns, colIndex, colIndex2, legendColumn, dataFormatting, aggregated, }: {
535
+ row: any;
536
+ columns: any;
537
+ colIndex: any;
538
+ colIndex2: any;
539
+ legendColumn: any;
540
+ dataFormatting: any;
541
+ aggregated?: boolean;
542
+ }) => any;
543
+ declare const getLegendLabelsForMultiSeries: (columns: any, colorScale: any, numberColumnIndices?: any[]) => {
544
+ label: any;
545
+ color: any;
546
+ hidden: any;
547
+ columnIndex: any;
548
+ column: any;
549
+ }[];
550
+ declare const getNumberOfSeries: (data: any) => any;
551
+ declare const convertToNumber: (value: any) => number;
552
+ declare const calculateMinAndMaxSums: (data: any, stringColumnIndex: any, numberColumnIndices: any, isScaled: any) => {
553
+ maxValue: number;
554
+ minValue: number;
555
+ };
556
+ declare const getObjSize: (obj: any) => number;
557
+ declare const getMaxValueFromKeyValueObj: (obj: any) => number;
558
+ declare const getMinValueFromKeyValueObj: (obj: any) => number;
559
+ declare const getMinAndMaxValues: (data: any, numberColumnIndices: any, isScaled: any, sum: any, stringColumnIndex: any) => {
560
+ minValue: number;
561
+ maxValue: number;
562
+ };
563
+ declare const getLegendLocation: (seriesArray: any, displayType: any, preferredLocation?: string) => string;
564
+ declare const getRangeForAxis: ({ axis, height, width }: {
565
+ axis: any;
566
+ height: any;
567
+ width: any;
568
+ }) => any[];
569
+ declare const getTimeScale: ({ data, columns, columnIndex, axis, domain, dataFormatting, outerPadding, innerPadding, height, width, stringColumnIndices, changeColumnIndices, enableAxisDropdown, changeStringColumnIndex, }: {
570
+ data: Rows;
571
+ columns: Columns;
572
+ columnIndex: number;
573
+ axis: string;
574
+ domain: number[];
575
+ dataFormatting: DataFormatting;
576
+ outerPadding: number;
577
+ innerPadding: number;
578
+ height: number;
579
+ width: number;
580
+ stringColumnIndices: number[];
581
+ changeColumnIndices: number[];
582
+ enableAxisDropdown: boolean;
583
+ changeStringColumnIndex: Function;
584
+ }) => any;
585
+ declare const getBandScale: ({ data, columns, columnIndex, axis, domain, dataFormatting, outerPadding, innerPadding, height, width, stringColumnIndices, changeColumnIndices, enableAxisDropdown, changeStringColumnIndex, }: {
586
+ data: Rows;
587
+ columns: Columns;
588
+ columnIndex: number;
589
+ axis: string;
590
+ domain: number[];
591
+ dataFormatting: DataFormatting;
592
+ outerPadding: number;
593
+ innerPadding: number;
594
+ height: number;
595
+ width: number;
596
+ stringColumnIndices: number[];
597
+ changeColumnIndices: number[];
598
+ enableAxisDropdown: boolean;
599
+ changeStringColumnIndex: Function;
600
+ }) => any;
601
+ declare const getUnitsForColumn: (column: Column, useAgg?: boolean) => "none" | "currency" | "percent";
602
+ declare const getUnitSymbol: ({ column, dataFormatting, }: {
603
+ column: Column;
604
+ dataFormatting: DataFormatting;
605
+ }) => string;
606
+ declare const getLinearAxisTitle: ({ numberColumns, aggregated, }: {
607
+ numberColumns: Columns;
608
+ aggregated: boolean;
609
+ }) => string;
610
+ declare const getNumberAxisUnits: (numberColumns: any) => any;
611
+ declare const getBinLinearScale: ({ columns, columnIndex, axis, buckets, bins, changeColumnIndices, enableAxisDropdown, innerHeight, innerWidth, height, width, dataFormatting, changeNumberColumnIndices, }: {
612
+ columns: Columns;
613
+ columnIndex: number;
614
+ axis: string;
615
+ buckets: any[];
616
+ bins: (string | number)[];
617
+ changeColumnIndices: Function;
618
+ enableAxisDropdown: boolean;
619
+ innerHeight: number;
620
+ innerWidth: number;
621
+ height: number;
622
+ width: number;
623
+ dataFormatting: DataFormatting;
624
+ changeNumberColumnIndices: Function;
625
+ }) => any;
626
+ declare const getHistogramScale: ({ axis, buckets, columnIndex, height, width, minValue, maxValue, tickValues, numTicks, stacked, isScaled, columns, columnIndices, changeColumnIndices, dataFormatting, changeNumberColumnIndices, enableAxisDropdown, aggregated, }: {
627
+ buckets: any[];
628
+ minValue: number;
629
+ maxValue: number;
630
+ axis: string;
631
+ range: number[];
632
+ domain: number[];
633
+ tickValues: number[];
634
+ numTicks: number;
635
+ stacked: boolean;
636
+ isScaled: boolean;
637
+ columns: Columns;
638
+ units: string;
639
+ title: string;
640
+ columnIndex: number;
641
+ columnIndices: number[];
642
+ hasDropdown: boolean;
643
+ allowMultipleSeries: boolean;
644
+ changeColumnIndices: Function;
645
+ disableAutoScale: boolean;
646
+ dataFormatting: DataFormatting;
647
+ changeNumberColumnIndices: Function;
648
+ enableAxisDropdown: boolean;
649
+ height: number;
650
+ width: number;
651
+ aggregated: boolean;
652
+ }) => any;
653
+ declare const getLinearScale: ({ minValue, maxValue, axis, range, domain, tickValues, numTicks, stacked, isScaled, columns, units, title, columnIndex, columnIndices, hasDropdown, allowMultipleSeries, changeColumnIndices, disableAutoScale, dataFormatting, changeNumberColumnIndices, enableAxisDropdown, height, width, aggregated, }: {
654
+ axis: string;
655
+ columns: Columns;
656
+ columnIndex: number;
657
+ columnIndices: number[];
658
+ height: number;
659
+ width: number;
660
+ units?: string;
661
+ dataFormatting?: DataFormatting;
662
+ changeNumberColumnIndices?: Function;
663
+ enableAxisDropdown?: boolean;
664
+ stacked?: boolean;
665
+ isScaled?: boolean;
666
+ minValue?: number;
667
+ maxValue?: number;
668
+ aggregated?: boolean;
669
+ changeColumnIndices?: Function;
670
+ numTicks?: number;
671
+ range?: number[];
672
+ tickValues?: number[];
673
+ allowMultipleSeries?: boolean;
674
+ disableAutoScale?: boolean;
675
+ hasDropdown?: boolean;
676
+ domain?: number[];
677
+ title?: string;
678
+ }) => any;
679
+ declare const getLinearScales: ({ data, columnIndices1, columnIndices2, axis, stacked, isScaled, columns, hasDropdown, allowMultipleSeries, changeColumnIndices, disableAutoScale, dataFormatting, changeNumberColumnIndices, enableAxisDropdown, stringColumnIndex, height, width, aggregated, }: {
680
+ data: Rows;
681
+ columnIndices1: number[];
682
+ columnIndices2: number[];
683
+ axis: string;
684
+ stacked: boolean;
685
+ isScaled: boolean;
686
+ columns: Columns;
687
+ hasDropdown: boolean;
688
+ allowMultipleSeries: boolean;
689
+ changeColumnIndices: Function;
690
+ disableAutoScale: boolean;
691
+ dataFormatting: DataFormatting;
692
+ changeNumberColumnIndices: Function;
693
+ enableAxisDropdown: boolean;
694
+ stringColumnIndex: number;
695
+ height: number;
696
+ width: number;
697
+ aggregated: boolean;
698
+ }) => {
699
+ scale: any;
700
+ scale2?: undefined;
701
+ } | {
702
+ scale: any;
703
+ scale2: any;
704
+ };
705
+ declare const doesElementOverflowContainer: (element: any, container: any) => boolean;
706
+ declare const DateUTC: (d: any) => Date;
707
+ declare const getNiceDateTickValues: ({ tickValues, scale }: {
708
+ tickValues: any;
709
+ scale: any;
710
+ }) => any;
711
+ declare const getNiceTickValues: ({ tickValues, scale }: {
712
+ tickValues: any;
713
+ scale: any;
714
+ }) => any;
715
+ declare const getTickSizeFromNumTicks: ({ scale, numTicks, innerPadding, outerPadding, }: {
716
+ scale: any;
717
+ numTicks: any;
718
+ innerPadding?: number;
719
+ outerPadding?: number;
720
+ }) => number;
721
+ declare const getTickValues: ({ scale, initialTicks, numTicks, innerPadding, outerPadding, }: {
722
+ scale: any;
723
+ initialTicks?: (string | number)[];
724
+ numTicks?: number;
725
+ innerPadding?: number;
726
+ outerPadding?: number;
727
+ }) => any;
728
+ declare const mergeBboxes: (boundingBoxes: any) => {
729
+ x: any;
730
+ y: any;
731
+ height: number;
732
+ width: number;
733
+ };
734
+
735
+ declare const GENERAL_ERROR = "Uh oh, Our system is experiencing an unexpected error. We're aware of this issue and are working to fix it as soon as possible.";
736
+ declare const GENERAL_QUERY_ERROR = "Internal Service Error: Our system is experiencing an unexpected error. We're aware of this issue and are working to fix it as soon as possible.";
737
+ declare const GENERAL_HTML_ERROR = "Internal Service Error: Our system is experiencing an unexpected error. We're aware of this issue and are working to fix it as soon as possible.";
738
+ declare const UNAUTHENTICATED_ERROR = "Uh oh.. It looks like you don't have access to this resource. Please double check that all required authentication fields are correct.";
739
+ declare const REQUEST_CANCELLED_ERROR = "Request cancelled";
740
+
741
+ export { AGG_TYPES, AxiosResponse, CHART_TYPES, COMPARE_TYPE, CONTINUOUS_TYPE, CUSTOM_TYPE, Column, Columns, 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_DATA_PAGE_SIZE, DEFAULT_EVALUATION_FREQUENCY, DEFAULT_SOURCE, DOUBLE_AXIS_CHART_TYPES, DOW_STYLES, DataExplorerTypes, DataFormatting, DateUTC, EVALUATION_FREQUENCY_OPTIONS, EXISTS_TYPE, FilterLock, FrontendReq, GENERAL_ERROR, GENERAL_HTML_ERROR, GENERAL_QUERY_ERROR, GROUP_TERM_TYPE, MAX_DATA_PAGE_SIZE, MAX_LEGEND_LABELS, MIN_HISTOGRAM_SAMPLE, MONTH_DAY_SELECT_OPTIONS, MONTH_NAMES, NUMBER_TERM_TYPE, NumberColumnTypeDisplayNames, NumberColumnTypes, PERIODIC_TYPE, PROJECT_TYPE, PrecisionTypes, QUERY_TERM_TYPE, QueryData, QueryResponse, REQUEST_CANCELLED_ERROR, RESET_PERIOD_OPTIONS, Rows, SCHEDULED_TYPE, SCHEDULE_FREQUENCY_OPTIONS, SCHEDULE_INTERVAL_OPTIONS, SEASON_NAMES, Scale, TABLE_TYPES, TimestampFormats, UNAUTHENTICATED_ERROR, WEEKDAY_NAMES_MON, WEEKDAY_NAMES_SUN, animateInputText, authenticationDefault, autoQLConfigDefault, calculateMinAndMaxSums, capitalizeFirstChar, convertToNumber, currentEventLoopEnd, dataConfigDefault, dataFormattingDefault, dataStructureChanged, dateSortFn, dateStringSortFn, deepEqual, difference, doesElementOverflowContainer, formatChartLabel, formatDateStringType, formatDateType, formatElement, formatEpochDate, formatISODateWithPrecision, formatStringDate, formatStringDateWithPrecision, functionsEqual, getAuthentication, getAutoQLConfig, getBBoxFromRef, getBandScale, getBinLinearScale, getColumnTypeAmounts, getCurrencySymbol, getDataConfig, getDataFormatting, getDateColumnIndex, getDayJSObj, getDayjsObjForStringType, getDefaultDisplayType, getEpochFromDate, getFirstChartDisplayType, getGroupBys, getGroupBysFromPivotTable, getGroupBysFromTable, getGroupableColumns, getHistogramScale, getKey, getKeyByValue, getLegendLabelsForMultiSeries, getLegendLocation, getLinearAxisTitle, getLinearScale, getLinearScales, getMaxValueFromKeyValueObj, getMinAndMaxValues, getMinValueFromKeyValueObj, getNiceDateTickValues, getNiceTickValues, getNumberAxisUnits, getNumberFormatConfig, getNumberOfGroupables, getNumberOfSeries, getObjSize, getPadding, getQueryParams, getRangeForAxis, getSVGBase64, getStringFromSource, getSupportedDisplayTypes, getTickSizeFromNumTicks, getTickValues, getTimeScale, getTooltipContent, getUnitSymbol, getUnitsForColumn, getVisibleColumns, handleTooltipBoundaryCollision, hasData, hasDateColumn, hasNumberColumn, hasStringColumn, invertArray, isAggregation, isChartType, isColumnDateType, isColumnNumberType, isColumnStringType, isDisplayTypeValid, isListQuery, isNumber, isObject, isSingleValueResponse, isTableType, makeEmptyArray, mergeBboxes, mergeSources, nameValueObject, onlySeriesVisibilityChanged, onlyUnique, removeFromDOM, rotateArray, scaleZero, setCaretPosition, shouldLabelsRotate, shouldPlotMultiSeries, sortDataByDate, supports2DCharts, supportsDatePivotTable, supportsPieChart, supportsRegularPivotTable, svgToPng };