Skip to content

Commit

Permalink
validate html
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Textor committed Mar 18, 2022
1 parent 383c9be commit b31c919
Show file tree
Hide file tree
Showing 10 changed files with 355 additions and 162 deletions.
45 changes: 21 additions & 24 deletions gui/dags.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<!--
Expand All @@ -24,21 +24,21 @@
<title>DAGitty v3.1</title>
<link rel="stylesheet" type="text/css" href="dags.css" />

<script type="text/javascript" src="js/dagitty.js"></script>
<script type="text/javascript" src="js/example-dags.js"></script>
<script src="js/dagitty.js"></script>
<script src="js/example-dags.js"></script>

<script type="text/javascript" src="js/styles/semlike.js"></script>
<script type="text/javascript" src="js/styles/original.js"></script>
<script src="js/styles/semlike.js"></script>
<script src="js/styles/original.js"></script>

<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/base64.js"></script>
<script src="js/main.js"></script>
<script src="js/base64.js"></script>

<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?render=explicit"
<script src="https://www.google.com/recaptcha/api.js?render=explicit"
async defer></script>

<meta name="viewport" content="width=device-width, initial-scale=1" />

<script type="text/javascript">
<script>
var redraw;
var renderer;
var layouter;
Expand All @@ -60,6 +60,8 @@
var DAGittyControl;

function initialize(){


DAGitty.setup({autofocus:true});
DAGittyControl = DAGitty.controllers[0];

Expand All @@ -78,7 +80,7 @@
document.getElementById("variable_id").value = ''
}
displayImplicationInfo( false )
causalEffectEstimates()
causalEffectEstimates( document.getElementById("causal_effect_kind").value )
displayGeneralInfo()
GUI.refresh_variable_status()
}
Expand Down Expand Up @@ -141,7 +143,7 @@
<ul id="menu_model" style="z-Index:15">
<li><a href="#" onclick="newModel();displayHide('menu_model')">New model</a></li>
<li><a href="#" onclick="loadOnlineForm();displayHide('menu_model')">Load from dagitty.net</a></li>
<script type="text/javascript">
<script>
if( document.location.protocol == "http:" || document.location.protocol == "https:" ){
document.write('<li><a href="#" onclick="saveOnlineForm();displayHide(\'menu_model\')">Publish on dagitty.net</a></li>');
document.write('<li><a href="#" onclick="updateOnlineForm();displayHide(\'menu_model\')">Update on dagitty.net</a></li>');
Expand All @@ -160,7 +162,7 @@
</li>
<li><a href="javascript:void(0)" id="menu_examples_title">Examples</a>
<ul id="menu_examples" style="z-Index:14">
<script type="text/javascript">
<script>
for( var i = 0 ; i < examples.length ; i++ ){
document.write( "<li><a href=\"#\" onclick=\"loadExample("+i+");displayHide('menu_examples')\">"+examples[i].l+"</a></li>" );
}
Expand All @@ -177,8 +179,8 @@
<li><a href="#" onclick="how('To save the model, copy-paste the content of the &quot;model code&quot; into your favourite text editor (e.g. &quot;Word&quot;).')">Save a model</a></li>
<li><a href="#" onclick="how('To set the exposure variable, click/tap it and check &quot;exposure&quot; in the &quot;variable&quot; tab, or move the mouse over it and press the &quot;e&quot; key on your keyboard.')">Set exposure variable</a></li>
<li><a href="#" onclick="how('To set the outcome variable, click/tap it and check &quot;outcome&quot; in the &quot;variable&quot; tab, or move the mouse over it and press the &quot;o&quot; key on your keyboard.')">Set outcome variable</a></li>
<li><a href="#" onclick="how('To toggle adjustment for a variable, click/tap it and check &quot;adjusted&quot in the &quot;variable&quot; tab, or move the mouse over it and press the &quot;a&quot; key on your keyboard.')">Adjust for variable</a></li>
<li><a href="#" onclick="how('To toggle selection status for a variable, click/tap it and check &quot;selected&quot in the &quot;variable&quot; tab, or move the mouse over it and press the &quot;s&quot; key on your keyboard.')">Define a selection variable</a></li>
<li><a href="#" onclick="how('To toggle adjustment for a variable, click/tap it and check &quot;adjusted&quot; in the &quot;variable&quot; tab, or move the mouse over it and press the &quot;a&quot; key on your keyboard.')">Adjust for variable</a></li>
<li><a href="#" onclick="how('To toggle selection status for a variable, click/tap it and check &quot;selected&quot; in the &quot;variable&quot; tab, or move the mouse over it and press the &quot;s&quot; key on your keyboard.')">Define a selection variable</a></li>
<li><a href="#" onclick="how('To toggle observed status for a variable, click/tap it and check &quot;unobserved&quot; in the &quot;variable&quot; tab, or move the mouse over it and press the &quot;u&quot; key on your keyboard.')">Make a variable unobserved (latent)</a></li>
</ul>
</li>
Expand All @@ -197,18 +199,16 @@
</ul>

<div id="canvas" class="dagitty" data-mutable="true">
dag {
A [pos="-2.200,-1.520"]
A [selected,pos="-2.200,-1.520"]
B [pos="1.400,-1.460"]
D [outcome,pos="1.400,1.621"]
E [exposure,pos="-2.200,1.597"]
Z [pos="-0.300,-0.082"]
Z [adjusted,pos="-0.300,-0.082"]
A -&gt; E
A -&gt; Z [pos="-0.791,-1.045"]
B -&gt; D
B -&gt; Z [pos="0.680,-0.496"]
E -&gt; D
}
</div>

</main>
Expand Down Expand Up @@ -263,9 +263,6 @@ <h3 onclick="displayToggle('viewmode')"><img src="images/arrow-down.png" alt=""
<p><input type="radio" checked="checked" id="dagview_normal" name="dagview"
onclick="GUI.set_view_mode(this.value)" value="normal" />
<label for="dagview_normal">normal</label></p>
<p><input type="radio" name="dagview" id="dagview_causalodds"
onclick="GUI.set_view_mode(this.value)" value="causalodds"/>
<label for="dagview_causalodds">causal odds ratio</label></p>
<p><input type="radio" name="dagview" id="dagview_moral"
onclick="GUI.set_view_mode(this.value)" value="moral"/>
<label for="dagview_moral">moral graph</label></p>
Expand All @@ -288,7 +285,7 @@ <h3 onclick="displayToggle('effects')"><img src="images/arrow-down.png" alt="" i
</form>
</div>

<h3 onclick="displayToggle('dagstyle')"><img src="images/arrow-down.png" alt="" id="a_view">
<h3 onclick="displayToggle('dagstyle')"><img src="images/arrow-down.png" alt="" id="a_dagstyle">
Diagram style</h3>
<div id="dagstyle" style="display:block">
<form autocomplete="off">
Expand All @@ -301,7 +298,7 @@ <h3 onclick="displayToggle('dagstyle')"><img src="images/arrow-down.png" alt=""
</form>
</div>

<h3 onclick="displayToggle('coloring')"><img src="images/arrow-down.png" alt="" id="a_view"> Coloring</h3>
<h3 onclick="displayToggle('coloring')"><img src="images/arrow-down.png" alt="" id="a_coloring"> Coloring</h3>
<div id="coloring" style="display:block">
<form autocomplete="off">
<p><input type="checkbox" checked="checked" id="highlight_causal"
Expand Down Expand Up @@ -375,7 +372,7 @@ <h3 onclick="displayToggle('causal_effect_block')">

<div id="causal_effect_block">
<p>
<select id="causal_effect_kind" onchange="causalEffectEstimates()">
<select id="causal_effect_kind" onchange="causalEffectEstimates(this.value)">
<option value="adj_total">Adjustment (total effect)</option>
<option value="adj_causalodds">Adjustment (causal odds ratio)</option>
<option value="adj_direct">Adjustment (direct effect)</option>
Expand Down
Loading

0 comments on commit b31c919

Please sign in to comment.