Mercurial > hg > NetworkVis
comparison popoto_dev/js/app-template.js @ 12:d67c5ad47709
implementation with dropdown popup, unfinished
author | alistair |
---|---|
date | Fri, 02 Oct 2015 01:08:46 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:5674d1cf5ab2 | 12:d67c5ad47709 |
---|---|
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/neo4j-ismi/db/data/transaction/commit"; | |
8 | |
9 /** | |
10 * Add this authorization property if your Neo4j server uses basic HTTP authentication. | |
11 * The value of this property must be "Basic <payload>", where "payload" is a base64 encoded string of "username:password". | |
12 * | |
13 * "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. | |
14 * | |
15 * For example Base64 encoding value of "neo4j:password" is "bmVvNGo6cGFzc3dvcmQ=" | |
16 */ | |
17 popoto.rest.AUTHORIZATION = "Basic " + btoa("neo4j:neo5j"); | |
18 | |
19 /** | |
20 * Define the Label provider you need for your application. | |
21 * This configuration is mandatory and should contain at least all the labels you could find in your graph model. | |
22 * | |
23 * In this alpha version only nodes with a label are supported. | |
24 * | |
25 * By default If no attributes are specified Neo4j internal ID will be used. | |
26 * These label provider configuration can be used to customize the node display in the graph. | |
27 * See www.popotojs.com or example for more details on available configuration options. | |
28 */ | |
29 popoto.provider.nodeProviders = { | |
30 "CODEX": { | |
31 "returnAttributes": ["label", "ismi_id", "identifier"], | |
32 "constraintAttribute": "ismi_id" | |
33 }, | |
34 "WITNESS": { | |
35 "returnAttributes": ["label", "ismi_id", "folios"], | |
36 "constraintAttribute": "ismi_id" | |
37 }, | |
38 "TEXT": { | |
39 "returnAttributes": ["label", "full_title", "ismi_id"], | |
40 "constraintAttribute": "ismi_id" | |
41 }, | |
42 "PERSON": { | |
43 "returnAttributes": ["label", "ismi_id", "death_date_text", "url"], | |
44 "constraintAttribute": "ismi_id" | |
45 }, | |
46 "REPOSITORY": { | |
47 "returnAttributes": ["label", "ismi_id"], | |
48 "constraintAttribute": "ismi_id" | |
49 } | |
50 }; | |
51 | |
52 /** | |
53 * Here a listener is used to retrieve the total results count and update the page accordingly. | |
54 * This listener will be called on every graph modification. | |
55 */ | |
56 popoto.result.onTotalResultCount(function (count) { | |
57 document.getElementById("result-total-count").innerHTML = "(" + count + ")"; | |
58 }); | |
59 | |
60 /** | |
61 * The number of results returned can be changed with the following parameter. | |
62 * Default value is 100. | |
63 * | |
64 * Note that in this current alpha version no pagination mechanism is available in displayed results | |
65 */ | |
66 //popoto.query.RESULTS_PAGE_SIZE = 100; | |
67 | |
68 | |
69 /** | |
70 * For the alpha version, popoto.js has been generated with debug traces you can activate with the following properties: | |
71 * The value can be one in DEBUG, INFO, WARN, ERROR, NONE. | |
72 * | |
73 * With INFO level all the executed cypher query can be seen in the navigator console. | |
74 * Default is NONE | |
75 */ | |
76 popoto.logger.LEVEL = popoto.logger.LogLevels.INFO; | |
77 | |
78 /** | |
79 * Start popoto.js generation. | |
80 * The function requires the label to use as root element in the graph. | |
81 */ | |
82 popoto.start("PERSON"); | |
83 | |
84 /* do not zoom with scroll wheel */ | |
85 popoto.graph.WHEEL_ZOOM_ENABLED = false; |