This is source code of graphonline service. Graphonline helps visualize graph and applies a lot of algorithms.
MIT License.
Client side:
- HTML5 support of client side.
Server side:
- PHP 7.4 or PHP 5.6.
- Binary cgi supports. It needs for some algorithm, but almost all can work without it.
- Download repository to local website folder. It should be placed into root of domen. If you want to run graphonline from subdirectory read "Additional steps to run from subdirectory" below.
- Change access rights of directory /tmp (it is actually for Non-Windows system, you should set rwx). PHP scripts should be able to create and to modify files inside it.
- Change default root password in file: /core/config/admin_sector.php
$g_config['admin_sector']['def_pwd'] = 'rootPass';
- Change password to wiki. Change lines:
$DefaultPasswords['admin'] = pmcrypt('pas');
$DefaultPasswords['edit'] = pmcrypt('pas');
In files: /wiki/local/config.php /en/wiki/local/config.php
- Maybe you need to disable autoredirect to https. Comments or remove lines:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
In files: /.htaccess /wiki/.htaccess /en/wiki/.htaccess
- Some algorithms (short-path, Eulerian cycle/path and so on) use external modul for algorithm. Currently for desktops it is JS file: script\Graphoffline.Emscripten.js. For mobile phones and tablets we continue using binary CGI file. Binary CGI or Graphoffline.Emscripten.js are built from GraphOffline: https://github.com/UnickSoft/GraphOffline. Binary cgi should be placed to /cgi-bin/GraphCGI.exe or you can take precompiled file(Windows and Mac) from /cgi-bin/GraphOffline/
For example you place graphonline sources into http://localhost/graph/ directory.
- Edit .htaccess change RewriteRule to line:
RewriteRule ^(.*)$ /graph/index.php?q=$1 [L,QSA]
- Write your directory name to script\main.js variable SiteDirs:
var SiteDir = "graph/";
- Write your directory to core config core\config\main.php in line SITE_IN_DIR:
define('SITE_IN_DIR', 'graph');
-
Run merge.php to apply changes. Run http://localhost/graph/script/merge.php
-
Change path to fontawesome. Change path in file i/css/dev/fontawesome/variables.less line @fa-font-path:
@fa-font-path: "/graph/i/fonts/dev/fontawesome";
- We use our own js cache. It is files *.js.cache located in in script/pages. If you remove these cache files the browser will load scripts from source files. You may need to disable browser cache. Or change setting: $g_config['use_js_cache']
- If you want to update cache use this admin page: /admin/page_update_script_cache. Just click to all links and wait until the cache will be updated.
- If you change cache files and you want browsers to redownload script cache incripent number in setting $g_config['engine_version'].
- If you see page but css is not loaded. Maybe your web server does not support gzip encoding. You can try change FORCE_DISABLE_GZIP field from false to true. (It is placed in file /lib/ExtraPacker/ExtraPacker.php).
You can open HTML file in browser to run your algorithm. Read more here sandbox/README.md.
You may download offline build. It is ready to run on local machine and includes tuned web server and other software. https://graphonline.ru/en/wiki/Aricles/OfflineVersion
- Micron (http://zmicron.itkd.ru/) is our engine.
- PmWiki (https://www.pmwiki.org/) in folders: /wiki/ and /en/wiki/
- And others: jquery (https://jquery.com/), bootstrap3 (https://getbootstrap.com/), fontawesome (https://fontawesome.com/).
You can write on github to @UnickSoft or to email admin@graphonline.ru