I have a d3.js scatterplot based off of this: http://bl.ocks.org/nsonnad/4481531
I'm attempting to implement a feature that enables filtering based on different criteria, such as country in the provided example (each represented by a color bubble).
The data is sourced from a .csv file and when logged, it appears as an object structure like this:
[0 … 99]
0: Object
attribute: "INFJ"
category: "Personality Type"
incidence: "1.04"
index_value: "65"
main_grouping: "Behaviors"
__proto__: Object
1: Object
2: Object
3: Object
ETC...
My goal is to filter all rows with a specific main_grouping
. While I can retrieve a list of all main_grouping
s, I need help moving forward.
d3.csv("example.csv", function(data) {
$.each(data, function (index, value) {
console.log(value.main_grouping);
});
I am unsure how to proceed next or how to achieve the desired outcome - selecting a certain main_grouping
(to be done via a dropdown menu) and retrieving only those rows for use in the scatterplot rendering script.
Since there's no option for server-side processing, the solution has to be implemented client-side.