autoql-fe-utils 1.0.57 → 1.0.59
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 +3 -1
- package/dist/index.global.js +104 -35
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +108 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -870,7 +870,9 @@ declare const formatDateStringType: (element: any, column: Column, config?: Data
|
|
|
870
870
|
declare const formatISODateWithPrecision: (value: any, col: Column, config?: DataFormatting) => any;
|
|
871
871
|
declare const formatEpochDate: (value: any, col: Column, config?: DataFormatting) => any;
|
|
872
872
|
declare const dateStringSortFn: (a: any, b: any, col: Column) => number;
|
|
873
|
+
declare const numberSortFn: (a: any, b: any) => number;
|
|
873
874
|
declare const dateSortFn: (a: any, b: any, col: Column, isTable: any) => number;
|
|
875
|
+
declare const sortDataByColumn: (data: any, columns: any, columnIndex: any, sortDirection?: string) => any;
|
|
874
876
|
declare const sortDataByDate: (data: any, tableColumns: any, sortDirection: string, isTable: any) => any;
|
|
875
877
|
interface formatElementParams {
|
|
876
878
|
element: string | number;
|
|
@@ -2252,4 +2254,4 @@ declare function color(): {
|
|
|
2252
2254
|
on(): any;
|
|
2253
2255
|
};
|
|
2254
2256
|
|
|
2255
|
-
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, 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, sortDataByDate, supportsDatePivotTable, supportsPieChart, supportsRegularPivotTable, svgPathD, svgToPng, tableFilterParams, toggleCustomDataAlertStatus, toggleProjectDataAlertStatus, transformLabels, transformQueryResponse, transformQueryResponseColumns, unsetFilterFromAPI, updateDataAlert, updateDataAlertStatus, updateStartAndEndIndexes, usePivotDataForChart, uuidv4, validateExpression };
|
|
2257
|
+
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, sortDataByColumn, sortDataByDate, supportsDatePivotTable, supportsPieChart, supportsRegularPivotTable, svgPathD, svgToPng, tableFilterParams, toggleCustomDataAlertStatus, toggleProjectDataAlertStatus, transformLabels, transformQueryResponse, transformQueryResponseColumns, unsetFilterFromAPI, updateDataAlert, updateDataAlertStatus, updateStartAndEndIndexes, usePivotDataForChart, uuidv4, validateExpression };
|
package/dist/index.global.js
CHANGED
|
@@ -16075,7 +16075,7 @@
|
|
|
16075
16075
|
let ratioColumnIndices = [];
|
|
16076
16076
|
columns.forEach((col, index) => {
|
|
16077
16077
|
const { type } = col;
|
|
16078
|
-
if (col.is_visible && !col.pivot &&
|
|
16078
|
+
if (col.is_visible && !col.pivot && !col.groupable) {
|
|
16079
16079
|
if (type === "DOLLAR_AMT") {
|
|
16080
16080
|
currencyColumnIndices.push(index);
|
|
16081
16081
|
} else if (type === "QUANTITY") {
|
|
@@ -16723,6 +16723,32 @@
|
|
|
16723
16723
|
}
|
|
16724
16724
|
}
|
|
16725
16725
|
};
|
|
16726
|
+
var numberSortFn = (a, b) => {
|
|
16727
|
+
try {
|
|
16728
|
+
if (!a && !b) {
|
|
16729
|
+
return 0;
|
|
16730
|
+
} else if (!a && b) {
|
|
16731
|
+
return 1;
|
|
16732
|
+
} else if (a && !b) {
|
|
16733
|
+
return -1;
|
|
16734
|
+
}
|
|
16735
|
+
let aNumber = a;
|
|
16736
|
+
let bNumber = b;
|
|
16737
|
+
if (typeof a === "string") {
|
|
16738
|
+
aNumber = parseFloat(a);
|
|
16739
|
+
}
|
|
16740
|
+
if (typeof b === "string") {
|
|
16741
|
+
bNumber = parseFloat(b);
|
|
16742
|
+
}
|
|
16743
|
+
if (isNaN(aNumber) || isNaN(bNumber)) {
|
|
16744
|
+
return -1;
|
|
16745
|
+
}
|
|
16746
|
+
return aNumber - bNumber;
|
|
16747
|
+
} catch (error) {
|
|
16748
|
+
console.error(error);
|
|
16749
|
+
return -1;
|
|
16750
|
+
}
|
|
16751
|
+
};
|
|
16726
16752
|
var dateSortFn = (a, b, col, isTable) => {
|
|
16727
16753
|
try {
|
|
16728
16754
|
if (!a && !b) {
|
|
@@ -16751,6 +16777,27 @@
|
|
|
16751
16777
|
return -1;
|
|
16752
16778
|
}
|
|
16753
16779
|
};
|
|
16780
|
+
var sortDataByColumn = (data, columns, columnIndex, sortDirection = "asc") => {
|
|
16781
|
+
try {
|
|
16782
|
+
if (!data || typeof data !== "object") {
|
|
16783
|
+
throw new Error("Could not sort data by date - no data supplied");
|
|
16784
|
+
}
|
|
16785
|
+
const column = columns[columnIndex];
|
|
16786
|
+
if (!column) {
|
|
16787
|
+
throw new Error("Could not sort data by date - no column found from index and column list");
|
|
16788
|
+
}
|
|
16789
|
+
const isNumberType = isColumnNumberType(column);
|
|
16790
|
+
if (isNumberType) {
|
|
16791
|
+
let multiplier = sortDirection === "desc" ? -1 : 1;
|
|
16792
|
+
const sortedData = data.concat().sort((a, b) => multiplier * numberSortFn(a[columnIndex], b[columnIndex]));
|
|
16793
|
+
return sortedData;
|
|
16794
|
+
}
|
|
16795
|
+
return data.concat().sort((a, b) => a - b);
|
|
16796
|
+
} catch (error) {
|
|
16797
|
+
console.error(error);
|
|
16798
|
+
}
|
|
16799
|
+
return data;
|
|
16800
|
+
};
|
|
16754
16801
|
var sortDataByDate = (data, tableColumns, sortDirection = "desc", isTable) => {
|
|
16755
16802
|
try {
|
|
16756
16803
|
if (!data || typeof data !== "object") {
|
|
@@ -17037,9 +17084,11 @@
|
|
|
17037
17084
|
}
|
|
17038
17085
|
}
|
|
17039
17086
|
}
|
|
17040
|
-
const fullWidthLabel = formattedLabel
|
|
17087
|
+
const fullWidthLabel = `${formattedLabel}`;
|
|
17041
17088
|
if (typeof formattedLabel === "string" && maxLabelWidth && formattedLabel.length > maxLabelWidth) {
|
|
17042
17089
|
formattedLabel = `${formattedLabel.substring(0, maxLabelWidth)}...`;
|
|
17090
|
+
} else {
|
|
17091
|
+
formattedLabel = `${formattedLabel}`;
|
|
17043
17092
|
}
|
|
17044
17093
|
return { fullWidthLabel, formattedLabel };
|
|
17045
17094
|
};
|
|
@@ -18768,6 +18817,8 @@
|
|
|
18768
18817
|
console.error("Unable to generate pivot data - rows, columns, or table config was not provided");
|
|
18769
18818
|
return {};
|
|
18770
18819
|
}
|
|
18820
|
+
let pivotTableRowsLimited = false;
|
|
18821
|
+
let pivotTableColumnsLimited = false;
|
|
18771
18822
|
try {
|
|
18772
18823
|
let tableData = rows == null ? void 0 : rows.filter((row) => row[0] !== null);
|
|
18773
18824
|
if (!(tableData == null ? void 0 : tableData.length)) {
|
|
@@ -18775,30 +18826,43 @@
|
|
|
18775
18826
|
return {};
|
|
18776
18827
|
}
|
|
18777
18828
|
const { legendColumnIndex, stringColumnIndex, numberColumnIndex } = tableConfig;
|
|
18829
|
+
const maxColumns = 20;
|
|
18830
|
+
const maxRows = 100;
|
|
18778
18831
|
if (isNaN(legendColumnIndex) || isNaN(stringColumnIndex) || isNaN(numberColumnIndex)) {
|
|
18779
18832
|
console.error(
|
|
18780
18833
|
"Unable to generate pivot data - table config provided was invalid. You must provide a valid legend, string, ad number column index."
|
|
18781
18834
|
);
|
|
18782
18835
|
return {};
|
|
18783
18836
|
}
|
|
18784
|
-
let
|
|
18837
|
+
let uniqueRowHeaders = sortDataByDate(tableData, columns, "desc", "isTable").map((d) => d[stringColumnIndex]).filter(onlyUnique);
|
|
18838
|
+
let uniqueColumnHeaders = sortDataByDate(tableData, columns, "desc", "isTable").map((d) => d[legendColumnIndex]).filter(onlyUnique);
|
|
18839
|
+
let newStringColumnIndex = stringColumnIndex;
|
|
18840
|
+
let newLegendColumnIndex = legendColumnIndex;
|
|
18841
|
+
if (isFirstGeneration && Object.keys(uniqueColumnHeaders).length > Object.keys(uniqueRowHeaders).length && (!isColumnDateType(columns[stringColumnIndex]) || Object.keys(uniqueColumnHeaders).length > MAX_LEGEND_LABELS)) {
|
|
18842
|
+
newStringColumnIndex = legendColumnIndex;
|
|
18843
|
+
newLegendColumnIndex = stringColumnIndex;
|
|
18844
|
+
const tempValues = [...uniqueRowHeaders];
|
|
18845
|
+
uniqueRowHeaders = [...uniqueColumnHeaders];
|
|
18846
|
+
uniqueColumnHeaders = tempValues;
|
|
18847
|
+
}
|
|
18848
|
+
if ((uniqueRowHeaders == null ? void 0 : uniqueRowHeaders.length) > maxRows) {
|
|
18849
|
+
uniqueRowHeaders = uniqueRowHeaders.slice(0, maxRows);
|
|
18850
|
+
pivotTableRowsLimited = true;
|
|
18851
|
+
}
|
|
18852
|
+
const uniqueRowHeadersObj = uniqueRowHeaders.reduce((map4, title, i) => {
|
|
18785
18853
|
map4[title] = i;
|
|
18786
18854
|
return map4;
|
|
18787
18855
|
}, {});
|
|
18788
|
-
|
|
18856
|
+
if ((uniqueColumnHeaders == null ? void 0 : uniqueColumnHeaders.length) > maxColumns) {
|
|
18857
|
+
uniqueColumnHeaders = uniqueColumnHeaders.slice(0, maxColumns);
|
|
18858
|
+
pivotTableColumnsLimited = true;
|
|
18859
|
+
}
|
|
18860
|
+
const uniqueColumnHeadersObj = uniqueColumnHeaders.reduce((map4, title, i) => {
|
|
18789
18861
|
map4[title] = i;
|
|
18790
18862
|
return map4;
|
|
18791
18863
|
}, {});
|
|
18792
|
-
|
|
18793
|
-
|
|
18794
|
-
if (isFirstGeneration && Object.keys(uniqueValues1).length > Object.keys(uniqueValues0).length && (!isColumnDateType(columns[stringColumnIndex]) || Object.keys(uniqueValues1).length > MAX_LEGEND_LABELS)) {
|
|
18795
|
-
newStringColumnIndex = legendColumnIndex;
|
|
18796
|
-
newLegendColumnIndex = stringColumnIndex;
|
|
18797
|
-
const tempValues = (0, import_lodash5.default)(uniqueValues0);
|
|
18798
|
-
uniqueValues0 = (0, import_lodash5.default)(uniqueValues1);
|
|
18799
|
-
uniqueValues1 = (0, import_lodash5.default)(tempValues);
|
|
18800
|
-
}
|
|
18801
|
-
const firstColumn = {
|
|
18864
|
+
const pivotTableColumns = [];
|
|
18865
|
+
pivotTableColumns.push({
|
|
18802
18866
|
...columns[newStringColumnIndex],
|
|
18803
18867
|
index: 0,
|
|
18804
18868
|
frozen: true,
|
|
@@ -18808,10 +18872,9 @@
|
|
|
18808
18872
|
cssClass: "pivot-category",
|
|
18809
18873
|
pivot: true,
|
|
18810
18874
|
headerFilter: false
|
|
18811
|
-
};
|
|
18812
|
-
const pivotTableColumns = [firstColumn];
|
|
18875
|
+
});
|
|
18813
18876
|
const fullDataFormatting = getDataFormatting(dataFormatting);
|
|
18814
|
-
|
|
18877
|
+
uniqueColumnHeaders.forEach((columnName, i) => {
|
|
18815
18878
|
const formattedColumnName = formatElement({
|
|
18816
18879
|
element: columnName,
|
|
18817
18880
|
column: columns[newLegendColumnIndex],
|
|
@@ -18833,30 +18896,38 @@
|
|
|
18833
18896
|
});
|
|
18834
18897
|
});
|
|
18835
18898
|
const pivotTableData = makeEmptyArray(
|
|
18836
|
-
|
|
18899
|
+
uniqueColumnHeaders.length + 1,
|
|
18837
18900
|
// Add one for the frozen first column
|
|
18838
|
-
|
|
18901
|
+
uniqueRowHeaders.length
|
|
18839
18902
|
);
|
|
18840
18903
|
tableData.forEach((row) => {
|
|
18841
|
-
var _a;
|
|
18842
|
-
const
|
|
18843
|
-
const
|
|
18844
|
-
pivotTableData[
|
|
18845
|
-
|
|
18904
|
+
var _a, _b;
|
|
18905
|
+
const pivotRowIndex = uniqueRowHeadersObj[row[newStringColumnIndex]];
|
|
18906
|
+
const pivotRowHeaderValue = row[newStringColumnIndex];
|
|
18907
|
+
if (!pivotRowHeaderValue || !pivotTableData[pivotRowIndex]) {
|
|
18908
|
+
return;
|
|
18909
|
+
}
|
|
18910
|
+
pivotTableData[pivotRowIndex][0] = pivotRowHeaderValue;
|
|
18846
18911
|
const pivotValue = Number(row[numberColumnIndex]);
|
|
18847
|
-
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
|
|
18912
|
+
const pivotColumnIndex = uniqueColumnHeadersObj[row[newLegendColumnIndex]] + 1;
|
|
18913
|
+
pivotTableData[pivotRowIndex][pivotColumnIndex] = pivotValue;
|
|
18914
|
+
if (pivotTableColumns[pivotColumnIndex]) {
|
|
18915
|
+
pivotTableColumns[pivotColumnIndex].origValues[pivotRowHeaderValue] = {
|
|
18916
|
+
name: (_a = columns[newStringColumnIndex]) == null ? void 0 : _a.name,
|
|
18917
|
+
drill_down: (_b = columns[newStringColumnIndex]) == null ? void 0 : _b.drill_down,
|
|
18918
|
+
value: pivotRowHeaderValue
|
|
18919
|
+
};
|
|
18920
|
+
}
|
|
18852
18921
|
});
|
|
18853
18922
|
const dataReturn = {
|
|
18854
18923
|
pivotTableColumns,
|
|
18855
18924
|
pivotTableData,
|
|
18856
18925
|
stringColumnIndex: newStringColumnIndex,
|
|
18857
18926
|
legendColumnIndex: newLegendColumnIndex,
|
|
18858
|
-
pivotColumnHeaders:
|
|
18859
|
-
pivotRowHeaders:
|
|
18927
|
+
pivotColumnHeaders: uniqueColumnHeaders,
|
|
18928
|
+
pivotRowHeaders: uniqueRowHeaders,
|
|
18929
|
+
pivotTableRowsLimited,
|
|
18930
|
+
pivotTableColumnsLimited
|
|
18860
18931
|
};
|
|
18861
18932
|
return dataReturn;
|
|
18862
18933
|
} catch (error) {
|
|
@@ -23388,10 +23459,8 @@
|
|
|
23388
23459
|
};
|
|
23389
23460
|
var applyStylesForHiddenSeries = ({ legendElement, legendLabels }) => {
|
|
23390
23461
|
try {
|
|
23391
|
-
select_default2(legendElement).selectAll(".cell").each(function() {
|
|
23392
|
-
|
|
23393
|
-
const cellData = JSON.parse((_b = (_a = select_default2(this)) == null ? void 0 : _a.data) == null ? void 0 : _b.call(_a));
|
|
23394
|
-
const legendLabel = legendLabels == null ? void 0 : legendLabels.find((l) => l.label === (cellData == null ? void 0 : cellData.label));
|
|
23462
|
+
select_default2(legendElement).selectAll(".cell").each(function(label) {
|
|
23463
|
+
const legendLabel = legendLabels.find((l) => l.label === label);
|
|
23395
23464
|
if (legendLabel) {
|
|
23396
23465
|
select_default2(this).select(".swatch").attr("stroke", legendLabel.color).attr("stroke-location", "outside");
|
|
23397
23466
|
if (legendLabel.hidden) {
|