I currently have two arrays: one is a list of numbers called nums, and the other is a list of strings titled places.
For example:
nums=[1,2,3,4,5]
places = ["house","gym", "work", "school", "park"]
Both arrays are the same length.
I am looking to create a bar chart using these arrays that resembles the one found at http://bl.ocks.org/mbostock/3885304, but with data sourced from these arrays instead of a tsv file.
In Mike Bostock's code, the data is read in from a tsv file using the following code snippet:
d3.tsv("data.tsv", type, function(error, data) {
x.domain(data.map(function(d) { return d.letter; }));
y.domain([0, d3.max(data, function(d) { return d.frequency; })]);
Furthermore, I will be receiving updates from a server where some bars will change while others remain constant. Instead of refreshing the page, I aim to update only the changing bars. Would it be advisable to use a library like React for this project, or do you have any other recommendations? Any assistance would be greatly appreciated. Thank you!