uclab-potsdam / kollisionen

Spiral, timelines and network visualizations of the life of Sergei Eisenstein.
https://uclab-potsdam.github.io/kollisionen
MIT License
3 stars 0 forks source link

timeline: the frequency wise sorting has a 'string matching' issues so Russia also shows Rus #57

Closed markiaaan closed 2 years ago

arranr commented 2 years ago

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?

arranr commented 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);
        });

    });`
markiaaan commented 2 years ago

I think we can make it work by splitting the keywords. (I did this for search in the network as well)

arranr commented 2 years ago

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(";")