Add creating graph using Edge List.

This commit is contained in:
Oleg Sh
2022-09-18 13:19:53 +02:00
parent b3838b70ca
commit 4b82685aaa
40 changed files with 644 additions and 1 deletions

View File

@@ -0,0 +1,76 @@
<head>
<link rel="stylesheet" type="text/css" href="<?= Root('i/css/create_graph_by_pair.css')?>" />
<script src="<?= Root('script/Graph.js')?>"></script>
</head>
<script>
function checkFormat()
{
var graph = new Graph();
if (!graph.TestPair($( "#PairFieldPage" ).val()))
{
$( "#BadFormatMessage" ).show();
}
else
{
$( "#BadFormatMessage" ).hide();
}
}
window.onload = function ()
{
if (document.getElementById('CreateByPair'))
{
document.getElementById('CreateByPair').onclick = function ()
{
$("#pairForm").submit();
}
}
$( "#PairFieldPage" ).on('keyup change', function (eventObject)
{
checkFormat();
});
checkFormat();
}
</script>
<h1><?= L('head_no_tags')?></h1>
<p><?= L('text')?></p>
<div>
<div id="message" class="alert alert-success" role="alert" style="height:64px">
<p id="TextDescription"><?= L('pair_description') ?></p>
</div>
<h4><?= L('edge_list') ?></h4>
<div class="row">
<div class="col-md-4">
<form action="./" method="post" id="pairForm">
<textarea name="pairs" id="PairFieldPage" wrap="off">
<?php if (!isset($_GET["pair"])): ?>
a-b
a-c
b-c
<?php else: ?>
<?= $_GET["pair"] ?>
<?php endif;?></textarea>
</form>
</div>
<div class="col-md-4">
<button type="button" class="btn btn-default btn-lg" id="CreateByPair"><span class="glyphicon glyphicon-ok"></span> <?= L('plot_graph_button')?></button>
<div id="BadFormatMessage" class="alert alert-warning" role="alert">
<?= L('pair_bad_format')?>
</div>
<div class="alert alert-info" role="alert">
<h4><?= L('ex_pair_format')?></h4>
<div>
<?= L('ex_pair_forma_description')?>
</div>
</div>
</div>
</div>
</div>

View File

@@ -11,7 +11,7 @@
<script src="<?= Root('i/js/dev/jquery-ui.js')?>"></script>
<script src="<?= Root('i/js/dev/jquery.feedback_me.js')?>"></script>
<script src="<?= Root("script/canvas2svg.js")?>" ></script>
<script src="<?= Root("script/example.js?v=67")?>" ></script>
<script src="<?= Root("script/example.js?v=68")?>" ></script>
<!-- Yandex.RTB -->
<script>window.yaContextCb=window.yaContextCb||[]</script>
@@ -445,6 +445,10 @@
<div id="matrixErrorInc" class="translation">
<div><span class="glyphicon glyphicon-remove-sign text-danger"></span> <?= L('bad_inc_matrix_message')?></div>
</div>
<div id="pairErrorInc" class="translation">
<div><span class="glyphicon glyphicon-remove-sign text-danger"></span> <?= L('bad_inc_pair_message')?></div>
</div>
<div id="voteDialog">
<form>
@@ -721,6 +725,7 @@
<p id="inputMatrix" class="translation"><?= isset($_POST["matrix"]) ? $_POST["matrix"] : ""?></p>
<p id="separator" class="translation"><?= isset($_POST["separator"]) ? $_POST["separator"] : ""?></p>
<p id="inputIncidenceMatrix" class="translation"><?= isset($_POST["incidenceMatrix"]) ? $_POST["incidenceMatrix"] : ""?></p>
<p id="inputPair" class="translation"><?= isset($_POST["pairs"]) ? str_replace("<", "&lt;", str_replace(">", "&gt;", $_POST["pairs"])) : ""?></p>
<p id="currentLanguage" class="translation"><?= L('current_language')?></p>
<p id="editWeight" class="translation"><?= L('edit_weight')?></p>
<p id="noWeight" class="translation"><?= L('default_weight')?></p>
@@ -850,6 +855,9 @@
<p id="makeAllUndirected" class="translation"><?= L('make_all_undirected')?></p>
<p id="makeAllDirected" class="translation"><?= L('make_all_directed')?></p>
<p id="pairWrongFormat" class="translation"><?= L('edge_list_wrong_format')?></p>
<p id="fixButton" class="translation"><?= L('fix_button')?></p>
</section>
<!--
<script>