2c2 < // twopi_vs_circo_example.php --- > // venn_diagram_basis.php 5c5 < // Trying out Dot GraphViz package ... thanks to https://stackoverflow.com/questions/72531363/how-to-create-a-graph-with-a-circular-layout-in-graphviz --- > // Trying out Dot GraphViz package ... thanks to https://forum.graphviz.org/t/subset-diagrams/1118/4 9c9 < $verb='twopi '; // python --- > $verb='neato -n '; // python 12c12 < $codeafters=' > ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . 'my-twopi-vs-circo.gv.' . $fmt . ' '; --- > $codeafters=' > ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . 'my-venn-diagram.gv.' . $fmt . ' '; 16,57c16,25 < $abl=['my_twopi_vs_circo','YoumightfindmeOne','YoumightfindmeTwo','YoumightfindmeThree,YoumightfindmeZeroThree']; < $abl=['my_twopi_vs_circo',"digraph g1 { < //layout=\"circo\"; < layout=\"twopi\"; < ranksep=3 // set radius, in inches < < root=CENTER // establish the (invisible) center node < edge [style=invis] < CENTER [style=invis] < // set equidistance all nodes from CENTER < CENTER -> { < JB < ML < VS < AM < JR < EL < LL < ML < OO < TK < JJ < PL < VP < } < < // now the actual edges < edge [style=solid] < node [shape = circle]; < JB -> ML [label = \"1\"]; < JB -> VS [label = \"2\"]; < AM -> ML [label = \"2\"]; < AM -> VS [label = \"2\"]; < JR -> EL [label = \"2\"]; < JR -> VS [label = \"2\"]; < LL -> ML [label = \"1\"]; < LL -> VS [label = \"1\"]; < OO -> TK [label = \"2\"]; < JJ -> PL [label = \"1\"]; < VS -> JB [label = \"2\"]; < VS -> JR [label = \"2\"]; < VS -> VP [label = \"4\"]; --- > $abl=['my_venn_diagram','YoumightfindmeOne','YoumightfindmeTwo','YoumightfindmeThree,YoumightfindmeZeroThree']; > $abl=['my_venn_diagram',"graph V { > node [shape=circle fontsize=12] > // height & width in inches > // pos in points. marks the center > W [height=1 fillcolor=\"#90806090\" style=\"filled\" pos=\"144,144\"] > Y [height=1 fillcolor=\"#82927290\" style=\"filled\" pos=\"216,144\" label=\"\" xlabel=\"Y\" xlp=\"192,160\"] > X [height=.55 fillcolor=\"#74a48490\" style=\"filled\" pos=\"221,159\" label=\"\" xlabel=\"X\" xlp=\"232,160\"] > G [height=.55 fillcolor=\"#66b69690\" style=\"filled\" pos=\"209,136\" label=\"\" xlabel=\"G\" xlp=\"202,136\"] > mylabel1 [shape=plaintext pos=\"0,0\" label=\"\" xlabel=\"XG\" xlp=\"217,148\"] 59,99c27,35 < $newabl=['my-twopi-vs-circo',"digraph g1 { < //layout=\"circo\"; < layout=\"twopi\"; < ranksep=3 // set radius, in inches < < root=CENTER // establish the (invisible) center node < edge [style=invis] < CENTER [style=invis] < // set equidistance all nodes from CENTER < CENTER -> { < JB < ML < VS < AM < JR < EL < LL < ML < OO < TK < JJ < PL < VP < } < < // now the actual edges < edge [style=solid] < node [shape = circle]; < JB -> ML [label = \"1\"]; < JB -> VS [label = \"2\"]; < AM -> ML [label = \"2\"]; < AM -> VS [label = \"2\"]; < JR -> EL [label = \"2\"]; < JR -> VS [label = \"2\"]; < LL -> ML [label = \"1\"]; < LL -> VS [label = \"1\"]; < OO -> TK [label = \"2\"]; < JJ -> PL [label = \"1\"]; < VS -> JB [label = \"2\"]; < VS -> JR [label = \"2\"]; < VS -> VP [label = \"4\"]; --- > $newabl=['my-venn-diagram',"graph V { > node [shape=circle fontsize=12] > // height & width in inches > // pos in points. marks the center > W [height=1 fillcolor=\"#90806090\" style=\"filled\" pos=\"144,144\"] > Y [height=1 fillcolor=\"#82927290\" style=\"filled\" pos=\"216,144\" label=\"\" xlabel=\"Y\" xlp=\"192,160\"] > X [height=.55 fillcolor=\"#74a48490\" style=\"filled\" pos=\"221,159\" label=\"\" xlabel=\"X\" xlp=\"232,160\"] > G [height=.55 fillcolor=\"#66b69690\" style=\"filled\" pos=\"209,136\" label=\"\" xlabel=\"G\" xlp=\"202,136\"] > mylabel1 [shape=plaintext pos=\"0,0\" label=\"\" xlabel=\"XG\" xlp=\"217,148\"] 150c86 < echo "
"; --- > echo ""; 158c94 < echo ""; --- > echo ""; 455c391 < $codeafters=' > ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . 'my-twopi-vs-circo.gv.' . $fmt . ' '; --- > $codeafters=' > ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . 'my-venn-diagram.gv.' . $fmt . ' '; 507,508c443,444 < if (!file_exists('./twopi_vs_circo.' . strtoupper($codeext))) { < exec("/usr/bin/" . $verb . " " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "twopi_vs_circo.dot -Tsvg -o " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.svg"); --- > if (!file_exists('./venn_diagram.' . strtoupper($codeext))) { > exec("/usr/bin/" . $verb . " " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "venn_diagram.dot -Tsvg -o " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.svg"); 510,511c446,447 < //exec("cat " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "twopi_vs_circo.dot | sed '/\\(\\\"\\)\\([^\\\"]*\)\\\" \\[color = /s//\\\"\\2\\\" \\[url = \\\"https\\:\\/\\/www.google.com\\/search\\?udm=2\\&sa=X\\&biw=1433\\&bih=739\\&dpr=2\\&q=\\2\\\"\\, color = /g' > " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "twopi_vs_circo.DOT"); < $pycont=file_get_contents('./twopi_vs_circo.' . $codeext); --- > //exec("cat " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "venn_diagram.dot | sed '/\\(\\\"\\)\\([^\\\"]*\)\\\" \\[color = /s//\\\"\\2\\\" \\[url = \\\"https\\:\\/\\/www.google.com\\/search\\?udm=2\\&sa=X\\&biw=1433\\&bih=739\\&dpr=2\\&q=\\2\\\"\\, color = /g' > " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "venn_diagram.DOT"); > $pycont=file_get_contents('./venn_diagram.' . $codeext); 533c469 < file_put_contents('./twopi_vs_circo.' . strtoupper($codeext), $pycont); --- > file_put_contents('./venn_diagram.' . strtoupper($codeext), $pycont); 535,536c471,472 < if (file_exists('./twopi_vs_circo.' . strtoupper($codeext))) { < $pycont=file_get_contents('./twopi_vs_circo.' . strtoupper($codeext)); --- > if (file_exists('./venn_diagram.' . strtoupper($codeext))) { > $pycont=file_get_contents('./venn_diagram.' . strtoupper($codeext)); 546c482 < exec($prefstuff . "/usr/bin/" . $verb . " " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "twopi_vs_circo.DOT -Tpng -o " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.png -Tcmapx -o " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.map"); --- > exec($prefstuff . "/usr/bin/" . $verb . " " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "venn_diagram.DOT -Tpng -o " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.png -Tcmapx -o " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.map"); 548c484 < $pycont=file_get_contents('./twopi_vs_circo.' . $codeext); --- > $pycont=file_get_contents('./venn_diagram.' . $codeext); 555c491 < $pycont=str_replace("My Circular Layout", trim($newt), $pycont); --- > $pycont=str_replace("My Venn Diagram", trim($newt), $pycont); 641c577 < $pycont=str_replace("My Circular Layout", trim($newt), $pycont); --- > $pycont=str_replace("My Venn Diagram", trim($newt), $pycont); 653,661c589,597 < file_put_contents($tprefix . 'twopi_vs_circo_' . $suffix . '.' . $codeext, $pycont); < file_put_contents($prefix . 'twopi_vs_circo0_' . $suffix . '.' . $codeext, $pycont); < //file_put_contents($prefix . 'twopi_vs_circo_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $prefix . "twopi_vs_circo_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "twopi_vs_circo.bad \nln -s " . $prefix . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf \nrm -f " . $prefix . "twopi_vs_circo_" . $suffix . "." . $codeext . $codeafters . " \nrm -f " . $prefix . "twopi_vs_circo_" . $suffix . ".ksh \nexit"); < file_put_contents($prefix . 'twopi_vs_circo_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "twopi_vs_circo_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "twopi_vs_circo.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "twopi_vs_circo_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "twopi_vs_circo.bad \n\nrm -f " . $tprefix . "twopi_vs_circo_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "twopi_vs_circo_" . $suffix . ".ksh \nexit"); < file_put_contents($prefix . 'twopi_vs_circo0_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "twopi_vs_circo_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "twopi_vs_circo.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "twopi_vs_circo_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "twopi_vs_circo.bad \n\nrm -f " . $tprefix . "twopi_vs_circo_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "twopi_vs_circo_" . $suffix . ".ksh \nexit"); < exec('chmod 777 ' . $prefix . 'twopi_vs_circo_' . $suffix . '.ksh'); < exec('chown root ' . $prefix . 'twopi_vs_circo_' . $suffix . '.ksh'); < exec('chgrp root ' . $prefix . 'twopi_vs_circo_' . $suffix . '.ksh'); < while (file_exists($prefix . 'twopi_vs_circo_' . $suffix . '.ksh')) { --- > file_put_contents($tprefix . 'venn_diagram_' . $suffix . '.' . $codeext, $pycont); > file_put_contents($prefix . 'venn_diagram0_' . $suffix . '.' . $codeext, $pycont); > //file_put_contents($prefix . 'venn_diagram_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $prefix . "venn_diagram_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "venn_diagram.bad \nln -s " . $prefix . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . ".gv.pdf \nrm -f " . $prefix . "venn_diagram_" . $suffix . "." . $codeext . $codeafters . " \nrm -f " . $prefix . "venn_diagram_" . $suffix . ".ksh \nexit"); > file_put_contents($prefix . 'venn_diagram_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "venn_diagram_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "venn_diagram.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "venn_diagram_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "venn_diagram.bad \n\nrm -f " . $tprefix . "venn_diagram_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "venn_diagram_" . $suffix . ".ksh \nexit"); > file_put_contents($prefix . 'venn_diagram0_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "venn_diagram_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "venn_diagram.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "venn_diagram_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "venn_diagram.bad \n\nrm -f " . $tprefix . "venn_diagram_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "venn_diagram_" . $suffix . ".ksh \nexit"); > exec('chmod 777 ' . $prefix . 'venn_diagram_' . $suffix . '.ksh'); > exec('chown root ' . $prefix . 'venn_diagram_' . $suffix . '.ksh'); > exec('chgrp root ' . $prefix . 'venn_diagram_' . $suffix . '.ksh'); > while (file_exists($prefix . 'venn_diagram_' . $suffix . '.ksh')) { 665,668c601,604 < file_put_contents('/tmp/twopi_vs_circo.' . $codeext, $pycont); < exec('chmod 777 ' . '/tmp/twopi_vs_circo.' . $codeext); < exec('chown rjmprogr ' .'/tmp/twopi_vs_circo.' . $codeext); < exec('chgrp rjmprogr ' . '/tmp/twopi_vs_circo.' . $codeext); --- > file_put_contents('/tmp/venn_diagram.' . $codeext, $pycont); > exec('chmod 777 ' . '/tmp/venn_diagram.' . $codeext); > exec('chown rjmprogr ' .'/tmp/venn_diagram.' . $codeext); > exec('chgrp rjmprogr ' . '/tmp/venn_diagram.' . $codeext); 675,676c611,612 < //file_put_contents('x.x', '/usr/bin/' .$verb . $switch . '/tmp/twopi_vs_circo.' . $codeext . $codeafters . ' 2> twopi_vs_circo.bad'); < exec('/usr/bin/' .$verb . $switch . '/tmp/twopi_vs_circo.' . $codeext . $codeafters . ' 2> twopi_vs_circo.bad'); --- > //file_put_contents('x.x', '/usr/bin/' .$verb . $switch . '/tmp/venn_diagram.' . $codeext . $codeafters . ' 2> venn_diagram.bad'); > exec('/usr/bin/' .$verb . $switch . '/tmp/venn_diagram.' . $codeext . $codeafters . ' 2> venn_diagram.bad'); 683,684c619,620 < //file_put_contents('xx.xx', '/usr/bin/' . $verb . $switch . ' twopi_vs_circo.' . $codeext . $codeafters); < exec('/usr/bin/' . $verb . $switch . ' twopi_vs_circo.' . $codeext . $codeafters); --- > //file_put_contents('xx.xx', '/usr/bin/' . $verb . $switch . ' venn_diagram.' . $codeext . $codeafters); > exec('/usr/bin/' . $verb . $switch . ' venn_diagram.' . $codeext . $codeafters); 697c633 <