def render_pipeline(self):
dict_viz = {<EOL>"<STR_LIT:name>": "<STR_LIT:root>",<EOL>"<STR_LIT>": []<EOL>}<EOL>last_of_us = {}<EOL>f_tree = self._fork_tree if self._fork_tree else {<NUM_LIT:1>: [<NUM_LIT:1>]}<EOL>for x, (k, v) in enumerate(f_tree.items()):<EOL><INDENT>for p in self.processes[<NUM_LIT:1>:]:<EOL><INDENT>if x == <NUM_LIT:0> and p.lane not in [k] + v:<EOL><INDENT>continue<EOL><DEDENT>if x > <NUM_LIT:0> and p.lane not in v:<EOL><INDENT>continue<EOL><DEDENT>if not p.parent_lane:<EOL><INDENT>lst = dict_viz["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>lst = last_of_us[p.parent_lane]<EOL><DEDENT>tooltip = {<EOL>"<STR_LIT:name>": "<STR_LIT>".format(p.template, p.pid),<EOL>"<STR_LIT>": {<EOL>"<STR_LIT>": p.pid,<EOL>"<STR_LIT:input>": p.input_type,<EOL>"<STR_LIT>": p.output_type if p.output_type else "<STR_LIT:None>",<EOL>"<STR_LIT>": p.lane,<EOL>},<EOL>"<STR_LIT>": []<EOL>}<EOL>dir_var = "<STR_LIT>"<EOL>for k2, v2 in p.directives.items():<EOL><INDENT>dir_var += k2<EOL>for d in v2:<EOL><INDENT>try:<EOL><INDENT>directive = v2[d].replace("<STR_LIT:'>", "<STR_LIT>").replace('<STR_LIT:">', '<STR_LIT>')if isinstance(v2[d], str) else v2[d]<EOL>dir_var += "<STR_LIT>".format(d, directive)<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>if dir_var:<EOL><INDENT>tooltip["<STR_LIT>"]["<STR_LIT>"] = dir_var<EOL><DEDENT>else:<EOL><INDENT>tooltip["<STR_LIT>"]["<STR_LIT>"] = "<STR_LIT>"<EOL><DEDENT>lst.append(tooltip)<EOL>last_of_us[p.lane] = lst[-<NUM_LIT:1>]["<STR_LIT>"]<EOL><DEDENT><DEDENT>self.dag_to_file(dict_viz)<EOL>with open(os.path.join(dirname(self.nf_file),<EOL>"<STR_LIT>"), "<STR_LIT:w>") as fh:<EOL><INDENT>fh.write(json.dumps(self._fork_tree))<EOL><DEDENT>return self._render_config("<STR_LIT>", {"<STR_LIT:data>": dict_viz})<EOL>
Write pipeline attributes to json

        This function writes the pipeline and their attributes to a json file,
        that is intended to be read by resources/pipeline_graph.html to render
        a graphical output showing the DAG.