<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>

    <title>Title</title>
  </head>
  <body>
    <div id="viz"></div>
  </body>
  {# prettier-ignore-start #}
<script>
data = {
  "aliases" : [ ] ,
  "completed" : "true" ,
  "description" : "1,1,1-Trichloro-2,2-bis-(4`-chlorophenyl)ethane (DDT), the first of the chlorinated organic insecticides, is a widely distributed and persistent xenobiotic contaminant in the environment. DDT is not metabolized very rapidly by animals; instead, it is deposited and stored in the fatty tissues. The biological half-life of DDT is about eight years; that is, it takes about eight years for an animal to metabolize half of the amount it assimilates. If ingestion continues at a steady rate, DDT builds up within the animal over time. Despite being banned in the United States, DDT continues to be widely used in many developing nations. This page shows only its aerobic pathway. The anaerobic degradation of DDT is documented elsewhere in the EAWAG-BBD. The chemical structure of DDT, including aromatic and alicyclic moieties, offers a variety of possibilities for biochemical attack. Several aerobic pathways for DDT metabolism in different organisms were suggested ([http://www.ncbi.nlm.nih.gov/pubmed/9563945|Quensen et al., 1998], [http://www.ncbi.nlm.nih.gov/pubmed/9603826|Hay et al., 1998], [http://www.ncbi.nlm.nih.gov/pubmed/8117093|Nadeau et al., 1994]). Compounds in brackets were not identified but postulated based on other studies, such as those of the Biphenyl Pathway. The steps labeled A, B, C, D, E are mutiple steps whose intermediates are not identified yet. All descriptions as follows were proposed based on other similar experiments. In A, DDE is attacked by a dioxygenase at the ortho and meta positions. Such an attack would give rise to a 2,3-dihydrodiol-DDE intermediate. In B and D, 2-(4`-Chlorophenyl)-3,3-dichloropropenoate may proceed via decarboxylation to yield 1,1-dichloro-(4`-chlorophenyl)ethane. The latter will undergo oxidation of the aliphatic side chain to yield 1,1-dichloro-(4`-chlorophenyl)ethanol which is further oxidized to yield 4-Chloroacetophenone. The terminal methyl group of 1,1-dichloro-(4`-chlorophenyl)ethane may also undergo oxidation to yield phenylacetic acid. In C, the transformation of 4-Chloroacetophenone to 4-Chlorobenzaldehyde may be via complete oxidation and subsequent decarboxylation of the terminal methyl group. In E, the ring-cleavage product would be further degraded to either a C-6- or C-5-chlorinated acid, depending on where the hydrolytic cleavage takes place." ,
  "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe" ,
  "isIncremental" : false ,
  "isPredicted" : false ,
  "lastModified" : 1447842835894 ,
  "links" : [
      {
        "ecNumbers" : [
            {
              "ecName" : "cis-2,3-dihydrodiol DDT dehydrogenase" ,
              "ecNumber" : "1.3.1.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/fbdf7cea-0668-442d-ba03-4025f8860f67" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/0c6fafc8-6352-4efe-b670-9d1394a13b2f" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0451" ,
        "pseudo" : false ,
        "rule" : "[#6:9]:[#6:10]@-[C:6]([H])([#8:2][H:11])[C:5]([H])(@-[#6:7]:[#6:8])[#8:1][H:12]>>[H:12][#8:1]-[#6:5](-[#6:7]:[#6:8])=[#6:6](-[#8:2][H:11])-[#6:10]:[#6:9]" ,
        "scenarios" : [ ] ,
        "source" : 4 ,
        "target" : 11
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "6-oxo-2-hydroxy-7-(4`-chlorophenyl)-3,8,8-trichloroocta-2E,4E,7-trienoate hydrolase" ,
              "ecNumber" : "3.7.1.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/6c20062c-5239-41ff-af4f-646f7f98c1c4" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/c8d0efd3-8918-4efb-b20f-487351ff810f" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0444" ,
        "pseudo" : true ,
        "scenarios" : [ ] ,
        "source" : 5 ,
        "target" : 14
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "6-oxo-2-hydroxy-7-(4`-chlorophenyl)-3,8,8-trichloroocta-2E,4E,7-trienoate hydrolase" ,
              "ecNumber" : "3.7.1.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/6c20062c-5239-41ff-af4f-646f7f98c1c4" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/c8d0efd3-8918-4efb-b20f-487351ff810f" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0444" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 14 ,
        "target" : 2
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "6-oxo-2-hydroxy-7-(4`-chlorophenyl)-3,8,8-trichloroocta-2E,4E,7-trienoate hydrolase" ,
              "ecNumber" : "3.7.1.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/6c20062c-5239-41ff-af4f-646f7f98c1c4" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/c8d0efd3-8918-4efb-b20f-487351ff810f" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0444" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 14 ,
        "target" : 12
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/a773904c-fde0-40b1-85da-149dd1e36601" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/490c42b9-8553-4015-8642-4655f1bee7d7" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0454" ,
        "pseudo" : true ,
        "scenarios" : [ ] ,
        "source" : 12 ,
        "target" : 15
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/a773904c-fde0-40b1-85da-149dd1e36601" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/490c42b9-8553-4015-8642-4655f1bee7d7" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0454" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 15 ,
        "target" : 13
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/7eb884e4-5bb0-4ee1-88d7-3c344f7c4329" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/1e6e16b9-9cbb-467b-89ab-ef6e50f75f71" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0446" ,
        "pseudo" : true ,
        "scenarios" : [ ] ,
        "source" : 10 ,
        "target" : 16
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/7eb884e4-5bb0-4ee1-88d7-3c344f7c4329" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/1e6e16b9-9cbb-467b-89ab-ef6e50f75f71" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0446" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 16 ,
        "target" : 3
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/7786bdf9-9986-44c7-a5de-9b0875efa2be" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/507b03af-31fa-4469-b68e-cf1249ba3118" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0453" ,
        "pseudo" : true ,
        "scenarios" : [ ] ,
        "source" : 7 ,
        "target" : 17
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/7786bdf9-9986-44c7-a5de-9b0875efa2be" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/507b03af-31fa-4469-b68e-cf1249ba3118" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0453" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 17 ,
        "target" : 6
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "2,3-dihydroxy DDT 1,2-dioxygenase" ,
              "ecNumber" : "1.13.11.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/8d6004b8-8823-4b89-b8e2-959f06eea41d" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/d4f1b30e-f596-43fc-b777-88e4709ede68" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0452" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 11 ,
        "target" : 7
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "DDT 2,3-dioxygenase" ,
              "ecNumber" : "1.14.12.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/ff193e7b-f010-43d4-acb3-45f34d938824" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/e11419cd-6b46-470b-8a06-a08d62281734" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0450" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 0 ,
        "target" : 4
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "4-chlorobenzaldehyde oxidase" ,
              "ecNumber" : "1.2.-.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/f9f6aeae-3dfd-4337-b523-5f55bf84ec38" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/ee884e1b-58ab-4139-9867-d26fb5d1e0da" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0447" ,
        "pseudo" : false ,
        "rule" : "[H][#6:1](-[#6:5])=[O:4]>>[#6:5]-[#6:1](-[#8-])=[O:4]" ,
        "scenarios" : [ ] ,
        "source" : 3 ,
        "target" : 6
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/8a9e85eb-4c7c-47c3-993b-4225e8ef2815" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/0302c1eb-ef63-4ecf-a0ed-1ff96e1333a1" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0445" ,
        "pseudo" : true ,
        "scenarios" : [ ] ,
        "source" : 12 ,
        "target" : 18
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/8a9e85eb-4c7c-47c3-993b-4225e8ef2815" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/0302c1eb-ef63-4ecf-a0ed-1ff96e1333a1" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0445" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 18 ,
        "target" : 10
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/52a90af9-5c2b-48cd-9d22-c332d927ab6b" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/d13eda90-4abc-4bbf-9fa6-88e2736df59b" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0441" ,
        "pseudo" : true ,
        "rule" : "[H][c:1]1[c:7][c:10][c:9][#6,#7;a:8][c:2]1[H]>>[#8]-[c:1]1[c:7][c:10][c:9][#6,#7;a:8][c:2]1-[#8]" ,
        "scenarios" : [ ] ,
        "source" : 1 ,
        "target" : 19
      } ,
      {
        "ecNumbers" : [ ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/52a90af9-5c2b-48cd-9d22-c332d927ab6b" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/d13eda90-4abc-4bbf-9fa6-88e2736df59b" ,
        "multistep" : "true" ,
        "name" : "Eawag BBD reaction r0441" ,
        "pseudo" : false ,
        "rule" : "[H][c:1]1[c:7][c:10][c:9][#6,#7;a:8][c:2]1[H]>>[#8]-[c:1]1[c:7][c:10][c:9][#6,#7;a:8][c:2]1-[#8]" ,
        "scenarios" : [ ] ,
        "source" : 19 ,
        "target" : 9
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "DDE reductive dehalogenase" ,
              "ecNumber" : "1.97.1.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/ee196861-bd32-456f-99cc-8119c9bad882" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/5c932def-ef54-4394-a4e3-338da43b96cc" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0440" ,
        "pseudo" : false ,
        "rule" : "[#6:1]-[#17,#35,#53]>>[#6:1][H]" ,
        "scenarios" : [ ] ,
        "source" : 1 ,
        "target" : 8
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "1,1-dichloro-2-(dihydroxy-4-chlorophenyl)-(4-chlorophenyl)ethylene 1,2-dioxygenase" ,
              "ecNumber" : "1.13.11.-"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/4e55a813-953a-4639-b414-a96fb7bd31e4" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/cb5db6a6-f9ea-4fd6-816e-838dcd56f287" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0442" ,
        "pseudo" : false ,
        "scenarios" : [ ] ,
        "source" : 9 ,
        "target" : 5
      } ,
      {
        "ecNumbers" : [
            {
              "ecName" : "DDT dehydrochlorinase" ,
              "ecNumber" : "4.5.1.1"
            }
          ] ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/4929ec97-626c-4f5f-836f-7136e6012ed8" ,
        "idreaction" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/reaction/5d1851fc-787a-43ce-b613-f1192595e0a5" ,
        "multistep" : "false" ,
        "name" : "Eawag BBD reaction r0439" ,
        "pseudo" : false ,
        "rule" : "[H][C:6]([c:12]1[c:11][c:10][c:9](-[#9,#17,#35,#53:19])[c:8][c:7]1)([c:13]1[c:14][c:18][c:17](-[#9,#17,#35,#53:20])[c:16][c:15]1)[C:5]([#1,#17,#35,#53])([#1,#17,#35,#53:3])[#1,#17,#35,#53:4]>>[#1,#17,#35,#53:3]\\[#6:5](-[#1,#17,#35,#53:4])=[#6:6](\\[c:12]1[c:11][c:10][c:9](-[#9,#17,#35,#53:19])[c:8][c:7]1)-[c:13]1[c:14][c:18][c:17](-[#9,#17,#35,#53:20])[c:16][c:15]1" ,
        "scenarios" : [ ] ,
        "source" : 0 ,
        "target" : 1
      }
    ] ,
  "name" : "1,1,1-Trichloro-2,2-bis-(4`-chlorophenyl)ethane (DDT)" ,
  "nodes" : [
      {
        "atomCount" : 19 ,
        "depth" : 0 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/b1f9ae78-1710-46d9-bfc6-52d07f524206" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/e6561f48-328e-4815-8fa8-1745613149fe/structure/79eb379c-b696-46d7-8a2e-bd5aceab8d63" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/e6561f48-328e-4815-8fa8-1745613149fe/structure/79eb379c-b696-46d7-8a2e-bd5aceab8d63" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/b1f9ae78-1710-46d9-bfc6-52d07f524206?image=svg" ,
        "imageSize" : 730 ,
        "name" : "1,1,1-Trichloro-2,2-bis-(4`-chlorophenyl)ethane (DDT)" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(C2=CC=C(C=C2)Cl)C(Cl)(Cl)Cl"
      } ,
      {
        "atomCount" : 18 ,
        "depth" : 1 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/59f7f681-cecd-45ae-8b80-aef89f38bf49" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/c2d9c606-166a-4877-9135-a57884404cde/structure/e2cd8fa7-c37e-48ee-a3c5-d2ebcd3c11ba" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/c2d9c606-166a-4877-9135-a57884404cde/structure/e2cd8fa7-c37e-48ee-a3c5-d2ebcd3c11ba" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/59f7f681-cecd-45ae-8b80-aef89f38bf49?image=svg" ,
        "imageSize" : 730 ,
        "name" : "1,1-Dichloro-2,2-bis(4`-chlorophenyl)ethylene (DDE)" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(=C(Cl)Cl)C2=CC=C(C=C2)Cl"
      } ,
      {
        "atomCount" : 9 ,
        "depth" : 4 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/ef4b1fa2-f47c-43d2-b743-4efbc1dd3d6c" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/7d13a253-8427-4ea0-852d-aaf5761d84eb/structure/7c751e49-2507-4e07-92ff-844926d02897" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/7d13a253-8427-4ea0-852d-aaf5761d84eb/structure/7c751e49-2507-4e07-92ff-844926d02897" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/ef4b1fa2-f47c-43d2-b743-4efbc1dd3d6c?image=svg" ,
        "imageSize" : 490 ,
        "name" : "cis-2-Hydroxy-3-chloropenta-2,4-dienone" ,
        "proposed" : [ ] ,
        "smiles" : "C=C/C(=C(\\C(=O)[O-])/O)/Cl"
      } ,
      {
        "atomCount" : 9 ,
        "depth" : 6 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/b252c528-8cfb-4c46-a4c6-d073ff83a2a7" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/0cfdbe4b-5cd3-4822-a241-d9cbd865d1cc/structure/70271b5f-57bf-4f0f-bfff-171011475ce8" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/0cfdbe4b-5cd3-4822-a241-d9cbd865d1cc/structure/70271b5f-57bf-4f0f-bfff-171011475ce8" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/b252c528-8cfb-4c46-a4c6-d073ff83a2a7?image=svg" ,
        "imageSize" : 485 ,
        "name" : "4-Chlorobenzaldehyde" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C=O"
      } ,
      {
        "atomCount" : 21 ,
        "depth" : 1 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/55b5d61c-cb87-4102-835b-ed5b4c8b0c1e" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/77e86fba-5c3c-4661-9053-c07fd3b7ab76/structure/8b09ca8d-e227-464f-9af2-7b5858cd5956" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/77e86fba-5c3c-4661-9053-c07fd3b7ab76/structure/8b09ca8d-e227-464f-9af2-7b5858cd5956" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/55b5d61c-cb87-4102-835b-ed5b4c8b0c1e?image=svg" ,
        "imageSize" : 753 ,
        "name" : "cis-2,3-Dihydrodiol DDT" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(C2=CC=C([C@H]([C@H]2O)O)Cl)C(Cl)(Cl)Cl"
      } ,
      {
        "atomCount" : 22 ,
        "depth" : 3 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/a3261162-cbcc-494b-9d9b-7d7ecc1b2c15" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/9a2cff63-11ca-45a2-961f-3ff78882b455/structure/7106bb90-651e-4aea-811d-652af7ff46f0" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/9a2cff63-11ca-45a2-961f-3ff78882b455/structure/7106bb90-651e-4aea-811d-652af7ff46f0" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/a3261162-cbcc-494b-9d9b-7d7ecc1b2c15?image=svg" ,
        "imageSize" : 919 ,
        "name" : "6-Oxo-2-hydroxy-7-(4`-chlorophenyl)-3,8,8-trichloroocta-2Z,4Z,7-trienoate" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(=C(Cl)Cl)C(=O)/C=C\\C(=C(/C(=O)[O-])\\O)\\Cl"
      } ,
      {
        "atomCount" : 10 ,
        "depth" : 4 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/31f79480-c2a7-4b94-a26a-8901c0b9ee38" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/4424cf9c-bf55-4dca-a587-ea60a6ec84df/structure/96dfe5fd-e48d-4e07-98eb-f9cb8d16e246" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/4424cf9c-bf55-4dca-a587-ea60a6ec84df/structure/96dfe5fd-e48d-4e07-98eb-f9cb8d16e246" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/31f79480-c2a7-4b94-a26a-8901c0b9ee38?image=svg" ,
        "imageSize" : 503 ,
        "name" : "4-Chlorobenzoate" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(=O)[O-]"
      } ,
      {
        "atomCount" : 23 ,
        "depth" : 3 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/01aafa69-ee6a-43b6-a1c5-30b10ea60fec" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/7ded624f-d231-41b4-a409-532fbc5e8e8f/structure/77a2ca5c-7027-4493-97c8-ab7d3bc86b93" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/7ded624f-d231-41b4-a409-532fbc5e8e8f/structure/77a2ca5c-7027-4493-97c8-ab7d3bc86b93" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/01aafa69-ee6a-43b6-a1c5-30b10ea60fec?image=svg" ,
        "imageSize" : 919 ,
        "name" : "6-Oxo-2-hydroxy-7-(4`-chlorophenyl)-3,8,8,8-tetrachloroocta-2Z,4Z-dienoate" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(C(=O)/C=C\\C(=C(/C(=O)[O-])\\O)\\Cl)C(Cl)(Cl)Cl"
      } ,
      {
        "atomCount" : 17 ,
        "depth" : 2 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/b61e0141-3263-40e8-abbe-a1f67217531a" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/dd79e998-a09e-4b00-a19a-03f1fad65c68/structure/ab3e8672-c32a-4d64-9e57-14fe5c9f4c5e" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/dd79e998-a09e-4b00-a19a-03f1fad65c68/structure/ab3e8672-c32a-4d64-9e57-14fe5c9f4c5e" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/b61e0141-3263-40e8-abbe-a1f67217531a?image=svg" ,
        "imageSize" : 730 ,
        "name" : "1-Chloro-2,2-bis(4`-chlorophenyl)ethylene (DDMU)" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(=CCl)C2=CC=C(C=C2)Cl"
      } ,
      {
        "atomCount" : 20 ,
        "depth" : 2 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/0048363c-e3d9-476d-a8a7-3bf862ce808f" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/82f091b3-9bc0-49e7-8a55-91d27e5a3620/structure/5e7dbebe-1702-4658-ab13-cd7675afb57f" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/82f091b3-9bc0-49e7-8a55-91d27e5a3620/structure/5e7dbebe-1702-4658-ab13-cd7675afb57f" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/0048363c-e3d9-476d-a8a7-3bf862ce808f?image=svg" ,
        "imageSize" : 753 ,
        "name" : "1,1-Dichloro-2-(dihydroxy-4`-chorophenyl)-2-(4`-chlorophenyl)ethylene" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(=C(Cl)Cl)C2=CC=C(C(=C2O)O)Cl"
      } ,
      {
        "atomCount" : 10 ,
        "depth" : 5 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/cbe31c9a-d2d0-48f4-a8e5-599fdd123064" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/0049eba5-6e57-4c32-b923-37ce78bc5834/structure/12d8d3c0-b30a-4ccc-a733-958dd495af7d" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/0049eba5-6e57-4c32-b923-37ce78bc5834/structure/12d8d3c0-b30a-4ccc-a733-958dd495af7d" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/cbe31c9a-d2d0-48f4-a8e5-599fdd123064?image=svg" ,
        "imageSize" : 526 ,
        "name" : "4-Chloroacetophenone" ,
        "proposed" : [ ] ,
        "smiles" : "CC(=O)C1=CC=C(C=C1)Cl"
      } ,
      {
        "atomCount" : 21 ,
        "depth" : 2 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/515f06b4-348e-4b72-9959-d684bbaabcc1" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/5f8ed779-d815-4e8d-92c9-85283e466fd7/structure/f2bd2e43-8026-4db2-9735-735b0636e612" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/5f8ed779-d815-4e8d-92c9-85283e466fd7/structure/f2bd2e43-8026-4db2-9735-735b0636e612" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/515f06b4-348e-4b72-9959-d684bbaabcc1?image=svg" ,
        "imageSize" : 753 ,
        "name" : "2,3-Dihydroxy DDT" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(C2=CC=C(C(=C2O)O)Cl)C(Cl)(Cl)Cl"
      } ,
      {
        "atomCount" : 14 ,
        "depth" : 4 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/ef6d57db-f3aa-45e8-9b9b-592b3220121e" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/ada1d265-153c-467f-8d07-47908b1c574a/structure/99874945-e704-4e38-a6d9-0f344dd0ca3f" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/ada1d265-153c-467f-8d07-47908b1c574a/structure/99874945-e704-4e38-a6d9-0f344dd0ca3f" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/ef6d57db-f3aa-45e8-9b9b-592b3220121e?image=svg" ,
        "imageSize" : 603 ,
        "name" : "2-(4`-Chlorophenyl)-3,3-dichloropropenoate" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)C(=C(Cl)Cl)C(=O)[O-]"
      } ,
      {
        "atomCount" : 11 ,
        "depth" : 5 ,
        "dt50s" : [ ] ,
        "engineeredIntermediate" : false ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/4b90c6a1-4e3f-43f9-97f8-21e0e1a4bfac" ,
        "idcomp" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/127fe34e-af40-4ba4-bf1b-e20bf560a879/structure/a5335e8f-6377-4919-939f-16a44f32a13b" ,
        "idreact" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/compound/127fe34e-af40-4ba4-bf1b-e20bf560a879/structure/a5335e8f-6377-4919-939f-16a44f32a13b" ,
        "image" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/node/4b90c6a1-4e3f-43f9-97f8-21e0e1a4bfac?image=svg" ,
        "imageSize" : 603 ,
        "name" : "4-Chlorophenylacetate" ,
        "proposed" : [ ] ,
        "smiles" : "C1=C(C=CC(=C1)Cl)CC(=O)[O-]"
      } ,
      {
        "depth" : -1 ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/6c20062c-5239-41ff-af4f-646f7f98c1c4" ,
        "name" : "Eawag BBD reaction r0444" ,
        "pseudo" : "left"
      } ,
      {
        "depth" : -1 ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/a773904c-fde0-40b1-85da-149dd1e36601" ,
        "name" : "Eawag BBD reaction r0454" ,
        "pseudo" : "left"
      } ,
      {
        "depth" : -1 ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/7eb884e4-5bb0-4ee1-88d7-3c344f7c4329" ,
        "name" : "Eawag BBD reaction r0446" ,
        "pseudo" : "left"
      } ,
      {
        "depth" : -1 ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/7786bdf9-9986-44c7-a5de-9b0875efa2be" ,
        "name" : "Eawag BBD reaction r0453" ,
        "pseudo" : "left"
      } ,
      {
        "depth" : -1 ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/8a9e85eb-4c7c-47c3-993b-4225e8ef2815" ,
        "name" : "Eawag BBD reaction r0445" ,
        "pseudo" : "left"
      } ,
      {
        "depth" : -1 ,
        "id" : "https://envipath.org/package/32de3cf4-e3e6-4168-956e-32fa5ddb0ce1/pathway/3f58e4d4-1c63-4b30-bf31-7ae4b98899fe/edge/52a90af9-5c2b-48cd-9d22-c332d927ab6b" ,
        "name" : "Eawag BBD reaction r0441" ,
        "pseudo" : "left"
      }
    ] ,
  "pathwayName" : "1,1,1-Trichloro-2,2-bis-(4`-chlorophenyl)ethane (DDT)" ,
  "reviewStatus" : "reviewed" ,
  "scenarios" : [ ] ,
  "upToDate" : true
}


data = {{ pathway.d3_json | safe }};


// Colors
var lightGrey = "#E8E8E8";
var grey = "#B2B2B2";

var border = "thin solid lightgrey";
var compoundImageMargin = 0.15;  // compounds images are rectangles, reduce size to fit into nodes
var treeLayoutCharge = -1000; // compounds push each other apart

var ADView = false;
var compoundStroke = "black";
var compoundStrokeRoot = "red";
var showCompoundOutlines = false;
var compoundSize = 75; // = diameter of nodes of small compounds
var maxCompoundSize = function(){ return 1.5 * compoundSize }; // limit increased size of larger compounds
var maxCompoundPopupSize = function(){ return 5 * compoundSize };
var compoundFill = lightGrey;
var compoundFillSelected = grey;
var compoundStrokeWidth = function(){ return 0.04 * compoundSize };

var outsideAD = "#ff9999";
var insideAD = "#007000";

var width = document.getElementById("viz").offsetWidth;
var height = width * 0.75;


function redraw() {
    svg.attr("transform", "translate(" + d3.event.translate + ")" + " scale(" + d3.event.scale + ")");
}


function dragstart(d, i) {
<!--    pop_hideall();-->
    d3.event.sourceEvent.stopPropagation();
    force.stop();
}

function dragmove(d, i) {
    d3.event.sourceEvent.stopPropagation();
    d.px += d3.event.dx;
    d.py += d3.event.dy;
    d.x += d3.event.dx;
    d.y += d3.event.dy;
    tick();
}

function dragend(d, i) {
<!--    pop_show();-->
    d3.event.sourceEvent.stopPropagation();
    d.fixed = true;
    tick();
    force.resume();
}


function computeNodeSizes(nodes) {

    // step1: determine size of smallest compound
    min_size = 1000000;
    for (var i = 0; i < nodes.length; i++) {
        if (!nodes[i].pseudo) {
            s = nodes[i].imageSize;
            if (s < min_size) {
                min_size = s;
            }
        }
    }

    // step2: compute scaled size and store as .size
    for (var i = 0; i < nodes.length; i++) {
        if (!nodes[i].pseudo) {
            size = nodes[i].imageSize;
            r = size/min_size;
            size = r * compoundSize;
            nodes[i].size = Math.min(size,maxCompoundSize());
            nodes[i].popupSize = Math.min(size,maxCompoundPopupSize());
        }
    }
}


function setTreePositions(nodes) {
  // positions for tree layout
  // y: set node at treeLevel
  // x: equally distriute according to number of nodes per level (for non-pseudo nodes)
  for (var level in treeLayout) {
    xStart = (width * 0.5) - (treeLayoutXInitMargin() * (treeLayout[level].length-1) * 0.5)
    treeLayout[level].forEach(function (node,j) {
      if (!node.pseudo) {
        x = xStart + j * treeLayoutXInitMargin();
        node.x = x;
        node.px = x;
      }
      y = treeLayoutLevels()*node.treeLevel + compoundSize;
      node.y = y;
      node.py = y;
    });
  }

  // update x for pseudo nodes: set in between parents and children
  for (var level in treeLayout) {
    treeLayout[level].forEach(function (node,j) {
      if (node.pseudo) {
        sumX = 0;
        countX = 0;
        (node.parents.concat(node.children)).forEach(function (n,j) {
          if (!n.pseudo) {
            sumX += n.x;
            countX += 1;
          }
        });
        x = sumX/countX;
        node.x = x;
        node.px = x;
      }
    });
  }
}

    function tick() {

        nodes.attr("transform", function(d) {
            return "translate(" + d.x + "," + d.y + ")";
        });
    }

function drawGraph(pathway) {
    // In case its called another time
    d3.select("svg").remove();

    // Gen SVG
     svg = d3.select("#viz")
                .append("svg")
                .attr("width", "100%")
                .attr("height", height)
                .style("border", border)
                .attr("inline", "block")
                .attr("margin", "auto")
                .attr("pointer-events",    "all")
                .append('svg:g')
                .call(d3.behavior.zoom().on("zoom", redraw))
                .attr("preserveAspectRatio", "xMidYMid meet")
                .append('svg:g');

    force = d3.layout.force()
            .charge(0) //.charge(treeLayoutCharge)
            .gravity(0)
            .size([width, height]);
    force.nodes(pathway.nodes)
    .links(pathway.links)
    .start();


     // Background rectangle to enable zoom
     svg.append('svg:rect')
                .attr('width', 9 * width)
                .attr('height', 9 * height)
                .attr('fill', 'grey')
                .attr("x", -4 * width)
                .attr("y", -4 * height)
                .attr("opacity", 1.0);


      computeNodeSizes(pathway.nodes);


   var node_drag = d3.behavior.drag()
                      .on("dragstart", dragstart)
                      .on("drag", dragmove)
                      .on("dragend", dragend);

    nodes = svg.selectAll(".node")
                .data(pathway.nodes)
                .enter()
                .append("g")
                .attr("class", "node")
                .call(node_drag);




<!--        setTreeLevel(graph)-->
<!--        var treeLayout = buildTreeLayout(graph)-->




    circles = nodes.append("circle")
                .attr("class", "circle")
                .attr("cx", 0)
                .attr("cy", 0)
                .attr("depth", function(d) {
                                  return d.depth;
                })
                .attr("r", function(d) {
                              if (!d.pseudo) {
                                  return d.size * 0.5;
                              } else {
                                  return 0;
                              }
                })
                .style("stroke", function(d) {
        if(ADView) {
            if(d.ad){
                if(d.ad['inAD']) {
                    return adIn;
                } else {
                    return adOut;
                }
            }
            return "black";
        } else if (d.depth == 0) {
            return compoundStrokeRoot;
        } else {
            return compoundStroke;
        }
    }).style("stroke-opacity",function(d) {
        if(ADView) {
            return 1;
        } else if (showCompoundOutlines) {
            return compoundStrokeOpacity(d);
        } else {
            return 0.0;
        }
    })
    .style("stroke-width", function(d) {
        if (!d.pseudo) {
            return compoundStrokeWidth() + "px";
        } else {
            return 0;
        }
    })
    .style("fill", function(d) {
        if(d.engineeredIntermediate) {
            return "#dcfcf9"
        }else {
            return compoundFill
        }

    })
    .style("fill-opacity", function(d) {
        if (!d.pseudo) {
            return "1";
        } else {
            return "0.0";
        }
    });

     nodes.append("inAD").attr("inAD", function(d){
        if (!d.pseudo) {
            if(d.ad) {
                return d.ad['inAD'];
            } else {
                return false;
            }
        } else {
            return;
        }
    });

    nodes.append("image").attr("xlink:href", function(d) {
        if (!d.pseudo) {
            if(ADView) {
                return d.image += "&highlight=true";
            }
            return d.image;
        } else {
            return;
        }
    }).attr("x", function(d) {
        if (!d.pseudo) {
            return -0.5*(1.0-compoundImageMargin)*d.size
        }
        else {
            return 0;
        }
    }).attr("y", function(d) {
        if (!d.pseudo) {
            return -0.5*(1.0-compoundImageMargin)*d.size
        }
        else {
            return 0;
        }
    }).on("click",
            function(d) {
                if (!d.pseudo) {
                    console.log("Node clicked: " + d);
                    return;
                } else {
                    return;
                }
            }).attr("width", function(d) {
        if (!d.pseudo) {
            return d.size * (1.0-compoundImageMargin);
        } else {
            return 0;
        }
    }).attr("height", function(d) {
        if (!d.pseudo) {
            return d.size * (1.0-compoundImageMargin);
        } else {
            return 0;
        }
    });

    // call initial tick()
    tick()

}

drawGraph(data);
</script>
{# prettier-ignore-end #}
</html>
