public VisualizerContext newContext ( ResultHierarchy hier , Result start ) { Collection < Relation < ? > > rels = ResultUtil . filterResults ( hier , Relation . class ) ; for ( Relation < ? > rel : rels ) { if ( samplesize == 0 ) { continue ; } if ( ! ResultUtil . filterResults ( hier , rel , SamplingResult . class ) . isEmpty ( ) ) { continue ; } if ( rel . size ( ) > samplesize ) { SamplingResult sample = new SamplingResult ( rel ) ; sample . setSample ( DBIDUtil . randomSample ( sample . getSample ( ) , samplesize , rnd ) ) ; ResultUtil . addChildResult ( rel , sample ) ; } } return new VisualizerContext ( hier , start , stylelib , factories ) ; }
Make a new visualization context