code: def export_to_cytoscapejs(self):
          
          def _create_edge_data_dict(e):
              """Return a dict from a MultiDiGraph edge for CytoscapeJS export."""
              # A hack to get rid of the redundant 'Provenance' label.
              if e[3].get('provenance'):
                  tooltip = e[3]['provenance'][0]
                  if tooltip.get('@type'):
                      del tooltip['@type']
              else:
                  tooltip = None
              edge_data_dict = {
                      'id'               : e[0]+'_'+e[1],
                      'source'           : e[0],
                      'target'           : e[1],
                      'linestyle'        : e[3]["linestyle"],
                      'linecolor'        : e[3]["linecolor"],
                      'targetArrowShape' : e[3]["targetArrowShape"],
                      'subj_adjectives'  : e[3]["subj_adjectives"],
                      'subj_polarity'    : e[3]["subj_polarity"],
                      'obj_adjectives'   : e[3]["obj_adjectives"],
                      'obj_polarity'     : e[3]["obj_polarity"],
                      'tooltip'          : tooltip,
                      'simulable'        : False if (
                          e[3]['obj_polarity'] is None or
                          e[3]['subj_polarity'] is None) else True,
                      }
              return edge_data_dict
  
          return {
                  'nodes': [{'data': {
                      'id': n[0],
                      'simulable': n[1]['simulable'],
                      'tooltip': 'Modifiers: '+json.dumps(n[1]['mods'])}
                      } for n in self.CAG.nodes(data=True)],
  
                  'edges': [{'data': _create_edge_data_dict(e)}
                            for e in self.CAG.edges(data=True, keys=True)]
                  }
docs: Return CAG in format readable by CytoscapeJS.
  
          Return
          ------
          dict
              A JSON-like dict representing the graph for use with
              CytoscapeJS.