mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-01 23:36:00 +00:00
Add output path for find all paths.
This commit is contained in:
parent
a60535dd6e
commit
5ae3760ba8
@ -224,7 +224,7 @@
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -262,7 +262,7 @@
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -261,7 +261,7 @@ We have added Dutch translation 🇳🇱. Thank you Willie de Wit</a>";
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -261,7 +261,7 @@ Tenemos traducciones en griego 🇬🇷.</a> <a href=\"https://github.com/UnickS
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -229,7 +229,7 @@
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -226,7 +226,7 @@
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -227,7 +227,7 @@
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -223,7 +223,7 @@
|
||||
|
||||
//FindAllPatches.js
|
||||
$g_lang['find_all_pathes'] = "Find all paths";
|
||||
$g_lang['number_of_pathes_from'] = "Number of pathes from ";
|
||||
$g_lang['number_of_pathes_from'] = "Number of paths from ";
|
||||
$g_lang['to'] = " to ";
|
||||
$g_lang['are'] = " is ";
|
||||
$g_lang['path_n'] = "Path #";
|
||||
|
@ -9,7 +9,8 @@ function FindAllPathes(graph, app)
|
||||
this.selectedObjects = {};
|
||||
this.foundSubGraphs = {};
|
||||
this.nSubgraphIndex = 0;
|
||||
this.nSubGraphCount = 0;
|
||||
this.nSubGraphCount = 0;
|
||||
this.foundPaths = {};
|
||||
}
|
||||
|
||||
|
||||
@ -67,9 +68,17 @@ FindAllPathes.prototype.setResultMessage = function()
|
||||
{
|
||||
if (this.nSubGraphCount > 0)
|
||||
{
|
||||
var currentPath = "";
|
||||
var first = true;
|
||||
this.foundPaths[this.nSubgraphIndex].forEach((nodeId) => {
|
||||
currentPath += (first ? "" : "⇒") + this.graph.FindVertex(nodeId).mainText;
|
||||
first = false;
|
||||
});
|
||||
|
||||
this.message = g_numberOfPathesFrom + this.firstObject.mainText +
|
||||
g_to + this.secondObject.mainText + g_are +
|
||||
this.nSubGraphCount + " <select style=\"float:right\" id=\"enumSubgraphs\"></select>";
|
||||
this.nSubGraphCount + ". " + g_pathN + (1 + parseInt(this.nSubgraphIndex)) + ": " + currentPath +
|
||||
" <select style=\"float:right\" id=\"enumSubgraphs\"></select>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -92,12 +101,12 @@ FindAllPathes.prototype.resultCallback = function(pathObjects, properties, resul
|
||||
{
|
||||
this.nSubGraphCount = results.length > 0 && results[0].type == 1 ? results[0].value : 0;
|
||||
|
||||
this.setResultMessage();
|
||||
|
||||
this.foundSubGraphs = {};
|
||||
this.foundPaths = {};
|
||||
for (var i = 0; i < this.nSubGraphCount; i++)
|
||||
{
|
||||
this.foundSubGraphs[i] = {};
|
||||
this.foundPaths[i] = [];
|
||||
}
|
||||
|
||||
var subGraphIndex = 0;
|
||||
@ -116,6 +125,8 @@ FindAllPathes.prototype.resultCallback = function(pathObjects, properties, resul
|
||||
var index = subGraphIndex;
|
||||
var subgGraph = this.foundSubGraphs[index];
|
||||
subgGraph[nodeId] = true;
|
||||
|
||||
this.foundPaths[index].push(nodeId);
|
||||
|
||||
if (prevNodeId >= 0)
|
||||
{
|
||||
@ -125,6 +136,8 @@ FindAllPathes.prototype.resultCallback = function(pathObjects, properties, resul
|
||||
prevNodeId = nodeId;
|
||||
}
|
||||
}
|
||||
|
||||
this.setResultMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -151,8 +164,9 @@ FindAllPathes.prototype.messageWasChanged = function()
|
||||
|
||||
$('#enumSubgraphs').change(function () {
|
||||
self.nSubgraphIndex = $('#enumSubgraphs').val();
|
||||
self.app.redrawGraph();
|
||||
self.setResultMessage();
|
||||
self.app.redrawGraph();
|
||||
self.app.updateMessage();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,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/example.js?v=57")?>" ></script>
|
||||
<script src="<?= Root("script/example.js?v=58")?>" ></script>
|
||||
|
||||
<!-- Yandex.RTB -->
|
||||
<script>window.yaContextCb=window.yaContextCb||[]</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user