Currently experimenting with Dygraph and have successfully integrated a reloader feature that adds high-resolution data as users zoom in on the graph.
To maintain the original file boundaries, I am preserving the existing data and inserting the newly loaded data at the respective zoom intervals using the following method:
function optimizeDataReplacement(graph_tool, high_res_data) {
...
for (i = 0; i < current_set.length; i++) {
point = current_set[i];
// NOTE: Each point is [time_in_milliseconds, value_for_graph]
time_value = point[0];
if (time_value < lower_limit || time_value > higher_limit) {
new_set.push(point);
} else if (is_replaced === undefined) {
is_replaced = true;
new_set = new_set.concat(high_res_data_set);
}
}
...
}
I'm curious if there's a more efficient way to achieve this, as the performance of graph rendering noticeably decreases with increased data volume.
Question:
What is the quickest method to substitute a section of an array with another array?
Appreciate the insights!