Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Documentation for building and using the library
Browse files Browse the repository at this point in the history
  • Loading branch information
yuricus committed Jan 24, 2017
1 parent 39818a5 commit 29206d3
Showing 1 changed file with 70 additions and 4 deletions.
74 changes: 70 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,76 @@
# iKnowGraphBrowser

Build/run steps:
iKnowGraphBrowser is a software library that helps you visualize graphs coming from iKnow REST endpoint.
User can apply filters to graph, select nodes, export them to CSV file.

## Preparing to work with:

This will get you prepared to either running demo version of iKnowGraphBrowser or modifying and building it.

1. Get node.js version 4+ and npm version 3+ for your OS
2. Clone this repository
3. Resolve dependencies with `npm install`
4. Set IKNOW_ENDPOINT and IKNOW_AUTH environmental variables or edit end of `webpack.demo.config.js` to specify what iKnow REST endpoint to use.
5. Run `npm run demo` to build application and run proxy server
6. Point your browser to `http://localhost:5000` to view UI

## Running demo

This will run the demo with UI to select iKnow data scenario and ability to select seed word.
Data will be fethed from iKnow REST endpoint you specify via enviromental variables.

1. Set IKNOW_ENDPOINT and IKNOW_AUTH environmental variables or edit end of `webpack.demo.config.js` to specify what iKnow REST endpoint to use.
2. Run `npm run demo` to build application and run proxy server. This will launch webpack build process and start development server.
3. Point your browser to `http://localhost:5000` to view UI


## Building library

Library is built using `npm run build` which produce dist/iKnowBrowser.js file with all the JS dependencies of the project.

## Using library

This is minimal html code to run the library:

```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>iKnowGraphBrowser Demo</title>
<!-- bootstrap styles and some javascript. Dependency on bootstrap is not crucial and can be removed in the future. -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<style>
html, body, #root {
height: 100%;
overflow: hidden;
}
#root {
display: flex;
}
</style>
</head>
<body>
<div id="root"></div>
<!-- to build iKnowBrowser.js see docs in README.md -->
<script src="libs/iKnowBrowser/iKnowBrowser.js"></script>
<script>
var demo = new iKnowBrowser(document.getElementById('root'), IKNOW-REST-GRAPH-RESPONSE);
</script>
</body>
</html>
```

## Architecture

Library is written in JavaScript ES6 language, it uses modules and webpack to build library bundle with all dependencies.
UI of the library is written using React framework, graph visualization used Linkurious build of sigma.js.

Dependencies:

* file-saver - cross-browser support of launching `Save As` dialog for exporting JSON file
* linkuroius - sigma.js graph visualization library enhanced with numerous plugins, some of them are used
* lodash - general purpose algorithmic/helper library
* react - library by Facebook used to create UI
* react-dom - react library helper
* bootstrap - basic styles/some UI components. Not a strict dependency, could be removed if nessesary.

0 comments on commit 29206d3

Please sign in to comment.