-
Notifications
You must be signed in to change notification settings - Fork 1
Standalone
Standalone Mode allows you to create a static version of a Net.Create graph that can be hosted on a static web server.
- Nodes and Edges are read-only
- Nodes, Edges, Tables, and Filters are all interactive
- Comments can be viewed, but not added
You will need a static web server to host the files.
Tip
You can use python3 -m http.server
to start a static server on your local Mac (assuming you have python3
installed). You can also set the port using python3 -m http.server 4000
(python defaults to port 8000).
To save the data from the last run to publish on a standalone read-only web server:
Caution
Make sure the project's template is set to NOT require login. Standalone mode does not have a login form. If requireLogin
is set, no graph will be displayed. However, you can still view the graph by adding the login to the url, e.g. http://localhost:3000/#/edit/A-B-G3X
. You can use this method to hide graphs from anyone without the special URL.
- open Terminal and cd to the project's build directory (e.g.
cd ~/dev/netcreate-itest/
) - load and run the database you want to publish, e.g.
./nc.js --dataset=tacitus
- hit
Ctrl-C
to quite the app. - type
npm run package
to generate the standalone files. - copy the files in
/public
to your web server. - point your browser to the web server to view the data.
See Pull Request #46 for more information.
bb7b12c introduced a hack for loading arbitrary databases.
Standalone mode uses JSON data files to load the graph data. Since these are no longer directly used, you need to use npm run package
to build the necessary JSON files.
To target a specific database:
-
Make sure you have a JSON data file in
/app-data/*.json
. If you don't have a *.json file available:-
./nc.js --dataset=<yourdbname>
-- Make sure the database gets created and thatNC_CONFIG
is set. Runningnc.js
will do this. -
npm run package
-- This should create and copy both<yourdb>.json
and<yourdb>.template.toml
files into/app-data
, and then/public/data
[!WARNING]
npm run package
will overwrite both the current dataset's*.json
and*.template.toml
as well as thestandalone-db.json
andstandalone.template.toml
files. -
Confirm that you have a file named
/public/data/<yourdbname>.json
-
-
Set up your server -- Copy all the
/public
folders to your server. -
And add
?dataset=name
to the url (right before the #, with no space or punctuation)
For example: http://netcreate.org/SampleNetworks/Package/#/
Becomes: http://netcreate.org/SampleNetworks/Package/?dataset=<yourdbname>#/
NOTES:
- To debug standalone mode, use
npm run package:debug
to get live updates
Overview
- When you run
npm run package
-
*.json
andstandalone-db.json
files are created using the current database (as defined inNC_CONFIG
). -
*.template.toml
andstandalone.template.toml
files are copied from the current database. - static files are generated in the
/public
folder. - db and template files in
/app-data
are copied over to/public/data
-
- Copy these to a static web server and point the browser at the index.html file.
The database that is generated for the standalone server is the current dataset as defined in your NC_CONFIG
. e.g. if you used ./nc.js --dataset=tacitus
to create the database, when you run npm run package
and start your static server, the dataset will be tacitus
. This is saved as standalone-db.json
and standalone.template.toml
.
Any files in /app-data
are automatically copied over to /public/data
, so over time you can build multiple databases that can be called up -- the one loaded by default is the last one you used when you called npm run package
.
Method | Static URL | Source Data | "Packaged" Location | Public Location |
---|---|---|---|---|
default | http://< server >/index.html | /runtime/tacitus.loki |
/app-data/standalone-db.json |
/public/data/standalone-db.json |
dataset=xxx override |
http://< server >/index.html?dataset=tacitus | /runtime/tacitus.loki |
/app-data/tacitus-db.json |
/public/data/tacitus-db.json |
- HOME
- Releases
- Installation Guide
-
User Guide
- Advanced Panel
-
Using Templates
- Edit Template
- Template Filed Types Reference:
- Template Technical Overview
- Filters
- Import/Export
- Database Version Documentation
- Deployment
- Using Turbo360
- Documentation ToDo
- Decision Log
- Useful Reading
- Design Goals
- Code Review: Old UI Dataflow and followup UI Dataflow Design
- UNISYS Architecture
- User Sessions
- Developer Reference
- Migrating Data -- Deprecated