import ClusteringWorker from './workers/clustering-worker' ; import { CaseItem , CasesAndEntities , ClusteringMessage , EntityItem } from "./workers/clustering-worker" ; param casesAndEntitites return function _hcluster ( casesAndEntitites , dimension ) { var worker = new ClusteringWorker ( ) ; var message = new Object ( ) as ClusteringMessage ; var def = new $ . Deferred ( ) ; message . casesAndEntities = casesAndEntitites ; message . dimension = dimension ; worker . postMessage ( message ) ; worker . onmessage = function ( m ) { def . resolve ( m . data as ( CaseItem [ ] ) | ( EntityItem [ ] ) ) ; } ; return def . promise ( ) ; } return export function hclusterColumns ( casesAndEntitites ) { return _hcluster ( casesAndEntitites , "CASES" ) ; } return export function hclusterTracks ( casesAndEntitites ) { return _hcluster ( casesAndEntitites , "ENTITIES" ) ; }