comparison 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
comparison
equal deleted inserted replaced
0:3b8b5aa8ab65 1:db013b2f3e10
1 /**
2 * URL used to access Neo4j REST API to execute queries.
3 * Update this parameter to your running server instance.
4 *
5 * For more information on Neo4J REST API the documentation is available here: http://neo4j.com/docs/stable/rest-api-cypher.html
6 */
7 popoto.rest.CYPHER_URL = "https://ismi-dev.mpiwg-berlin.mpg.de:7473/db/data/transaction/commit";
8 //popoto.rest.CYPHER_URL = "http://localhost:7474/db/data/transaction/commit";
9
10 /**
11 * Add this authorization property if your Neo4j server uses basic HTTP authentication.
12 * The value of this property must be "Basic <payload>", where "payload" is a base64 encoded string of "username:password".
13 *
14 * "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.
15 *
16 * For example Base64 encoding value of "neo4j:password" is "bmVvNGo6cGFzc3dvcmQ="
17 */
18 popoto.rest.AUTHORIZATION = "Basic " + btoa("neo4j:neo5j");
19
20 /**
21 * Define the Label provider you need for your application.
22 * This configuration is mandatory and should contain at least all the labels you could find in your graph model.
23 *
24 * In this alpha version only nodes with a label are supported.
25 *
26 * By default If no attributes are specified Neo4j internal ID will be used.
27 * These label provider configuration can be used to customize the node display in the graph.
28 * See www.popotojs.com or example for more details on available configuration options.
29 */
30 popoto.provider.nodeProviders = {
31 "CODEX": {
32 "returnAttributes": ["label", "ismi_id", "identifier"],
33 "displayAttribute": "label"
34 },
35 "WITNESS": {
36 "returnAttributes": ["label", "ismi_id", "folios"],
37 "displayAttribute": "label"
38 },
39 "TEXT": {
40 "returnAttributes": ["label", "full_title", "ismi_id"],
41 "displayAttribute": "label"
42 },
43 "PERSON": {
44 "returnAttributes": ["label", "ismi_id", "death_date_text", "url"],
45 "displayAttribute": "label"
46 },
47 "REPOSITORY": {
48 "returnAttributes": ["label", "ismi_id"],
49 "displayAttribute": "label"
50 },
51 "FLORUIT_DATE": {
52 "isSearchable": false
53 }
54 };
55
56 /**
57 * Here a listener is used to retrieve the total results count and update the page accordingly.
58 * This listener will be called on every graph modification.
59 */
60 popoto.result.onTotalResultCount(function (count) {
61 document.getElementById("result-total-count").innerHTML = "(" + count + ")";
62 });
63
64 /**
65 * The number of results returned can be changed with the following parameter.
66 * Default value is 100.
67 *
68 * Note that in this current alpha version no pagination mechanism is available in displayed results
69 */
70 popoto.query.RESULTS_PAGE_SIZE = 1000;
71
72
73 /**
74 * For the alpha version, popoto.js has been generated with debug traces you can activate with the following properties:
75 * The value can be one in DEBUG, INFO, WARN, ERROR, NONE.
76 *
77 * With INFO level all the executed cypher query can be seen in the navigator console.
78 * Default is NONE
79 */
80 popoto.logger.LEVEL = popoto.logger.LogLevels.INFO;
81
82 /**
83 * Start popoto.js generation.
84 * The function requires the label to use as root element in the graph.
85 */
86 popoto.start("PERSON");
87
88 /* do not zoom with scroll wheel */
89 popoto.graph.WHEEL_ZOOM_ENABLED = false;
90
91 /* show source and target relations */
92 popoto.query.USE_RELATION_DIRECTION = true;