import { BarsConfigInterface } from './config'; import { DisplayStateManager } from '../_abstract/display-state-manager'; export interface BarData { label: string; count: number; } /** * Represents a bar chart visualization component. * * The `Bars` class is responsible for rendering a bar chart visualization based on the provided data and configuration. * It handles the creation of the necessary HTML elements, rendering of the bars, and management of user interactions such as * scrolling, searching, and sorting. */ export declare class Bars extends DisplayStateManager { private _data; private _originalData; private _config; private _container; private _searchContainer; private _searchInput; private _clearButton; private _scrollContainer; private _barsContainer; private _highlightedBarsContainer; private _showMoreButton; private _showMoreCount; private _sortingBlock; private _uniqueValues; private _countMap; private _visibleItemsCount; private _hiddenItemsSum; private _itemHeight; private _itemMargin; private _startIndex; private _endIndex; private _maxCount; private _selectedItem?; private _selectedLabels; private _isExpanded; private _sortingHandlers; private _highlightedCounts?; private _isFilteringActive; private _isConfigResortInProgress; private _isSortAnimationEnabled; private _captureSortPositions; private _animateSortFrom; private _getFilteredCount; private _getCountSortValue; get _maxDisplayedItems(): number; /** * Constructs a new instance of the Bars class, which is responsible for rendering a bar chart visualization. * * @param container - The HTML element that will contain the bar chart. * @param config - An optional configuration object that can be used to customize the behavior of the bar chart. */ constructor(container: HTMLElement, config?: BarsConfigInterface); private _createSearch; private _updateButtonState; private _updateArrowText; private _createSortingHandlers; private _createSortingBlock; private _createShowMoreButton; private _calculateVisibleItems; private _updateVisibleItems; private _createBarElement; private _renderItems; private _renderItemsToContainer; private _updateContainerHeights; private _updateShowMoreButton; private _updateUIElements; private _render; private _calculateItemDimensions; private _calcHiddenSum; private _handleShowMoreCount; private _handleScroll; private _handleSort; private _handleSearch; private _clearSearch; private _handleShowMore; /** * Returns the current configuration of the bars module. * @returns {BarsConfigInterface} The current configuration. */ getConfig(): BarsConfigInterface; /** * Sets the configuration for the bars module. * @param {BarsConfigInterface} [config] - The configuration object to set. * @returns {void} */ setConfig(config?: BarsConfigInterface): void; /** * Sets the data for the bars module. * @param {any[] | undefined} [values] - The array of values to set as the data. * @returns {void} */ setData(values?: any[] | undefined): void; /** * Sorts the data in the bars module by the count of each item, in ascending or descending order. * @param {boolean} [ascending=false] - If true, sorts the data in ascending order by count. Otherwise, sorts in descending order. * @returns {void} */ sortByCount(ascending?: boolean): void; /** * Sorts the data in the bars module alphabetically by the label of each item, in ascending or descending order. * @param {boolean} [ascending=true] - If true, sorts the data in ascending alphabetical order by label. Otherwise, sorts in descending alphabetical order. * @returns {void} */ sortAlphabetically(ascending?: boolean): void; /** * Destroys the bars module by removing event listeners, clearing the container, and resetting internal data structures. * This method should be called when the bars module is no longer needed to clean up any resources it has allocated. */ destroy(): void; resetList(): void; /** * Gets the currently selected item in the bars module. * @returns {BarData | undefined} - The currently selected bar data item, or undefined if none selected. */ getSelectedItem(): BarData | undefined; getSelectedItems(): BarData[]; /** * Sets the currently selected item in the bars module. * @param {BarData | undefined} item - The bar data item to select, or undefined to clear the selection. * @returns {void} */ setSelectedItem(item?: BarData): void; setSelectedItems(items?: BarData[]): void; /** * Sets the highlighted data for crossfiltering visualization. * Creates an overlay bar showing the proportion of filtered data for each category. * @param data - Array of string labels that should be highlighted, or undefined to clear highlighting */ setHighlightedData(data: string[] | undefined): void; /** * Sets the loading state of the bars module by updating the text content of a fallback div. * This method is typically called when data is being loaded asynchronously to provide a visual indication to the user. */ setLoadingState(): void; } export type { BarsConfigInterface };