Package org.openrefine.browsing.util
Class ScatterplotFacetAggregator
- java.lang.Object
-
- org.openrefine.browsing.facets.RowInRecordAggregator<T>
-
- org.openrefine.browsing.facets.FacetAggregator<ScatterplotFacetState>
-
- org.openrefine.browsing.util.ScatterplotFacetAggregator
-
- All Implemented Interfaces:
Serializable
,Combiner<ScatterplotFacetState>
,RecordAggregator<ScatterplotFacetState>
,RowAggregator<ScatterplotFacetState>
public class ScatterplotFacetAggregator extends FacetAggregator<ScatterplotFacetState>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ScatterplotFacetAggregator(ScatterplotFacet.ScatterplotFacetConfig config, RowEvaluable evalX, RowEvaluable evalY)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowInRecordFilter
getRowFilter()
ScatterplotFacetState
sum(ScatterplotFacetState first, ScatterplotFacetState second)
Merges two facet statistics from the same facet, computed on different sets of rows.ScatterplotFacetState
withRow(ScatterplotFacetState state, long rowId, Row row, Record record)
Adds statistics obtained from a single row to the facet state.ScatterplotFacetState
withRow(ScatterplotFacetState state, long rowId, Row row, Record record, boolean inView)
ScatterplotFacetState
withRowOutsideView(ScatterplotFacetState state, long rowId, Row row, Record record)
LikeRowAggregator.withRow(Object, long, Row)
} except that this method is called on rows that are excluded by at least two facets, so the values in this row do not normally count towards the statistics displayed in facets.-
Methods inherited from class org.openrefine.browsing.facets.RowInRecordAggregator
withRecord, withRow
-
-
-
-
Constructor Detail
-
ScatterplotFacetAggregator
public ScatterplotFacetAggregator(ScatterplotFacet.ScatterplotFacetConfig config, RowEvaluable evalX, RowEvaluable evalY)
-
-
Method Detail
-
withRow
public ScatterplotFacetState withRow(ScatterplotFacetState state, long rowId, Row row, Record record)
Description copied from class:RowInRecordAggregator
Adds statistics obtained from a single row to the facet state. Given that facet states are expected to be immutable, this returns a new facet state object.- Specified by:
withRow
in classRowInRecordAggregator<ScatterplotFacetState>
rowId
- the row id of the row to ingestrow
- the row to ingestrecord
- the enclosing record of the row, if available (in records mode), null otherwise- Returns:
- the facet state updated with this row
-
withRowOutsideView
public ScatterplotFacetState withRowOutsideView(ScatterplotFacetState state, long rowId, Row row, Record record)
Description copied from class:FacetAggregator
LikeRowAggregator.withRow(Object, long, Row)
} except that this method is called on rows that are excluded by at least two facets, so the values in this row do not normally count towards the statistics displayed in facets. This is useful for facets which require computing global statistics on the entire dataset regardless of which filtering is in place.- Overrides:
withRowOutsideView
in classFacetAggregator<ScatterplotFacetState>
rowId
- the row id of the row to ingestrow
- the row to ingestrecord
- the enclosing record of the row if available, null otherwise- Returns:
- the facet state updated with this row
-
withRow
public ScatterplotFacetState withRow(ScatterplotFacetState state, long rowId, Row row, Record record, boolean inView)
-
sum
public ScatterplotFacetState sum(ScatterplotFacetState first, ScatterplotFacetState second)
Description copied from interface:Combiner
Merges two facet statistics from the same facet, computed on different sets of rows. This generally amounts to summing all the statistics internally. This function is required to be associative: sum(a, sum(b, c)) == sum(sum(a, b), c)- Returns:
- the sum of both facet statistics
-
getRowFilter
public RowInRecordFilter getRowFilter()
- Specified by:
getRowFilter
in classFacetAggregator<ScatterplotFacetState>
- Returns:
- a row filter which determines if a row matches this facet.
-
-