graphonline/i/js/userAlgorithm.jstmpl
2020-07-03 23:24:10 +03:00

47 lines
993 B
Plaintext
Executable File

function UserAlgorithm(graph, app)
{
BaseAlgorithm.apply(this, arguments);
}
// inheritance.
UserAlgorithm.prototype = Object.create(BaseAlgorithm.prototype);
UserAlgorithm.prototype.getName = function(local)
{
return local == "ru" ? "Пользовательский алгоритм" : "User algorithm";
}
UserAlgorithm.prototype.getId = function()
{
return "user.algorithm";
}
// @return message for user.
UserAlgorithm.prototype.getMessage = function(local)
{
return local == "ru" ? "Пользовательский алгоритм работает" : "User algorithm is working";
}
UserAlgorithm.prototype.result = function(resultCallback)
{
// place your algorithm here
return null;
}
UserAlgorithm.prototype.getObjectSelectedGroup = function(object)
{
return 0;
}
// Factory for algorithm.
function CreateUserAlgorithm(graph, app)
{
return new UserAlgorithm(graph)
}
// Register connected component.
RegisterAlgorithm (CreateUserAlgorithm);