Detecting the loops ahead of time could be difficult (but likely worth it
for the possible performance gains). You could hijack the Sankey's error
to locate cycles, though:
google.visualization.events.addListener(chart, 'error', function (e) {
var loopErrorMatch = e.message.match(/Cycle found in rows:
((\d+,)*\d+)/);
if (loopErrorMatch && loopErrorMatch.length > 1) {
// remove the error message
google.visualization.errors.removeError(e.id);
var rows = loopErrorMatch[1].split(',');
// use rows to figure out what you need to filter out
// then redraw your chart
// you should account for the possibility of multiple cycles
// I suspect that the chart will only throw an error for one cycle
at a time
// until they are all cleared out
}
});
On Wednesday, August 13, 2014 10:57:13 AM UTC-4, John McCauley wrote:
>
> Since the source code isn't readily available I am having some difficulty
> determining which data I should filter out. Anyone else experience a
> similar situation?
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.