colour_wheel.DOT // cat colour_wheel.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' > colour_wheel.DOT // cat colour_wheel.dot | sed '/\(\"\)\([^"]*\)\" \[color = /s//\"\2\" \[url = \"https\:\/\/www.google.com\/search\?sca_esv=8957a51bd870705f&sxsrf=ADLYWIL9Z95Y2XILCVHy1Ep_vA8UA0HVLw:1728014294038\&udm=2\&fbs=AEQNm0CrHVBV9axs7YmgJiq-TjYcvrKLYvLdNLLD2b8MCfaxte6rE3yH_shvJRqV-Iqr8JJvO9luGxMyf8tABHRE_ER5WVi_ouuYD0ZGCgonp8RpBmOUpTB-X6dVFbJc8KMdvjlHxs0_OJiYCY4-Y60oHTMiC_1a9mkGkMIYHO4XqP68ipa4P5rJaQCtA4WPne6f0aAKhdyAMTPbTsWJEdFYpNvI5RzOgw\&sa=X\&ved=2ahUKEwjCwabx6vOIAxWJ7DQHHQIOJBoQtKgLegQIDRAB\&biw=1433\&bih=739\&dpr=2\&q=\2\"\, color = /g' > colour_wheel.DOT $txprefix=$_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR; foreach ( $_GET as $key => $value ) { $_POST[$key] = $value; } $outel='iframe'; $fmt='svg'; $verb='dot'; // python $codeext='dot'; // 'py'; $switch=' -T' . str_replace('html','cmapx',$fmt) . ' '; $codeafters=' > ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . 'my-colour-wheel.gv.' . $fmt . ' '; $tw=''; $abl=['my_colour_wheel','YoumightfindmeOne','YoumightfindmeTwo','YoumightfindmeThree,YoumightfindmeZeroThree']; $abl=['my_colour_wheel','YoumightfindmeOne=YounowfindmeOne','YoumightfindmeTwo=YounowfindmeTwo','YoumightfindmeThree=YounowfindmeThree,YoumightfindmeZeroThree=YounowfindmeZeroThree']; $newabl=['my-colour-wheel','YoumightfindmeOne=YounowfindmeOne','YoumightfindmeTwo=YounowfindmeTwo','YoumightfindmeThree=YounowfindmeThree,YoumightfindmeZeroThree=YounowfindmeZeroThree']; $tprefix=$txprefix; //'/tmp/'; $prefix=''; $suffix=''; $plus='-'; $minus='-'; $plus='-'; $minus='-'; $yes='n'; $mode='Graph'; $shape=''; $fsize=''; $bcol='lightblue2'; $bbcol='#aed8e8'; $newt=''; $newablzero='My%20Colour%20Wheel'; $outfn=''; $gv='.gv.'; $none='none'; $addimg=''; $suffile=''; if (isset($_POST['newablzero']) && isset($_POST['infile'])) { $sg=''; $infis=str_replace('+',' ',urldecode($_POST['infile'])); if (file_exists($infis)) { if (strpos($infis, 'doctest-output') !== false) { $suffile='/doctest-output' . explode('doctest-output', $infis)[1]; if (strlen($_POST['newablzero']) > 0) { //file_put_contents('x1.x1', '' . strlen($_POST['newablzero'])); $excont=file_get_contents($infis); //file_put_contents('x11.x11', '' . strlen($excont)); if (strpos($excont, '') !== false) { if (strpos($excont, '') !== false) { $sgs=explode('', $excont); $sg='' . $sgs[-1 + sizeof($sgs)]; } //file_put_contents('x111.x111', '' . strlen($excont)); $newcont=plusdata(str_replace('+',' ',urldecode($_POST['newablzero']))); //file_put_contents('x1111.x1111', '' . strlen($newcont)); if (strpos($excont, $newcont) === false) { //file_put_contents('x11111.x11111', '' . strlen($newcont)); $newercont=str_replace($sg, $newcont . $sg, $excont); //file_put_contents('x111111.x111111', '' . strlen($newercont)); $outfis=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('doctestoutput','doctest-output',str_replace('-','',$infis)); file_put_contents($outfis, $newercont); //file_put_contents('x1111112.x1111112', '' . strlen($newercont) . ' vs ' . $outfis . ' ' . strlen(file_get_contents($outfis))); echo ""; exit; } } } else { $excont=file_get_contents($infis); $outfis=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . str_replace('doctestoutput','doctest-output',str_replace('-','',$infis)); file_put_contents($outfis, $excont); echo ""; exit; } } } exit; } function plusdata($aig) { $outig=$aig; $dlm='"'; $outgs=explode('data:', $aig); if (sizeof($outgs) > 1) { $outig=$outgs[0]; $dlm=substr($outig,-1,1); for ($iop=1; $iop" . str_replace(""); } if ($retv && strpos($infn, '.svg') !== false && 1 == 2) { exec('chmod 777 ' . $infn); exec('chown rjmprogr ' . $infn); exec('chgrp rjmprogr ' . $infn); $retc=file_get_contents($infn); $gv='.GV.'; $outfn=str_replace('.gv.','.GV.',$infn); file_put_contents($outfn, str_replace('Box "); $pyprefix=''; $pymidbit=''; $pysuffix=''; function server_remote_addr() { $rma = $_SERVER['REMOTE_ADDR']; return str_replace('.','_',$rma); } if (!isset($_POST['one']) && !isset($_POST['two']) && !isset($_POST['three']) && !isset($_POST['original'])) { $yes='y'; $newabl[1]=''; $newabl[2]=''; $newabl[3]=''; $_POST['one']=$newabl[1]; $_POST['two']=$newabl[2]; $_POST['three']=$newabl[3]; } else { $none='inline-block'; $plus='+'; $minus='-'; } if (strpos($newabl[0], 'heel') !== false) { $parts=explode('-',str_replace('_','-',$newabl[0])); $newt=''; for ($iy=0; $iy " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "colour_wheel.DOT"); $pycont=file_get_contents('./colour_wheel.' . $codeext); $bits=explode('" [color = ', $pycont); for ($iy=(-1 + sizeof($bits)); $iy>=1; $iy--) { $thislab=explode('"', $bits[-1 + $iy])[-1 + sizeof(explode('"', $bits[-1 + $iy]))]; if (strpos($svghelp, '>' . $thislab . '') !== false) { $pycont=str_replace('"' . $thislab . '" [color = ', '"' . $thislab . '" [URL = "https://www.google.com/search?udm=2&sa=X&biw=1433&bih=739&dpr=2&q=' . urlencode($thislab) . str_replace('##','#','#' . urlencode(explode('"', explode(' fill="', explode('>' . $thislab . '', $svghelp)[1])[1])[0])) . '" color = ', $pycont); } else { $pycont=str_replace('"' . $thislab . '" [color = ', '"' . $thislab . '" [URL = "https://www.google.com/search?udm=2&sa=X&biw=1433&bih=739&dpr=2&q=' . urlencode($thislab) . '" color = ', $pycont); } $bits=explode('" [color = ', $pycont); } $bits=explode(' [fillcolor = ', str_replace("\t"," ",$pycont)); for ($iy=(-1 + sizeof($bits)); $iy>=1; $iy--) { $thislab=explode(' ', $bits[-1 + $iy])[-1 + sizeof(explode(' ', $bits[-1 + $iy]))]; if (strpos($svghelp, '>' . $thislab . '') !== false) { $pycont=str_replace('' . $thislab . ' [fillcolor = ', '' . $thislab . ' [URL = "https://www.google.com/search?udm=2&sa=X&biw=1433&bih=739&dpr=2&q=' . urlencode($thislab) . str_replace('##','#','#' . urlencode(explode('"', explode(' fill="', explode('>' . $thislab . '', $svghelp)[1])[1])[0])) . '" fillcolor = ', $pycont); } else { $pycont=str_replace('' . $thislab . ' [fillcolor = ', '' . $thislab . ' [URL = "https://www.google.com/search?udm=2&sa=X&biw=1433&bih=739&dpr=2&q=' . urlencode($thislab) . '" fillcolor = ', $pycont); } $bits=explode(' [fillcolor = ', str_replace("\t"," ",$pycont)); } file_put_contents('./colour_wheel.' . strtoupper($codeext), $pycont); } if (file_exists('./colour_wheel.' . strtoupper($codeext))) { $pycont=file_get_contents('./colour_wheel.' . strtoupper($codeext)); } $prefstuff=''; if (file_exists('doctest-output/d.png')) { $prefstuff.="rm -f " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.png ; "; } if (file_exists('doctest-output/d.map')) { $prefstuff.="rm -f " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "doctest-output" . DIRECTORY_SEPARATOR . "d.map ; "; } exec($prefstuff . "/usr/bin/dot " . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "colour_wheel.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"); } else { $pycont=file_get_contents('./colour_wheel.' . $codeext); } if (trim($newt) != '') { $newablzero=str_replace('+','%20',urlencode(trim($newt))); $pycont=str_replace("My Colour Wheel", trim($newt), $pycont); } if (strpos($pycont, 'u=u') !== false) { $pyprefix=explode('u.edge(', $pycont)[0]; $pysuffix='' . explode('u=u', $pycont)[1]; //$pysuffix='' . explode('u.view()', $pycont)[1]; $pycont=$pyprefix . "\n\n" . $pysuffix; } else if (strpos($pycont, 'u.view()') !== false) { $pyprefix=explode('u.edge(', $pycont)[0]; $pysuffix='u.view()' . explode('u.view()', $pycont)[1]; //$pysuffix='' . explode('u.view()', $pycont)[1]; $pycont=$pyprefix . "\n\n" . $pysuffix; } if ($bcol != 'lightblue2' && trim($bcol) != '') { $pycont=str_replace('lightblue2', $bcol, $pycont); } if ($shape != '') { $pycont=str_replace("shape = circle", "shape = " . $shape . "", $pycont); } if ($fsize != '') { $pycont=str_replace("fontsize = 10]", "fontsize = " . (explode(',',$fsize)[0] == '' ? '10' : explode(',',$fsize)[0]) . "]", $pycont); if (strpos($fsize, ',') !== false) { $pycont=str_replace("fontsize = 20]", "fontsize = " . (explode(',',$fsize)[1] == '' ? '20' : explode(',',$fsize)[1]) . "]", $pycont); } } //$xone=str_replace("\t","+", str_replace('~','', str_replace('+',' ',str_replace('+|','`|',str_replace('+;','`;',str_replace('+;','`;',str_replace('+,','`,',urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['one'])) . urlencode('~'))) ))) ))); //$xtwo=str_replace("\t","+", str_replace('~','', str_replace('+',' ',str_replace('+|','`|',str_replace('+;','`;',str_replace('+;','`;',str_replace('+,','`,',urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['two'])) . urlencode('~'))) ))) ))); //$xthree=str_replace("\t","+", str_replace('~','', str_replace('+',' ',str_replace('+|','`|',str_replace('+;','`;',str_replace('+;','`;',str_replace('+,','`,',urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['three'])) . urlencode('~'))) ))) ))); //$xone=str_replace("\t","+", str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['one'])))))); //$xtwo=str_replace("\t","+", str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['two'])))))); //$xthree=str_replace("\t","+", str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['three'])))))); $xone=str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['one']))))); $xtwo=str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['two']))))); $xthree=str_replace('+',' ',(urldecode( str_replace("%2b","%0b",str_replace("%2B","%0b",$_POST['three']))))); if (strpos($xone, ',') !== false) { $xsone=explode(',', $xone); for ($iij=0; $iij> " . $prefix . "colour_wheel.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 . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " \nrm -f " . $prefix . "colour_wheel_" . $suffix . ".ksh \nexit"); file_put_contents($prefix . 'colour_wheel_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \n\nrm -f " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "colour_wheel_" . $suffix . ".ksh \nexit"); //file_put_contents($prefix . 'colour_wheel0_' . $suffix . '.ksh', "#!/bin/ksh\n/usr/bin/" . $verb . $switch . " " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \nsleep 5\n\n/usr/bin/" .$verb . $switch . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . $codeafters . " 2>> " . $prefix . "colour_wheel.bad \n\nrm -f " . $tprefix . "colour_wheel_" . $suffix . "." . $codeext . " \nrm -f " . $prefix . "colour_wheel_" . $suffix . ".ksh \nexit"); exec('chmod 777 ' . $prefix . 'colour_wheel_' . $suffix . '.ksh'); exec('ksh ' . $prefix . 'colour_wheel_' . $suffix . '.ksh'); exec('chown root ' . $prefix . 'colour_wheel_' . $suffix . '.ksh'); exec('chgrp root ' . $prefix . 'colour_wheel_' . $suffix . '.ksh'); while (file_exists($prefix . 'colour_wheel_' . $suffix . '.ksh')) { sleep(10); } } else { file_put_contents($txprefix . 'colour_wheel.' . $codeext, $pycont); exec('chmod 777 ' . $txprefix . 'colour_wheel.' . $codeext); exec('chown rjmprogr ' . $txprefix . 'colour_wheel.' . $codeext); exec('chgrp rjmprogr ' . $txprefix . 'colour_wheel.' . $codeext); //if (file_exists('doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt)) { //exec('rm -f ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt); //exec('rm -f ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv'); //unlink('doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt); //unlink('doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv'); //} //file_put_contents('x.x', '/usr/bin/' .$verb . $switch . $txprefix . 'colour_wheel.' . $codeext . $codeafters . ' 2> colour_wheel.bad'); exec('/usr/bin/' .$verb . $switch . $txprefix . 'colour_wheel.' . $codeext . $codeafters . ' 2> colour_wheel.bad'); sleep(8); //if (file_exists($prefix . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.pdf')) { //exec('ln -s ' . $prefix . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.pdf ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.pdf'); //} } } else { //file_put_contents('xx.xx', '/usr/bin/' . $verb . $switch . ' colour_wheel.' . $codeext . $codeafters); exec('/usr/bin/' . $verb . $switch . ' colour_wheel.' . $codeext . $codeafters); sleep(8); } if (ourfile_exists($prefix . 'doctest-output' . DIRECTORY_SEPARATOR . $newabl[0] . '.gv.' . $fmt)) { exec('chmod 777 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt); exec('chmod 777 ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv'); exec('chown rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt); exec('chown rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv'); exec('chgrp rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt); exec('chgrp rjmprogr ' . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $newabl[0] . '.gv'); echo " Trying out Dot GraphViz hosted in PHP - RJM Programming - October, 2024 - Colour Wheel var lasturl='', lasttext=null, gzero=null, lastx=0, lasty=0, lastw=0, lasth=0, lastp='', lastwoo=null, lastj=0, lssel='', zerodotsix='0.6', bconto=null, lastiurl='', szero=null, aimg='', lastimgc='', lastsvggeo=null, uselast=false; String.prototype.toHtmlEntities = function() { return this.replace(/./gm, function(s) { return (s.match(/[a-z0-9\s]+/i)) ? s : '&#' + s.charCodeAt(0) + ';'; }); }; function plusdata(aig) { var outig=aig, dlm='\"'; var outgs=aig.split('data:'); if (eval('' + outgs.length) > 1) { outig=outgs[0]; dlm=outig.slice(-1); for (var iop=1; iop') != -1) { toe=prompt('Please enter email address or SMS number to share ' + document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','') + ' with.', ''); } else { toe=prompt('Please enter email address or SMS number to share with.', ''); } if (toe == null) { toe=''; } if (toe.indexOf('@') != -1) { if (document.getElementById('sells').innerHTML.indexOf(inu + '\">') != -1) { document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent(document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','')) + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output')); document.getElementById('myaemailsms').click(); } else { document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent('Colour Wheel') + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output')); document.getElementById('myaemailsms').click(); } } else if (toe.trim() != '') { if (toe.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') { document.getElementById('myaemailsms').href='sms:' + toe.trim() + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output')); document.getElementById('myaemailsms').click(); } } document.getElementById('sells').value=''; } else if (inu.indexOf('HTTP') == 0) { //alert('2:' + inu); if (inu.indexOf('#saved_colour_wheel_') != -1) { //alert('22:' + inu.split('#')[eval(-1 + inu.split('#').length)]); deleteAVal(inu.split('#')[eval(-1 + inu.split('#').length)], encodeURIComponent(inu.replace('#' + inu.split('#')[eval(-1 + inu.split('#').length)], '').replace('HTTP','http'))); //alert('222:' + inu.split('#')[eval(-1 + inu.split('#').length)]); cookieAVal('saved_colour_wheel_', true); //alert('2222:' + inu.split('#')[eval(-1 + inu.split('#').length)]); } } else { //woo=window.open(inu, '_blank', 'top=50,left=50,width=800,height=800'); woo=window.open(inu.replace(/\-/g,'').replace('doctestoutput','doctest-output').replace('http:','').replace('https:',''), '_blank', 'top=50,left=50,width=800,height=800'); } } } function rework(what) { var outw=what; if (what.toLowerCase().indexOf('doctest output ') != -1 && what.toLowerCase().indexOf('.gv.') != -1) { outw=what.toLowerCase().split('doctest output ')[1].split('.gv.')[0]; var outwds=outw.split(' '); outw=outwds[0].substring(0,1).toUpperCase() + (outwds[0] + ' ').substring(1).toLowerCase().trim(); for (var io=1; io', '' + '' + '' + ''); } } if (lssel != '') { document.getElementById('ssel').innerHTML=lssel.trim(); } } if (cName.indexOf('saved_colour_wheel_') == 0) { if (window.localStorage) { if (decodeURIComponent(('' + localStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') { return decodeURIComponent(localStorage.getItem(cName)); } if (decodeURIComponent(('' + sessionStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') { return decodeURIComponent(sessionStorage.getItem(cName)); } } return ''; } return ''; } function phv(tao) { if (tao.value == '') { tao.value=tao.placeholder; } } function various(indi) { var outdi=indi; return outdi; } function contentfix(inid) { document.getElementById('ititle').value=document.getElementById('ititle').value.replace(/\+/g,'-').replace(/\=/g,'-').replace(/\ /g,'-'); //document.getElementById('one').value=document.getElementById('one').value.replace(/\+/g,'`'); //document.getElementById('two').value=document.getElementById('two').value.replace(/\+/g,'`'); //document.getElementById('three').value=document.getElementById('three').value.replace(/\+/g,'`'); document.getElementById('none').value=various(document.getElementById('one').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('ntwo').value=various(document.getElementById('two').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('nthree').value=various(document.getElementById('three').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('mysub').style.border='3px dotted green'; return inid; } function emailit(inais) { event.stopPropagation(); var em=null; window.focus(); em=prompt('Please enter email address to send output ' + document.getElementById('fmt').value + ' URL link to. ', ''); if (em == null) { em=''; } if (em.indexOf('@') != -1) { document.getElementById('ititle').value=document.getElementById('ititle').value.replace(/\+/g,'-').replace(/\=/g,'-').replace(/\ /g,'-'); document.getElementById('none').value=various(document.getElementById('one').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('ntwo').value=various(document.getElementById('two').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('nthree').value=various(document.getElementById('three').value.replace(/\+/g,String.fromCharCode(9))); //alert(document.getElementById('addimg').value); em+='?subject=' + document.getElementById('newablzero').value + '&body=' + encodeURIComponent( (document.URL.split('?')[0].split('#')[0] + '?rand=' + Math.floor(Math.random() * 19897865) + '#title=' + encodeURIComponent(document.getElementById('ititle').value) + '#back=' + encodeURIComponent(document.getElementById('back').value.replace('#','')) + '#fsize=' + encodeURIComponent(document.getElementById('fsize').value) + '#shape=' + encodeURIComponent(document.getElementById('shape').value) + '#mode=' + encodeURIComponent(document.getElementById('mode').value) + '#fmt=' + encodeURIComponent(document.getElementById('fmt').value) + '#one=' + encodeURIComponent(document.getElementById('none').value) + '#two=' + encodeURIComponent(document.getElementById('ntwo').value) + '#three=' + encodeURIComponent(document.getElementById('nthree').value) + '#addimg=' + encodeURIComponent(document.getElementById('addimg').value)).replace('#fmt=svg#one=#','#fmt=pdf#one=#') ); document.getElementById('dimap').innerHTML=''; document.getElementById('theaemail').click(); } return false; } function svghost(svgheo, imgc) { if (9 == 8) { if (gzero) { gzero.innerHTML+=\"\"; } else { svgheo.innerHTML+=\"\"; } } } function animbord() { var bcolsare=['green','#F0F8FF','#F0FFFF','#F0F0E0','#F0FFF0','#FFFFF0','#FFF0E0','#FFFFE0','#F0FFF0','#FFFFFF','#F0F0F0','#F0F7FF','#FFF8F0','#FFF0F0','#E0FFFF','#FFFFE0']; document.getElementById('mysub').style.border='3px dotted ' + bcolsare[lastj]; lastj++; if (lastj >= eval('' + bcolsare.length)) { lastj=0; } setTimeout(animbord, 200); } function psvgit() { svgit(lastsvgeo, lastimgc); } function hsvtorgb(hsbh, hsbs, hsbb) { // thanks to https://stackoverflow.com/questions/17242144/javascript-convert-hsb-hsv-color-to-rgb-accurately var rgb = { }; var h = Math.round(hsbh * 255); var s = Math.round(hsb.s * 255 / 100); var v = Math.round(hsb.b * 255 / 100); if (s == 0) { rgb.r = rgb.g = rgb.b = v; } else { var t1 = v; var t2 = (255 - s) * v / 255; var t3 = (t1 - t2) * (h % 60) / 60; if (h == 360) h = 0; if (h < 60) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3 } else if (h < 120) { rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3 } else if (h < 180) { rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3 } else if (h < 240) { rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3 } else if (h < 300) { rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3 } else if (h < 360) { rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3 } else { rgb.r = 0; rgb.g = 0; rgb.b = 0 } } return 'rgb(' + Math.round(rgb.r) + ',' + Math.round(rgb.g) + ',' + Math.round(rgb.b) + ')'; } function svgit(svgeo, imgc) { var pres=''; lastsvgeo=svgeo; lastimgc=imgc; if (('' + svgeo.outerHTML).indexOf('\"; } else { lastiurl=\"\"; } window.focus(); pres=null; try { if (lastp.indexOf('Regarding ' + svgeo.innerHTML + ' ') == -1) { //alert(szero.innerHTML.split(svgeo.innerHTML + '')[1].substring(0,300)); if (bconto) { document.getElementById('hidecol').value=szero.innerHTML.split('>' + svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0]; bconto.setlhifto(szero.innerHTML.split(svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0]); } //pres=prompt('Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML.substring(0,1) + ' .+. ' + szero.innerHTML.split(svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0] + '', ''); pres=''; } } catch(exc) { console.log('error'); } if (pres == null) { console.log('err'); pres=''; if (uselast) { setTimeout(psvgit, 2000); } } else { uselast=false; lastp='Regarding ' + svgeo.innerHTML + ' please enter an optional image URL'; } if (pres != '') { if (pres.indexOf('#') == -1) { zerodotsix='0.6'; } else if (pres.indexOf('#') != -1) { zerodotsix=pres.split('#')[1]; pres=pres.split('#')[0].trim(); if ((zerodotsix + 'z').substring(0,1) < '0' || (zerodotsix + 'z').substring(0,1) > '9') { zerodotsix='0.6'; } } if (pres != '') { uselast=false; lastp='Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML + ''; lastiurl=lastiurl.replace(\" href=''\", \" href='\" + pres + \"'\"); if (gzero) { //alert(\"SMS'; if (!document.getElementById('theasms') && document.getElementById('psms')) { document.getElementById('psms').click(); } else { document.getElementById('theasms').click(); } } } return false; } function sz(inum) { var uni='px'; if (szero) { if (('' + szero.getAttribute('width')).indexOf('pt') != -1) { uni='pt'; } else if (('' + szero.getAttribute('width')).indexOf('%') != -1) { uni='%'; } szero.setAttribute('width', '' + ('' + eval(eval('' + szero.getAttribute('width').split(uni)[0])) * eval('' + inum)) + uni); szero.setAttribute('height', '' + ('' + eval(eval('' + szero.getAttribute('height').split(uni)[0])) * eval('' + inum)) + uni); } } function domore(hm) { var rectis=document.getElementById('myif').getBoundingClientRect(); if (('' + hm) == '1') { document.getElementById('rtd').style.width='20%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.1)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.1) + 'px'; } else if (('' + hm) == '-1') { document.getElementById('rtd').style.width='50%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.9)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.9) + 'px'; } else if (('' + hm) == '-2') { document.getElementById('rtd').style.width='50%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.8)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.8) + 'px'; } else { document.getElementById('rtd').style.width='20%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.2)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.2) + 'px'; } } function prechecksvg() { checksvg(lastwoo); } function checki(iois) { bconto = (iois.contentWindow || iois.contentDocument); } function checksvg(iiois) { var gs=[]; var iois=iiois; if (lastwoo) { iois=lastwoo.document.childNodes[0]; //.getSVGDocument(); console.log('lAstwoo ' + lastwoo); } else if (('' + iiois.src).toLowerCase().indexOf('.svg') == -1 && lastwoo != null) { iois=lastwoo.document.childNodes[0]; //.getSVGDocument(); console.log('lastwoo ' + lastwoo); } if (iois != null) { // check out window.svgDocument console.log('lastwoo2'); var aconto = (iois.contentWindow || iois.contentDocument); console.log('lastwoo3a ' + iois.document); console.log('lastwoo3 ' + aconto); if (aconto != null) { //alert(1); console.log('lastwoo4 ' + aconto); if (aconto.document) { console.log('lastwoo5 ' + aconto); aconto = aconto.document; gs=aconto.getElementsByTagName('g'); if (eval('' + gs.length) > 0) { gzero=gs[0]; for (var sd=0; sd 0) { szero=gs[0]; for (var sd=0; sd

Trying out Dot GraphViz hosted in PHP " . $plus . " Colour Wheel   

RJM Programming " . $minus . " October, 2024

Thanks to https://graphviz.org/Gallery/neato/color_wheel.html

<" . $outel . " onload='checksvg(this);' id=myif style='width:95%;height:500px;' type=application/" . $fmt . " src='/doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt . "?rand=" . rand(13456,6789056) . "'>

Title ...


     

Colour Wheel Names ...






     
Canvas Drawing With Clicked Colour to Top and Left As Revealed Below ...
"; } else { echo " Trying out Dot GraphViz hosted in PHP - RJM Programming - October, 2024 - Colour Wheel var lasturl='', lasttext=null, gzero=null, lastx=0, lasty=0, lastw=0, lasth=0, lastp='', lastwoo=null, lastj=0, lssel='', zerodotsix='0.6', bconto=null, lastiurl='', szero=null, aimg='', lastimgc='', lastsvggeo=null, uselast=false; String.prototype.toHtmlEntities = function() { return this.replace(/./gm, function(s) { return (s.match(/[a-z0-9\s]+/i)) ? s : '&#' + s.charCodeAt(0) + ';'; }); }; function plusdata(aig) { var outig=aig, dlm='\"'; var outgs=aig.split('data:'); if (eval('' + outgs.length) > 1) { outig=outgs[0]; dlm=outig.slice(-1); for (var iop=1; iop') != -1) { toe=prompt('Please enter email address or SMS number to share ' + document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','') + ' with.', ''); } else { toe=prompt('Please enter email address or SMS number to share with.', ''); } if (toe == null) { toe=''; } if (toe.indexOf('@') != -1) { if (document.getElementById('sells').innerHTML.indexOf(inu + '\">') != -1) { document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent(document.getElementById('sells').innerHTML.split(inu + '\">')[1].split('<')[0].replace('Email or SMS ','')) + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output')); document.getElementById('myaemailsms').click(); } else { document.getElementById('myaemailsms').href='mailto:' + toe.trim() + '?subject=' + encodeURIComponent('Colour Wheel') + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output')); document.getElementById('myaemailsms').click(); } } else if (toe.trim() != '') { if (toe.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '') { document.getElementById('myaemailsms').href='sms:' + toe.trim() + '&body=' + encodeURIComponent(inu.replace('HttP','http').split('#')[0].replace(/\-/g,'').replace('doctestoutput','doctest-output')); document.getElementById('myaemailsms').click(); } } document.getElementById('sells').value=''; } else if (inu.indexOf('HTTP') == 0) { //alert('2:' + inu); if (inu.indexOf('#saved_colour_wheel_') != -1) { //alert('22:' + inu.split('#')[eval(-1 + inu.split('#').length)]); deleteAVal(inu.split('#')[eval(-1 + inu.split('#').length)], encodeURIComponent(inu.replace('#' + inu.split('#')[eval(-1 + inu.split('#').length)], '').replace('HTTP','http'))); //alert('222:' + inu.split('#')[eval(-1 + inu.split('#').length)]); cookieAVal('saved_colour_wheel_', true); //alert('2222:' + inu.split('#')[eval(-1 + inu.split('#').length)]); } } else { //woo=window.open(inu, '_blank', 'top=50,left=50,width=800,height=800'); woo=window.open(inu.replace(/\-/g,'').replace('doctestoutput','doctest-output').replace('http:','').replace('https:',''), '_blank', 'top=50,left=50,width=800,height=800'); } } } function rework(what) { var outw=what; if (what.toLowerCase().indexOf('doctest output ') != -1 && what.toLowerCase().indexOf('.gv.') != -1) { outw=what.toLowerCase().split('doctest output ')[1].split('.gv.')[0]; var outwds=outw.split(' '); outw=outwds[0].substring(0,1).toUpperCase() + (outwds[0] + ' ').substring(1).toLowerCase().trim(); for (var io=1; io', '' + '' + '' + ''); } } if (lssel != '') { document.getElementById('ssel').innerHTML=lssel.trim(); } } if (cName.indexOf('saved_colour_wheel_') == 0) { if (window.localStorage) { if (decodeURIComponent(('' + localStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') { return decodeURIComponent(localStorage.getItem(cName)); } if (decodeURIComponent(('' + sessionStorage.getItem(cName)).replace(/^undefined/g,'').replace(/^null/g,'')) != '') { return decodeURIComponent(sessionStorage.getItem(cName)); } } return ''; } return ''; } function contentfix(inid) { document.getElementById('ititle').value=document.getElementById('ititle').value.replace(/\+/g,'-').replace(/\=/g,'-').replace(/\ /g,'-'); document.getElementById('none').value=various(document.getElementById('one').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('ntwo').value=various(document.getElementById('two').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('nthree').value=various(document.getElementById('three').value.replace(/\+/g,String.fromCharCode(9))); document.getElementById('mysub').style.border='3px dotted green'; return inid; } function various(indi) { var outdi=indi; return outdi; } function svghost(svgheo, imgc) { if (9 == 8) { if (gzero) { gzero.innerHTML+=\"\"; } else { svgheo.innerHTML+=\"\"; } } } function psvgit() { svgit(lastsvgeo, lastimgc); } function hsvtorgb(hsbh, hsbs, hsbb) { // thanks to https://stackoverflow.com/questions/17242144/javascript-convert-hsb-hsv-color-to-rgb-accurately var rgb = { }; var h = Math.round(hsbh * 255); var s = Math.round(hsb.s * 255 / 100); var v = Math.round(hsb.b * 255 / 100); if (s == 0) { rgb.r = rgb.g = rgb.b = v; } else { var t1 = v; var t2 = (255 - s) * v / 255; var t3 = (t1 - t2) * (h % 60) / 60; if (h == 360) h = 0; if (h < 60) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3 } else if (h < 120) { rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3 } else if (h < 180) { rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3 } else if (h < 240) { rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3 } else if (h < 300) { rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3 } else if (h < 360) { rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3 } else { rgb.r = 0; rgb.g = 0; rgb.b = 0 } } return 'rgb(' + Math.round(rgb.r) + ',' + Math.round(rgb.g) + ',' + Math.round(rgb.b) + ')'; } function animbord() { var bcolsare=['green','#F0F8FF','#F0FFFF','#F0F0E0','#F0FFF0','#FFFFF0','#FFF0E0','#FFFFE0','#F0FFF0','#FFFFFF','#F0F0F0','#F0F7FF','#FFF8F0','#FFF0F0','#E0FFFF','#FFFFE0']; document.getElementById('mysub').style.border='3px dotted ' + bcolsare[lastj]; lastj++; if (lastj >= eval('' + bcolsare.length)) { lastj=0; } setTimeout(animbord, 200); } function svgit(svgeo, imgc) { var pres=''; lastsvgeo=svgeo; lastimgc=imgc; if (('' + svgeo.outerHTML).indexOf('\"; } else { lastiurl=\"\"; } window.focus(); pres=null; try { if (lastp.indexOf('Regarding ' + svgeo.innerHTML + ' ') == -1) { if (bconto) { document.getElementById('hidecol').value=szero.innerHTML.split('>' + svgeo.innerHTML + '')[1].split(' fill=\"')[1].split('\"')[0]; bconto.setlhifto(szero.innerHTML.split(svgeo.innerHTML)[1].split(' fill=\"')[1].split('\"')[0]); } //pres=prompt('Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML + ' ... ' + szero.outerHTML.split('>' + svgeo.innerHTML + '')[1].substring(0,200) + '', ''); pres=''; } } catch(exc) { console.log('error'); } if (pres == null) { console.log('err'); pres=''; if (uselast) { setTimeout(psvgit, 2000); } } else { uselast=false; lastp='Regarding ' + svgeo.innerHTML + ' please enter an optional image URL'; } if (pres != '') { if (pres.indexOf('#') == -1) { zerodotsix='0.6'; } else if (pres.indexOf('#') != -1) { zerodotsix=pres.split('#')[1]; pres=pres.split('#')[0].trim(); if ((zerodotsix + 'z').substring(0,1) < '0' || (zerodotsix + 'z').substring(0,1) > '9') { zerodotsix='0.6'; } } if (pres != '') { uselast=false; lastp='Regarding ' + svgeo.innerHTML + ' please see the whole node ' + svgeo.outerHTML + '' lastiurl=lastiurl.replace(\" href=''\", \" href='\" + pres + \"'\"); if (gzero) { //alert(\"Email'; document.getElementById('theaemail').click(); } return false; } function naz(intvo) { var intv=intvo.value; if (intv.replace(' ','-').replace('_','-').indexOf('-') == -1 && intv.trim() != '') { intvo.value='a-' + intv; intv=intvo.value; } var retval='My%20%Colour%20Wheel'; var jntv=intv.replace(/\ /g,'-').replace(/\_/g,'-'); var jst=jntv.split('-'); if (jntv.indexOf('heel') != -1) { retval=jst[0].substring(0,1).toUpperCase() + jst[0].substring(1).toLowerCase() + ' '; for (var ij=1; ijSMS'; if (!document.getElementById('theasms') && document.getElementById('psms')) { document.getElementById('psms').click(); } else { document.getElementById('theasms').click(); } } } return false; } function sz(inum) { var uni='px'; if (szero) { if (('' + szero.getAttribute('width')).indexOf('pt') != -1) { uni='pt'; } else if (('' + szero.getAttribute('width')).indexOf('%') != -1) { uni='%'; } szero.setAttribute('width', '' + ('' + eval(eval('' + szero.getAttribute('width').split(uni)[0])) * eval('' + inum)) + uni); szero.setAttribute('height', '' + ('' + eval(eval('' + szero.getAttribute('height').split(uni)[0])) * eval('' + inum)) + uni); } } function domore(hm) { var rectis=document.getElementById('myif').getBoundingClientRect(); if (('' + hm) == '1') { document.getElementById('rtd').style.width='20%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.1)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.1) + 'px'; } else if (('' + hm) == '-1') { document.getElementById('rtd').style.width='50%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.9)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.9) + 'px'; } else if (('' + hm) == '-2') { document.getElementById('rtd').style.width='50%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(0.8)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 0.8) + 'px'; } else { document.getElementById('rtd').style.width='20%'; document.getElementById('myif').style.width='' + eval(eval('' + rectis.width) * sz(1.2)) + 'px'; document.getElementById('myif').style.height='' + eval(eval('' + rectis.height) * 1.2) + 'px'; } } function prechecksvg() { checksvg(lastwoo); } function checki(iois) { bconto = (iois.contentWindow || iois.contentDocument); } function checksvg(iiois) { var gs=[]; var iois=iiois; if (('' + iiois.src).toLowerCase().indexOf('.svg') == -1 && lastwoo != null) { iois=lastwoo; //alert(1); console.log('lastWoo'); } if (iois != null) { // check out window.svgDocument console.log('lastWoo2'); var aconto = (iois.contentWindow || iois.contentDocument); console.log('lastWoo3 ' + aconto); if (aconto != null) { //alert(1); console.log('lastWoo4 ' + aconto); if (aconto.document) { console.log('lastWoo5 ' + aconto); aconto = aconto.document; gs=aconto.getElementsByTagName('g'); if (eval('' + gs.length) > 0) { gzero=gs[0]; for (var sd=0; sd 0) { szero=gs[0]; for (var sd=0; sd 0) { gzero=gs[0]; for (var sd=0; sd 0) { for (var sd=0; sd

Trying out Dot GraphViz hosted in PHP " . $plus . " Colour Wheel   

RJM Programming " . $minus . " October, 2024

Thanks to https://graphviz.org/Gallery/neato/color_wheel.html

<" . $outel . " onload='checksvg(this);' id=myif style='width:95%;height:500px;' type=application/" . $fmt . " src='/doctest-output" . DIRECTORY_SEPARATOR . $newabl[0] . $gv . $fmt . "?rand=" . rand(13456,6789056) . "'>

Title ...


     

Colour Wheel Names ...






     
Canvas Drawing With Clicked Colour to Top and Left As Revealed Below ...
"; } ?>