Skip to content

Dashboard: issue when filtering by date #106

@mapofemergence

Description

@mapofemergence

I believe I found an issue with the timeline (ionRangeSlider) and the metrics crossfiltering: when filtering the dashboard by time interval, the actual time range presented does not include the upper limit.
This also implies that, when moving the slider back to the latest date, the graph presented does not match the one shown at first load time.
This issue is almost irrelevant for big and active networks, which receive frequent updates and where the differences between time intervals are minimal. But for smaller or younger communities, with much sparser activity, this becomes very evident and confusing.

To see what I mean, you can check here (ignore the poor size of the community and the lack of recent updates, it actually helps making the issue clear):
http://www.futuroanteriore.org/sviluppo/edgesense-dashboard
and:

  1. drag the time slider left to any date
  2. drag the slider back to the far right (latest date)
    you will see that the graph doesn't get back to what it was when first loaded.

I believe the issue is here:
https://github.com/Wikitalia/edgesense/blob/master/static/js/edgesense/dashboard.js#L149

If I'm not mistaken, in lines like these ones:

metrics_bydate.filter([0, current_metrics.date]);
nodes_bydate.filter([0, current_metrics.date]);
edges_bydate.filter([0, current_metrics.date]);

the limits are actually excluded; so if:
current_metrics = data['metrics'][i];
the interval is actually representing data up to data['metrics'][i - 1]

This could be fixed with something like:

current_metrics = data['metrics'][i];
if (current_metrics == last_metrics){
	// reset all filters
	metrics_bydate.filterAll();
	nodes_bydate.filterAll();
	edges_bydate.filterAll();
} else {
	edge_metrics = data['metrics'][i + 1];
	metrics_bydate.filter([0, edge_metrics.date]);
	nodes_bydate.filter([0, edge_metrics.date]);
	edges_bydate.filter([0, edge_metrics.date]);
}

(maybe crossfilter provides more elegant ways but I couldn't find any)

I would correct this myself but I'd need to first set a testing environment: I'm working on a completely re-factored version of the code (I recently made @luca know and I will submit it for evaluation in the "v2" branch which he prepared for the purpose), so I'm not ready to work and test both versions just yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions