Mercurial > hg > NetworkVis
diff popoto/js/app-ismi.js @ 1:db013b2f3e10
added displayAttribute to show on individual nodes.
pull all labels and add getLabelFilter to ignore labels (currently with underscore).
added ismi-specific app-template and html file.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 01 Sep 2015 16:56:31 +0200 |
parents | |
children | 130beb4cabec |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/popoto/js/app-ismi.js Tue Sep 01 16:56:31 2015 +0200 @@ -0,0 +1,92 @@ +/** + * URL used to access Neo4j REST API to execute queries. + * Update this parameter to your running server instance. + * + * For more information on Neo4J REST API the documentation is available here: http://neo4j.com/docs/stable/rest-api-cypher.html + */ +popoto.rest.CYPHER_URL = "https://ismi-dev.mpiwg-berlin.mpg.de:7473/db/data/transaction/commit"; +//popoto.rest.CYPHER_URL = "http://localhost:7474/db/data/transaction/commit"; + +/** + * Add this authorization property if your Neo4j server uses basic HTTP authentication. + * The value of this property must be "Basic <payload>", where "payload" is a base64 encoded string of "username:password". + * + * "btoa" is a JavaScript function that can be used to encode the user and password value in base64 but it is recommended to directly use the Base64 value. + * + * For example Base64 encoding value of "neo4j:password" is "bmVvNGo6cGFzc3dvcmQ=" + */ +popoto.rest.AUTHORIZATION = "Basic " + btoa("neo4j:neo5j"); + +/** + * Define the Label provider you need for your application. + * This configuration is mandatory and should contain at least all the labels you could find in your graph model. + * + * In this alpha version only nodes with a label are supported. + * + * By default If no attributes are specified Neo4j internal ID will be used. + * These label provider configuration can be used to customize the node display in the graph. + * See www.popotojs.com or example for more details on available configuration options. + */ +popoto.provider.nodeProviders = { + "CODEX": { + "returnAttributes": ["label", "ismi_id", "identifier"], + "displayAttribute": "label" + }, + "WITNESS": { + "returnAttributes": ["label", "ismi_id", "folios"], + "displayAttribute": "label" + }, + "TEXT": { + "returnAttributes": ["label", "full_title", "ismi_id"], + "displayAttribute": "label" + }, + "PERSON": { + "returnAttributes": ["label", "ismi_id", "death_date_text", "url"], + "displayAttribute": "label" + }, + "REPOSITORY": { + "returnAttributes": ["label", "ismi_id"], + "displayAttribute": "label" + }, + "FLORUIT_DATE": { + "isSearchable": false + } +}; + +/** + * Here a listener is used to retrieve the total results count and update the page accordingly. + * This listener will be called on every graph modification. + */ +popoto.result.onTotalResultCount(function (count) { + document.getElementById("result-total-count").innerHTML = "(" + count + ")"; +}); + +/** + * The number of results returned can be changed with the following parameter. + * Default value is 100. + * + * Note that in this current alpha version no pagination mechanism is available in displayed results + */ +popoto.query.RESULTS_PAGE_SIZE = 1000; + + +/** + * For the alpha version, popoto.js has been generated with debug traces you can activate with the following properties: + * The value can be one in DEBUG, INFO, WARN, ERROR, NONE. + * + * With INFO level all the executed cypher query can be seen in the navigator console. + * Default is NONE + */ +popoto.logger.LEVEL = popoto.logger.LogLevels.INFO; + +/** + * Start popoto.js generation. + * The function requires the label to use as root element in the graph. + */ +popoto.start("PERSON"); + +/* do not zoom with scroll wheel */ +popoto.graph.WHEEL_ZOOM_ENABLED = false; + +/* show source and target relations */ +popoto.query.USE_RELATION_DIRECTION = true;