import { HistoryNodeOptionEvent , nodeOptionEvent } from '@/store/history/types' ; import Clustering , { ClusteringAlgorithm } from './clustering' ; enum ClusteringEventType { SELECT_ALGORITHM = 'setAlgorithm' , SELECT_COLUMNS = 'setColumns' , INPUT_KMEANS_K = 'setKMeansK' , INPUT_KMEANS_ITERATION_INTERVAL = 'setKMeansIterationInterval' } export const selectAlgorithmEvent = ( node , algorithm , prevAlgorithm ) : HistoryNodeOptionEvent => { return nodeOptionEvent ( ClusteringEventType . SELECT_ALGORITHM , 'select clustering algorithm' , node , node . setAlgorithm , algorithm , prevAlgorithm ) ; } ; export const selectColumnsEvent = ( node , columns , prevColumns ) : HistoryNodeOptionEvent => { return nodeOptionEvent ( ClusteringEventType . SELECT_COLUMNS , 'select column' , node , node . setColumns , columns , prevColumns ) ; } ; export const inputKMeansKEvent = ( node , k , prevK ) : HistoryNodeOptionEvent => { return nodeOptionEvent ( ClusteringEventType . INPUT_KMEANS_K , 'input k' , node , node . setKMeansK , k , prevK ) ; } ; export const inputKMeansIterationIntervalEvent = ( node , interval , prevInterval ) : HistoryNodeOptionEvent => { return nodeOptionEvent ( ClusteringEventType . INPUT_KMEANS_ITERATION_INTERVAL , 'input iteration interval' , node , node . setKMeansIterationInterval , interval , prevInterval ) ; } ;