Commit 1b8aaff3 authored by Themousaillon's avatar Themousaillon

add filterAll

parent 8d71edf2
......@@ -6,19 +6,21 @@
"password": "1234"
},
"keywordSearch": {
"placeholder": "Enter keyword",
"selection": [
{
"placeholder": "Search in regests",
"layer": "regest",
"option": "Regest",
"query": "MATCH (n:Regesta) WHERE (n.ident=~ '.*(?i)%KEYWORD%.*') AND NOT id(n) in %CULLS% WITH distinct n as n ORDER BY n.app DESC RETURN id(n) as id, 'regest' as type, n.ident as title, n.app as app, n.rec as rec, n.text as tooltip"
},
{
"placeholder": "Search in entries",
"layer": "entry",
"option": "Entry (Person, Place, Thing, Event, other Entry)",
"query": "MATCH (n:IndexEntry) WHERE ((n.label=~ '.*(?i)%KEYWORD%.*') OR (n.path=~ '.*(?i)%KEYWORD%.*')) AND NOT id(n) in %CULLS% WITH distinct n as n ORDER BY n.app DESC RETURN id(n) as id, CASE WHEN \"IndexPerson\" in labels(n) THEN \"person\" WHEN \"IndexPlace\" in labels(n) THEN \"place\" WHEN \"IndexThing\" in labels(n) THEN \"thing\" WHEN \"IndexEvent\" in labels(n) THEN \"event\" ELSE \"entry\" END as type, n.label as title, n.app as app, n.rec as rec, n.path as tooltip"
},
{
"placeholder": "Search in lemmata",
"layer": "lemma",
"option": "Lemma",
"query": "MATCH (n) WHERE (n.lemma=~ '.*(?i)%KEYWORD%.*') AND NOT id(n) in %CULLS% WITH distinct n as n ORDER BY n.app DESC RETURN id(n) as id, \"lemma\" as type, n.lemma as title, n.app as app"
......@@ -47,7 +49,7 @@
"regest",
"event",
"person",
"place",
"indPlace",
"literature",
"place",
"reference",
......@@ -426,8 +428,8 @@
"label": "date",
"type": "date",
"filter": {
"start": "1400",
"end": "1500"
"start": "1440",
"end": "1520"
},
"show": true,
"link": false,
......
......@@ -6,14 +6,15 @@
"password": "1234"
},
"keywordSearch": {
"placeholder": "Enter transliterated name",
"selection": [
{
"placeholder": "Search in sources",
"layer": "source",
"option": "Source",
"query": "MATCH (s:Source) WHERE (s.title=~ '.*(?i)%KEYWORD%.*') AND NOT id(s) in %CULLS% WITH distinct s as s ORDER BY s.title DESC RETURN id(s) as id, 'Source' as type, s.title as title, s.app as app"
},
{
"placeholder": "Enter transliterated name",
"layer": "entity",
"option": "Entity",
"query": "MATCH (n:Entity) WHERE (n.name=~ '.*(?i)%KEYWORD%.*') AND NOT id(n) in %CULLS% 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"
......@@ -62,9 +63,8 @@
"text": "Related Entities",
"icon": "fa-users",
"header": "Entities related with %PARENTS%",
"queryUnion": "UNWIND %PARENTSIDS% as egoid MATCH (e)-[r:related_with]->(ego) WHERE id(ego) = egoid WITH egoid, collect(distinct id(e)) as relids UNWIND relids as x WITH x, count(x) as c WITH collect(distinct x) as relations MATCH (n)-[r:related_with]->(ego) WHERE id(ego) IN %PARENTSIDS% AND id(n) in relations AND NOT id(n) in %CULLS% 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, collect(r.type) as relation, n.app as app, n.praenomen+' '+n.nomen+' '+n.cognomen as tooltip",
"queryIntersection": "UNWIND %PARENTSIDS% as egoid MATCH (e)-[r:related_with]->(ego) WHERE id(ego) = egoid WITH egoid, collect(distinct id(e)) as relids UNWIND relids as x WITH x, count(x) as c WHERE c=size(%PARENTSIDS%) WITH collect(distinct x) as relations MATCH (n)-[r:related_with]->(ego) WHERE id(ego) IN %PARENTSIDS% AND id(n) in relations AND NOT id(n) in %CULLS% 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, collect(r.type) as relation, n.app as app, n.praenomen+' '+n.nomen+' '+n.cognomen as tooltip"
},
"queryUnion": "UNWIND %PARENTSIDS% as egoid MATCH (e)-[r]->(ego) WHERE id(ego) = egoid WITH egoid, collect(distinct id(e)) as relids UNWIND relids as x WITH x, count(x) as c WITH collect(distinct x) as relations MATCH (n)-[r:related_with]->(ego) WHERE id(ego) IN %PARENTSIDS% AND id(n) in relations AND NOT id(n) in %CULLS% 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, collect(type(r)) as relation, n.app as app, n.praenomen+' '+n.nomen+' '+n.cognomen as tooltip",
"queryIntersection": "UNWIND %PARENTSIDS% as egoid MATCH (e)-[r]->(ego) WHERE id(ego) = egoid WITH egoid, collect(distinct id(e)) as relids UNWIND relids as x WITH x, count(x) as c WHERE c=size(%PARENTSIDS%) WITH collect(distinct x) as relations MATCH (n)-[r:related_with]->(ego) WHERE id(ego) IN %PARENTSIDS% AND id(n) in relations AND NOT id(n) in %CULLS% 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, collect(type(r)) as relation, n.app as app, n.praenomen+' '+n.nomen+' '+n.cognomen as tooltip" },
{
"name": "sources",
"text": "Sources",
......
......@@ -126,7 +126,6 @@ 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
......@@ -148,15 +147,17 @@ class NodeFilters {
return true
}
filterAll = (keywords, startDate, endDate) => nodes => {
filterAllByNode = (keywords, startDate, endDate) => node => {
const keywordsFilter = this.filterByKeywords(keywords)
const dateFilter = this.filterByDate(startDate, endDate)
nodes.filterApply(
(node) => dateFilter(node) && keywordsFilter(node),
this.ifTrue,
this.ifFalse
)
return dateFilter(node) && keywordsFilter(node)
}
filterAll = (keywords, startDate, endDate) => nodes => nodes.filterApply(
this.filterAllByNode(keywords, startDate, endDate),
this.ifTrue,
this.ifFalse
)
}
/**
......@@ -297,7 +298,6 @@ export class Graph2d {
this.collapseChildren(ids, nodeType, relationType, recursive)
}
addComponents = f => (nodes, edges) => {
nodes.forEach(node => {
if (node){
......
......@@ -106,13 +106,18 @@ function start(settings, login, password) {
// Setup interface
$('#db_name').html(settings.database.name);
//$('#keyword').focus();
$('#keyword').prop('placeholder', settings.keywordSearch.placeholder);
settings.keywordSearch.selection.forEach((s) => {
$('').prop('placeholder', settings.keywordSearch.placeholder);
settings.keywordSearch.selection.forEach((s, ind) => {
console.log("index: ")
let o = new Option(s.option, s.layer);
o.nodeTypes = settings.layerTypes.find(x => x.name === s.layer).nodeTypes
o.placeholder = settings.keywordSearch.selection[ind].placeholder
$(o).html(s.option);
$("#input-graph-type").append(o);
});
$("#keyword").attr("placeholder", $("#input-graph-type :selected")[0].placeholder)
$("#input-graph-type").on("change",
() => $("#keyword").attr("placeholder", $("#input-graph-type :selected")[0].placeholder))
settings.source.properties.forEach((property) => {
let option = settings.source.options[property];
......
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