The graph and text are correct (yet I am still confused about how things in group work together) but I would like the graph to only show elements where the variance is bigger than one, but cannot find a way.
groupedData is the grouped data It’s the result of grouping on x. In other words, all the data points that share the same value of x are put together in an array, which is then passed as an argument to the reducer defined in the outputs.
In general, if you had a corresponding input (like for “y”), it would not receive the whole data for each group, but just the values of y. The function is called for each group.
One important thing to note is that groupedData isn’t a name defined by Plot, it’s simply the parameter name that Fil chose for his example. It would be equally valid (though less readable) to write the filter as
As for the relationship between those two fields, the groupX function defines that relation. The way it is specified is that it goes through all the fields in the second object (the input object), except x (because of groupX). For each of those fields it creates groups of values that share the same value for x.
Then for each of those groups, it consults the output object (the first one) to figure out what to do with the group. In this case, the text field of the output says to compute the variance. So you might say that the text portion of this example could be alternately expressed with these instructions:
Group all rows in dataus1 by the x field, which is calculated from the generation column of the row.
For each group, calculate the variance of the pricePervCPU column.
Assign that caculated variance to the “text” output channel in the plot.
The fields in the input and output are always matched by the channel name. The input’s text will also be related to the output’s text, y to y, etc. The only exception is x, because that’s the field that is grouped by. You could also use groupY, which would group by the y field.