Mercurial > hg > NetworkVis
annotate popoto/js/app-ismi.js @ 9:0f4846255b20
updated for ismi-dev.
author | casties |
---|---|
date | Thu, 01 Oct 2015 17:35:56 +0200 |
parents | fa1b4fa5b4f8 |
children |
rev | line source |
---|---|
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 /** |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
2 * URL used to access Neo4j REST API to execute queries. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
3 * Update this parameter to your running server instance. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
4 * |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
5 * For more information on Neo4J REST API the documentation is available here: http://neo4j.com/docs/stable/rest-api-cypher.html |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
6 */ |
2 | 7 popoto.rest.CYPHER_URL = "https://ismi-dev.mpiwg-berlin.mpg.de/neo4j-ismi/db/data/transaction/commit"; |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
8 //popoto.rest.CYPHER_URL = "http://localhost:7474/db/data/transaction/commit"; |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
9 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
10 /** |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
11 * Add this authorization property if your Neo4j server uses basic HTTP authentication. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
12 * The value of this property must be "Basic <payload>", where "payload" is a base64 encoded string of "username:password". |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
13 * |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
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. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
15 * |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
16 * For example Base64 encoding value of "neo4j:password" is "bmVvNGo6cGFzc3dvcmQ=" |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
17 */ |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
18 popoto.rest.AUTHORIZATION = "Basic " + btoa("neo4j:neo5j"); |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
19 //popoto.rest.AUTHORIZATION = "Basic " + btoa("neo4j:eagrussell"); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
20 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
21 /** |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
22 * These functions fill the predefinedConstraints array for "PERSON" |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
23 * Called when the filter button is hit |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
24 * |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
25 * Uses the text box implementation currently |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
26 */ |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
27 // TODO: finish textbox implementation as backup |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
28 // have single filter button which on click sets constraints equal to d3.select("#constraintNUMBS)[0][0].value |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
29 // for a bunch of spots in the array |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
30 // will have to create only 1 d3.select |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
31 // the d3.select will need to know what constraints to pull from input boxes based on ids related to whether they |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
32 // are person/codex/witness/etc attributes and put them into the corresponding arrays |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
33 // personPredefinedConstraints codexPreDef |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
34 var personPredefinedConstraints = []; |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
35 var codexPredefinedConstraints = []; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
36 var witnessPredefinedConstraints = []; |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
37 d3.select("#filter-button").on("click", function (d) { |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
38 var person1 = d3.select("#person-constraint")[0][0].value; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
39 var person2 = d3.select("#person-constraint2")[0][0].value; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
40 |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
41 var codex1 = d3.select("#codex-constraint")[0][0].value; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
42 var codex2 = d3.select("#codex-constraint2")[0][0].value; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
43 |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
44 var witness1 = d3.select("#witness-constraint")[0][0].value; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
45 var witness2 = d3.select("#witness-constraint2")[0][0].value; |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
46 |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
47 if (person1.substring(person1.indexOf('"')+1,person1.lastIndexOf('"'))) personPredefinedConstraints.push(person1); |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
48 if (person2.substring(person2.indexOf('"')+1,person2.lastIndexOf('"'))) personPredefinedConstraints.push(person2); |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
49 |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
50 if (codex1.substring(codex1.indexOf('"')+1,codex1.lastIndexOf('"'))) codexPredefinedConstraints.push(codex1); |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
51 if (codex2.substring(codex2.indexOf('"')+1,codex2.lastIndexOf('"'))) codexPredefinedConstraints.push(codex2); |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
52 |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
53 if (witness1.substring(witness1.indexOf('"')+1,witness1.lastIndexOf('"'))) witnessPredefinedConstraints.push(witness1); |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
54 if (witness2.substring(witness2.indexOf('"')+1,witness2.lastIndexOf('"'))) witnessPredefinedConstraints.push(witness2); |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
55 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
56 // Recreate taxonomies panel |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
57 d3.select("#" + popoto.taxonomy.containerId).selectAll("ul").data([]).exit().remove(); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
58 popoto.taxonomy.createTaxonomyPanel(); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
59 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
60 popoto.tools.reset(); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
61 }); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
62 |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
63 d3.select("#clear-button").on("click", function (d) { |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
64 personPredefinedConstraints = []; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
65 codexPredefinedConstraints = []; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
66 witnessPredefinedConstraints = []; |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
67 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
68 // Recreate taxonomies panel |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
69 d3.select("#" + popoto.taxonomy.containerId).selectAll("ul").data([]).exit().remove(); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
70 popoto.taxonomy.createTaxonomyPanel(); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
71 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
72 popoto.tools.reset(); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
73 }); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
74 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
75 |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
76 /** |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
77 * Define the Label provider you need for your application. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
78 * This configuration is mandatory and should contain at least all the labels you could find in your graph model. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
79 * |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
80 * In this alpha version only nodes with a label are supported. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
81 * |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
82 * By default If no attributes are specified Neo4j internal ID will be used. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
83 * These label provider configuration can be used to customize the node display in the graph. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
84 * See www.popotojs.com or example for more details on available configuration options. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
85 */ |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
86 // TODO: add in predefined constraint functions for other nodeProviders |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
87 popoto.provider.nodeProviders = { |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
88 "CODEX": { |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
89 "returnAttributes": ["label", "ismi_id", "identifier"], |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
90 "displayAttribute": "label", |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
91 "getPredefinedConstraints": function (node) { |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
92 return codexPredefinedConstraints; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
93 }, |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
94 }, |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
95 "WITNESS": { |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
96 "returnAttributes": ["label", "ismi_id", "folios"], |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
97 "displayAttribute": "label", |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
98 "getPredefinedConstraints": function (node) { |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
99 return witnessPredefinedConstraints; |
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
100 }, |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
101 }, |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
102 "TEXT": { |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
103 "returnAttributes": ["label", "full_title", "ismi_id"], |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
104 "displayAttribute": "label", |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
105 //"getPredefinedConstraints": function (node) { |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
106 // return textPredefinedConstraints; |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
107 //}, |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
108 }, |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
109 "PERSON": { |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
110 "returnAttributes": ["label", "ismi_id", "death_date_text", "url"], |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
111 "displayAttribute": "label", |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
112 "getPredefinedConstraints": function (node) { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
113 return personPredefinedConstraints; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
114 }, |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
115 }, |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
116 "REPOSITORY": { |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
117 "returnAttributes": ["label", "ismi_id"], |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
118 "displayAttribute": "label", |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
119 //"getPredefinedConstraints": function (node) { |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
120 // return repositoryPredefinedConstraints; |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
121 //}, |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
122 }, |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
123 "FLORUIT_DATE": { |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
124 "isSearchable": false, |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
125 //"getPredefinedConstraints": function (node) { |
5
fa1b4fa5b4f8
ADDED: Table for person/codex/witness constraint boxes, reset button (currently leaves previous constraints in the text box)
alistair
parents:
4
diff
changeset
|
126 // return floruitPredefinedConstraints; |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
127 //}, |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
128 } |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
129 }; |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
130 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
131 /** |
4
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
132 * Popoto label provider |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
133 * Define the label provider used to customize the link displayed text: |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
134 */ |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
135 // TODO: ensure these cover all the different relations. Commented out for now. |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
136 /* |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
137 popoto.provider.linkProvider = { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
138 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
139 // Customize the text displayed on links: |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
140 "getLinkTextValue": function (link) { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
141 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
142 // The links labels are just changed in lower case in this example. |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
143 // But it is possible to use a localization mechanism here to replace values. |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
144 if (link.type === popoto.graph.link.LinkTypes.RELATION) { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
145 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
146 if (link.source.label == "PERSON") { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
147 switch (link.label) { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
148 case "was_student_of": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
149 return "was student of"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
150 case "is_prime_alias_name_of": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
151 return "is prime alias name of"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
152 case "was_born_in": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
153 return "was born in"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
154 case "lived_in": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
155 return "lived in"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
156 case "has_role": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
157 return "has role"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
158 case "has_floruit_date": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
159 return "has floruit date"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
160 case "died_in": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
161 return "died in"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
162 default : |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
163 return "" |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
164 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
165 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
166 if (link.source.label == "CODEX") { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
167 switch (link.label) { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
168 case "owned_by": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
169 return "owned by"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
170 case "is_alias_of": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
171 return "is alias of"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
172 case "is_part_of": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
173 return "is part of"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
174 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
175 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
176 if (link.source.label == "WITNESS") { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
177 switch (link.label) { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
178 case "was_copied_in": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
179 return "was copied in"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
180 case "was_studied_by": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
181 return "was studied by"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
182 case "had_patron": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
183 return "had patron"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
184 case "is_part_of": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
185 return "is part of"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
186 case "is_exemplar_of": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
187 return "is exemplar of"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
188 case "has_title_written_as": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
189 return "has title written as"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
190 case "has_author_written_as": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
191 return "as author written as"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
192 case "was_copied_by": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
193 return "was copied by"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
194 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
195 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
196 if (link.source.label == "PLACE") { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
197 switch (link.label) { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
198 case "is_part_of": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
199 return "is part of"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
200 case "is_in": |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
201 return "is in"; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
202 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
203 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
204 } else { |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
205 return popoto.provider.getSemanticValue(link.target); |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
206 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
207 } |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
208 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
209 }; |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
210 */ |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
211 |
72dc19d750ad
ADDED: Basic text box implementation for predefined constraints, to be added to in the coming week. nodeProvider, linkProvider additions.
alistair
parents:
2
diff
changeset
|
212 /** |
1
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
213 * Here a listener is used to retrieve the total results count and update the page accordingly. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
214 * This listener will be called on every graph modification. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
215 */ |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
216 popoto.result.onTotalResultCount(function (count) { |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
217 document.getElementById("result-total-count").innerHTML = "(" + count + ")"; |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
218 }); |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
219 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
220 /** |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
221 * The number of results returned can be changed with the following parameter. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
222 * Default value is 100. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
223 * |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
224 * Note that in this current alpha version no pagination mechanism is available in displayed results |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
225 */ |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
226 popoto.query.RESULTS_PAGE_SIZE = 1000; |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
227 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
228 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
229 /** |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
230 * For the alpha version, popoto.js has been generated with debug traces you can activate with the following properties: |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
231 * The value can be one in DEBUG, INFO, WARN, ERROR, NONE. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
232 * |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
233 * With INFO level all the executed cypher query can be seen in the navigator console. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
234 * Default is NONE |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
235 */ |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
236 popoto.logger.LEVEL = popoto.logger.LogLevels.INFO; |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
237 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
238 /** |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
239 * Start popoto.js generation. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
240 * The function requires the label to use as root element in the graph. |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
241 */ |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
242 popoto.start("PERSON"); |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
243 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
244 /* do not zoom with scroll wheel */ |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
245 popoto.graph.WHEEL_ZOOM_ENABLED = false; |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
246 |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
247 /* show source and target relations */ |
db013b2f3e10
added displayAttribute to show on individual nodes.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
248 popoto.query.USE_RELATION_DIRECTION = true; |