def d3dag(self, max_jobs=10000):

    def node(job):
        jobid = self.jobid(job)
        return {'id': jobid, 'value': {'jobid': jobid, 'label': job.rule.name, 'rule': job.rule.name}}

    def edge(a, b):
        return {'u': self.jobid(a), 'v': self.jobid(b)}
    jobs = list(self.jobs)
    if (len(jobs) > max_jobs):
        logger.info('Job-DAG is too large for visualization (>{} jobs).'.format(max_jobs))
    else:
        logger.d3dag(nodes=[node(job) for job in jobs], edges=[edge(dep, job) for job in jobs for dep in self.dependencies[job] if self.needrun(dep)])
def d3dag(self, max_jobs=10000):

    def node(job):
        jobid = self.jobid(job)
        return {'id': jobid, 'value': {'jobid': jobid, 'label': job.rule.name, 'rule': job.rule.name}}

    def edge(a, b):
        return {'u': self.jobid(a), 'v': self.jobid(b)}
    jobs = list(self.jobs)
    if (len(jobs) > max_jobs):
        logger.info('Job-DAG is too large for visualization (>{} jobs).'.format(max_jobs))
    else:
        logger.d3dag(nodes=[node(job) for job in jobs], edges=[edge(dep, job) for job in jobs for dep in self.dependencies[job] if self.needrun(dep)])