import { EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; import { DataVariable, GraphicSymbolOption, GraphicVariable, GraphicVariableOption, RecordStream } from '@dvl-fw/core'; import { Store } from '@ngrx/store'; import { Subscription } from 'rxjs'; import { DragDropEvent } from '../../drag-drop'; import { AdvancedService } from '../../shared/services/advance/advanced.service'; import { DataVariableHoverService } from '../../shared/services/hover/data-variable-hover.service'; import { UpdateVisService } from '../../shared/services/update-vis/update-vis.service'; import { Vis } from '../../shared/types'; import { MavSelectionState } from '../shared/store'; /** * Mav Selection graphic-variable-type component declaration, responsible for showing graphic-variable-type options in mav-selection */ export declare class GraphicVariableTypeComponent implements OnChanges, OnDestroy { private store; private updateService; private hoverService; private advancedService; private mavSelectionStore; /** * Input for the visualization currently active, or being viewed by the user */ activeVis: Vis; /** * Input for the mappings from graphic-symbol-option-id to recordStream i.e. Map */ recordStreamMapping: Map; /** * Output event-emitter with boolean value indicating if a graphic-variable selection has been made */ gvSelectionMade: EventEmitter; /** * Available graphic symbol options */ graphicSymbolOptions: GraphicSymbolOption[]; /** * Selection class of graphic variable type component */ selectionClass: string; /** * Available graphic variables */ availableGraphicVariables: GraphicVariable[]; /** * Selected data variables mapping i.e. Map */ selectedDataVariablesMapping: Map>; /** * Required graphic variables mapping i.e. Map */ requiredGraphicVariablesMapping: Map; /** * Allowed qualitative scale types */ qualitativeScaleTypes: string[]; /** * Allowed quantitative scale types */ quantitativeScaleTypes: string[]; /** * Graphic variable id of the currently highlighted graphic variable */ currentHighlightId: string; /** * Record set id of the selected data-variable */ selectedDataVariableRecordSetId: string; /** * Hover service subscription */ hoverServiceSubscription: Subscription; /** * Advanced service subscription */ advancedServiceSubscription: Subscription; /** * Graphic variable subscription */ graphicVariableSubscription: Subscription; /** * Creates an instance of graphic variable type component. * @param store * @param updateService instance of UpdateVisService, responsible for dispatching store actions for updating visualizations * @param hoverService instance of DataVariableHoverService, responsible for hover actions on data-variables */ constructor(store: Store, updateService: UpdateVisService, hoverService: DataVariableHoverService, advancedService: AdvancedService, mavSelectionStore: Store); /** * Update the visualization with latest graphic variable. */ updateVisualization(): void; /** * Angular life cycle hook, clear subscriptions here. */ ngOnDestroy(): void; /** * on changes * @param changes The changed properties object */ ngOnChanges(changes: SimpleChanges): void; /** * Clears global variables and mappings */ clear(): void; /** * Updates mapping and done button status * @param dataVariable The dropped data-variable * @param graphicVariableOption the graphic-variable-option on which the data-variable was dropped * @param graphicSymbolOption the graphic-symbol-option to which the graphic-variable-option belongs */ dataVariableDropped(dataVariable: DataVariable, graphicVariableOption: GraphicVariableOption, graphicSymbolOption: GraphicSymbolOption): void; /** * Gets graphic variables that can be mapped to the provided data-variable * @param dataVariable the provided data-variable * @param graphicVariableOption the graphic-variable-option used to create the mapping * @param graphicSymbolOption the graphic-symbol-option-id to which the graphic-variabl-option belongs * @returns mappable graphic variables */ getMappableGraphicVariables(dataVariable: DataVariable, graphicVariableOption: GraphicVariableOption, graphicSymbolOption: GraphicSymbolOption): GraphicVariable[]; /** * Gets graphic symbol options for the active visualization. * Also filtering the graphic variables if advanced is enabled or disabled. * @returns graphic symbol options */ getGraphicSymbolOptions(): GraphicSymbolOption[]; /** * Gets graphic variable scale type * @param graphicVariableOption the provided graphic-variable-option * @returns graphic variable's scale type for the provided graphic-variable-option */ getVariableScaleType(graphicVariableOption: any): string; /** * Gets the name of the data-variable that is mapped to the graphic-variable-option * @param graphicVariableOption the provided graphic-variable-option * @param graphicSymbolOption the provided graphic-symbol-option to which the graphic-variable-option belongs * @returns name of the data-variable mapped to the graphic-variable-option */ getGraphicVariableSelected(graphicVariableOption: any, graphicSymbolOption: any): string; /** * Gets data variable mappings i.e. Map * @returns data variable mappings */ getDataVariableMappings(): Map>; /** * Gets req graphic-variablemappings i.e. Map * @returns req graphic-variable mappings */ getReqGVMappings(): Map; /** * Callback handler for drag-drop event that happens when a data-variable is dropped on the graphic-variable * @param event instance of DragDropEvent object */ onDragDropEvent(event: DragDropEvent): void; /** * Tells if the data-variable will be accepted by a graphic-variable dropzone * @param graphicVariableOption the graphic-variable-option on which the data-variable is being dropped * @param graphicSymbolOption the graphic-symbol-option to which the graphic-variable-option belongs * @returns a function which given a data-variable returns a boolean telling if the data-variable can be mapped to a graphic-variable */ acceptsDrop(graphicVariableOption: GraphicVariableOption, graphicSymbolOption: GraphicSymbolOption): (dataVariable: DataVariable) => boolean; /** * Unsets graphic variable selection * @param graphicSymbolOptionId id of graphic-symbol-option to which the graphic-variable-option belongs * @param graphicVariableOptionIdOrType id or type of graphic-variable-option */ unsetGraphicVariable(graphicSymbolOptionId: string, graphicVariableOptionIdOrType: string): void; /** * Updates done button status */ updateActionButtonStatus(): void; /** * Highlights the graphic-variable-option which can be mapped for the dragged/hovered data-variable * @param graphicVariableOption provided graphic-variable-option * @param graphicSymbolOption graphic-symbol-option to which graphic-variable-option belongs * @returns boolean if it can be highlighted */ shouldHighlight(graphicVariableOption: GraphicVariableOption, graphicSymbolOption: GraphicSymbolOption): boolean; /** * Callback handler for when hovering starts on the data-variable * @param graphicVariableOption provided graphic-variable-option * @param graphicSymbolOption graphic-symbol-option to which graphic-variable-option belongs */ startHover(graphicVariableOption: GraphicVariableOption, graphicSymbolOption: GraphicSymbolOption): void; /** * wrapper for end-hover function of hover-service */ endHover(): void; /** * Capitalizes the text in sentence case * @param text provided string * @returns capitalized string */ capitalize(text: string): string; /** * Callback handler for when the graphic-variable-selection panel is opened * @param gsOption the graphic-symbol-option whose panel is opened */ panelOpened(gsOption: GraphicSymbolOption): void; /** * Callback handler for when the graphic-variable-selection panel is closed * @param gsOption the graphic-symbol-option whose panel is closed */ panelClosed(gsOption: GraphicSymbolOption): void; }