Exemple #1
0
    def create_dependent_modules(self, input_module, input_slot, range_query=None, select=None, histogram2d=None,heatmap=None,sample=None, **kwds):
        if hasattr(self, 'input_module'): # test if already called
            return self
        
        s=self.scheduler()
        self.input_module = input_module
        self.input_slot = input_slot
        
        if range_query is None:
            range_query = RangeQuery(group=self.id,scheduler=s)
            range_query.create_dependent_modules(input_module, input_slot, **kwds)
        if select is None:
            select = Select(group=self.id,scheduler=s)
        select.input.df = input_module.output[input_slot]
        select.input.query = range_query.output.query
        if histogram2d is None:
            histogram2d = Histogram2D(self.x_column, self.y_column,group=self.id,scheduler=s);
        histogram2d.input.df = select.output.df
        histogram2d.input.min = range_query.output.min
        histogram2d.input.max = range_query.output.max
        if heatmap is None:
            heatmap = Heatmap(group=self.id,filename='heatmap%d.png', history=100, scheduler=s)
        heatmap.input.array = histogram2d.output.df
        if sample is None:
            sample = Sample(n=50,group=self.id,scheduler=s)
        sample.input.df = select.output.df

        scatterplot=self
        scatterplot.input.heatmap = heatmap.output.heatmap
        scatterplot.input.df = sample.output.df

        self.range_query = range_query
        self.min = range_query.min
        self.max = range_query.max
        self.min_value = range_query.min_value
        self.max_value = range_query.max_value
        self.select = select
        self.histogram2d = histogram2d
        self.heatmap = heatmap
        self.sample = sample

        return scatterplot
Exemple #2
0
    def create_dependent_modules(self, input_module, input_slot, **kwds):
        from progressivis import RangeQuery
        
        if hasattr(self, 'input_module'): # test if already called
            return self
        s=self.scheduler()
        self.input_module = input_module
        self.input_slot = input_slot

        query = RangeQuery(group=self.id,scheduler=s)
        query.create_dependent_modules(input_module, input_slot, **kwds)

        select = self
        select.input.df = input_module.output[input_slot]
        select.input.query = query.output.query

        self.query = query
        self.min = query.min
        self.max = query.max
        self.min_value = query.min_value
        self.max_value = query.max_value
        
        return select