Closed markiaaan closed 2 years ago
And this is the array of keywords that is used to generate the background timelines
`var keywordsCount = [];
keywordsData.forEach(function(d,i){
var keywords = d.people.split(";");
keywords.forEach(function(d,i){
if (keywordsCount.indexOf(d) == -1 && d != "") keywordsCount.push(d);
});
var keywords = d.places.split(";");
keywords.forEach(function(d,i){
if (keywordsCount.indexOf(d) == -1 && d != "") keywordsCount.push(d);
});
var keywords = d.works.split(";");
keywords.forEach(function(d,i){
if (keywordsCount.indexOf(d) == -1 && d != "") keywordsCount.push(d);
});
var keywords = d.artistic.split(";");
keywords.forEach(function(d,i){
if (keywordsCount.indexOf(d) == -1 && d != "") keywordsCount.push(d);
});
var keywords = d.additional.split(";");
keywords.forEach(function(d,i){
if (keywordsCount.indexOf(d) == -1 && d != "") keywordsCount.push(d);
});
});`
I think we can make it work by splitting the keywords. (I did this for search in the network as well)
where you do this?
networkData[i]["peopleSplit"] = networkData[i]["people"].split(";") networkData[i]["placesSplit"] = networkData[i]["places"].split(";") networkData[i]["artisticSplit"] = networkData[i]["artistic"].split(";") networkData[i]["worksSplit"] = networkData[i]["works"].split(";") networkData[i]["additionalSplit"] = networkData[i]["additional"].split(";")
That is because of the way it compares an array of keywords against the original data:
.data(keywordsData.filter(function (d) { if (d.vend.includes("-")) { return (d.people.includes(D) || d.places.includes(D) || d.works.includes(D) || d.artistic.includes(D) ||d.additional.includes(D)) && d.vstart.includes("/") == false && d.vstart.includes(",") == false && d.vstart != "" } }))
any ideas for how to better do this?