Commit 8618f774 authored by unknown's avatar unknown

Fixed merge conflict

parents 9722e69a 8d71edf2
......@@ -20,10 +20,31 @@
}
]
},
"graph2d": {
"queries": {
"getComponentsAutoExpend": "MATCH (n) WHERE id(n) in %IDS% AND NOT id(n) in %CULLS% WITH n OPTIONAL MATCH (n)-[link]-(m) WHERE NOT id(m) in %CULLS% WITH n as node1, m as node2, CASE WHEN link is null then null else {source: id(startnode(link)), target: id(endnode(link)), type: type(link) } END as link return node1, node2, link"
}
},
"searchTools": {
"queries": {
"getAllNodes": "MATCH (n) return n"
}
},
"layerTypes" : [
{
"name": "entity",
"names": "entities",
"nodeTypes": [
"dacia",
"dalmatia",
"moesiaInf",
"moesiaSup",
"pannoniaSup",
"source",
"entity"
],
"nodeSize": "app",
"graphQuery": "MATCH (n:Entity)-[:appears_in]->(r:Source) WHERE id(n) in %IDS% WITH { node:n, resources: collect ({ date: r.startDate, ext_link: r.ext_link }) } as nodeinfo WITH collect(nodeinfo) as nodeinfos UNWIND nodeinfos as ni1 UNWIND nodeinfos as ni2 WITH ni1, ni2, ni1.node as n1, ni2.node as n2 WHERE id(n1) <= id(n2) MATCH (n1)-[:appears_in]->(r:Source) WITH ni1 as ni1, ni2 as ni2, ni1.node as n1, ni2.node as n2, collect(distinct r) as resources MATCH (n2)-[:appears_in]->(r:Source) WHERE r in resources WITH r, ni1, ni2, CASE WHEN 'Dacia' in labels(ni1.node) THEN 'Dacia' WHEN 'MoesiaInf' in labels(ni1.node) THEN 'Moesia Inferior' WHEN 'MoesiaSup' in labels(ni1.node) THEN 'Moesia Superior' WHEN 'PannoniaSup' in labels(ni1.node) THEN 'Pannonia Superior' WHEN 'Dalmatia' in labels(ni1.node) THEN 'Dalmatia' END as type1, CASE WHEN 'Dacia' in labels(ni2.node) THEN 'Dacia' WHEN 'MoesiaInf' in labels(ni2.node) THEN 'Moesia Inferior' WHEN 'MoesiaSup' in labels(ni2.node) THEN 'Moesia Superior' WHEN 'PannoniaSup' in labels(ni2.node) THEN 'Pannonia Superior' WHEN 'Dalmatia' in labels(ni2.node) THEN 'Dalmatia' END as type2 WITH { node1: [ { id: id(ni1.node), title: ni1.node.name, type: type1, resources: ni1.resources, tooltip: ni1.node.praenomen+' '+ni1.node.nomen+' '+ni1.node.cognomen +(CASE WHEN ni1.node.gender='Male' THEN ', Male' ELSE ', Female' END) +(CASE WHEN ni1.node.citizen THEN ' / Citizen' ELSE '' END) +(CASE WHEN ni1.node.libertus THEN ' / Libertus' ELSE '' END) +(CASE WHEN ni1.node.veteranus THEN ' / Veteranus' ELSE '' END) +(CASE WHEN ni1.node.peregrine THEN ' / Peregrine' ELSE '' END) +(CASE WHEN ni1.node.slave THEN ' / Slave' ELSE '' END) +(CASE WHEN EXISTS (ni1.node.occupation) THEN ' / Occupation: '+ni1.node.occupation ELSE '' END) } ], node2: [ { id: id(ni2.node), title: ni2.node.name, type: type2, resources: ni2.resources, tooltip: ni2.node.praenomen+' '+ni2.node.nomen+' '+ni2.node.cognomen +(CASE WHEN ni2.node.gender='Male' THEN ', Male' ELSE ', Female' END) +(CASE WHEN ni2.node.citizen THEN ' / Citizen' ELSE '' END) +(CASE WHEN ni2.node.libertus THEN ' / Libertus' ELSE '' END) +(CASE WHEN ni2.node.veteranus THEN ' / Veteranus' ELSE '' END) +(CASE WHEN ni2.node.peregrine THEN ' / Peregrine' ELSE '' END) +(CASE WHEN ni2.node.slave THEN ' / Slave' ELSE '' END) +(CASE WHEN EXISTS (ni2.node.occupation) THEN ' / Occupation: '+ni2.node.occupation ELSE '' END) } ], resources: collect ({ date: r.startDate, ext_link: r.ext_link }) } as edge RETURN { edges: collect(edge) }",
"tableQuery": "MATCH (n:Entity) WHERE id(n) in %IDS% WITH distinct n as n ORDER BY n.app DESC RETURN id(n) as id, CASE WHEN 'Dacia' in labels(n) THEN 'Dacia' WHEN 'MoesiaInf' in labels(n) THEN 'Moesia Inferior' WHEN 'MoesiaSup' in labels(n) THEN 'Moesia Superior' WHEN 'PannoniaSup' in labels(n) THEN 'Pannonia Superior' WHEN 'Dalmatia' in labels(n) THEN 'Dalmatia' END as type, n.name as title, n.app as app, n.praenomen+' '+n.nomen+' '+n.cognomen +(CASE WHEN n.gender='Male' THEN ', Male' ELSE ', Female' END) +(CASE WHEN n.citizen THEN ' / Citizen' ELSE '' END) +(CASE WHEN n.libertus THEN ' / Libertus' ELSE '' END) +(CASE WHEN n.veteranus THEN ' / Veteranus' ELSE '' END) +(CASE WHEN n.peregrine THEN ' / Peregrine' ELSE '' END) +(CASE WHEN n.slave THEN ' / Slave' ELSE '' END) +(CASE WHEN EXISTS (n.occupation) THEN ' / Occupation: '+n.occupation ELSE '' END) as tooltip",
......@@ -64,6 +85,7 @@
{
"name": "source",
"names": "sources",
"nodeTypes": ["source"],
"nodeSize": "app",
"graphQuery": "MATCH (r:Source) WHERE id(r) in %IDS% WITH { node:r, resources: collect ({ date: r.startDate, ext_link: r.ext_link }) } as nodeinfo WITH collect(nodeinfo) as nodeinfos UNWIND nodeinfos as ni1 UNWIND nodeinfos as ni2 WITH ni1, ni2, ni1.node as n1, ni2.node as n2 WHERE id(n1) = id(n2) WITH ni1, ni2, 'Source' as type1, 'Source' as type2 WITH { node1: [ { id: id(ni1.node), title: ni1.node.title, type: type1, resources: ni1.resources } ], node2: [ { id: id(ni2.node), title: ni2.node.title, type: type2, resources: ni2.resources } ], resources: collect ( ni1.resources )} as edge RETURN { edges: collect(edge) }",
"tableQuery": "MATCH (r:Source) WHERE id(r) in %IDS% WITH distinct r as r ORDER BY r.title DESC RETURN id(r) as id, 'Source' as type, r.title as title, r.app as app",
......@@ -125,6 +147,83 @@
}
],
"fieldNames": {
"dateFields": ["startDate", "endDate"]
},
"nodeTypes2": {
"dacia": {
"labelField": "name",
"color": "#FF7F00",
"icon": ""
},
"dalmatia": {
"labelField": "name",
"color": "#FF7F00",
"icon": ""
},
"entity": {
"labelField": "name",
"color": "#FF55FF",
"icon": ""
},
"moesiaInf": {
"labelField": "name",
"color": "#FF0000",
"icon": ""
},
"moesiaSup": {
"labelField": "name",
"color": "#BB7000",
"icon": ""
},
"pannoniaSup": {
"labelField": "label",
"color": "#BB7000",
"icon": ""
},
"source": {
"labelField": "title",
"color": "#41C4F4",
"icon": ""
}
},
"nameConversion": {
"Dacia": "dacia",
"Dalmatia": "dalmatia",
"MoesiaInf": "moesiaInf",
"MoesiaSup": "moesiaSup",
"PannoniaSup": "pannoniaSup",
"Source": "source",
"Entity": "entity"
},
"inverseNameConversion": {
"datia": "Dacia",
"dalmatia": "Dalmatia",
"moesiaInf": "MoesiaInf",
"moesiaSup": "MoesiaSup",
"pannoniaSup": "PannoniaSup",
"source": "Source",
"entity": "Entity"
},
"typeOrder" : [
"Dacia",
"Dalmatia",
"MoesiaInf",
"MoesiaSup",
"PannoniaSup",
"Source",
"Entity"
],
"filterable": {
"date": ["source"],
"keywords": ["source"]
},
"source": {
"name": "source",
"names": "sources",
......
......@@ -126,6 +126,7 @@ class NodeFilters {
* @param endDate sould be a @Date object
*/
filterByDate = (startDate, endDate) => node => {
console.log("node", node, startDate, endDate)
const filterable = this._settings.filterable["date"]
if (node.collapsed)
return false
......
......@@ -267,8 +267,7 @@ export class Graph2D {
}
filterByDate = (dateValues) => {
const startDate = new Date(dateValues[0].innerHTML);
const endDate = new Date(dateValues[1].innerHTML);
const [startDate, endDate] = dateValues;
this.graph2d.filter([], startDate, endDate);
this.applyFilterToGraph();
}
......
......@@ -20,6 +20,15 @@ const reggF3Settings = require('../../settings/regesta.json');
const Romans1by1Settings = require('../../settings/romans1by1.json');
const settingsList = [reggF3Settings, cvceSettings, Romans1by1Settings];
const toIso = (dateValue) => {
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
let [day, month, year] = dateValue.innerHTML.split(" ")
month = months.findIndex(x => x === month)
let date = new Date(year, month, day)
date.setFullYear(year)
return date
}
function setupDateFilter(app, newGraph, id, start, end) {
let dateSlider = document.getElementById(id + '-slider');
......@@ -66,10 +75,12 @@ function setupDateFilter(app, newGraph, id, start, end) {
document.getElementById(id + '-end')
];
dateSlider.noUiSlider.on('update', function (values, handle) {
dateValues[handle].innerHTML = values[handle];
app.updateFilter();
newGraph.filterByDate(dateValues);
newGraph.filterByDate(dateValues.map(toIso));
});
}
......@@ -239,6 +250,7 @@ function start(settings, login, password) {
$( "#keyword" ).on("input", () =>{
const searchString = $("#keyword")[0].value
const nodeTypes = $("#input-graph-type")[0].selectedOptions[0].nodeTypes
console.log(nodeTypes)
const results = entrySearch.searchLayer(searchString, nodeTypes)
console.log(results)
$("#suggestions").remove()
......@@ -433,8 +445,8 @@ module.exports = {
settingsList.forEach((s, i) => {
options[i] = s.database.name;
});
// setTimeout(() => $(".swal2-confirm").click(), 100)
// setTimeout(() => $(".swal2-confirm").click(), 150)
//setTimeout(() => $(".swal2-confirm").click(), 100)
//setTimeout(() => $(".swal2-confirm").click(), 150)
return alert.select('Choose a database : ', null, options).then((choice) => {
let settings = settingsList[choice];
return alert.credentials('Connexion', settings.database.login, !!settings.database.password ? settings.database.password : "").then((credentials) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment