Package org.openrefine.browsing.facets
Interface FacetConfig
-
- All Known Implementing Classes:
ListFacet.ListFacetConfig,RangeFacet.RangeFacetConfig,ScatterplotFacet.ScatterplotFacetConfig,StringFacet.Config,TextSearchFacet.TextSearchFacetConfig,TimeRangeFacet.TimeRangeFacetConfig
public interface FacetConfigRepresents the configuration of a facet, as stored in the engine configuration and in the JSON serialization of operations. It does not contain the actual values displayed by the facet.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Facetapply(ColumnModel columnModel, Map<String,OverlayModel> overlayModels, long projectId)Instantiates the given facet on a particular column model.Set<String>getColumnDependencies()Computes the set of columns the facet depends on.StringgetJsonType()The facet type as stored in json.booleanisNeutral()A neutral facet is a facet that does not filter out any row, i.e. it is in its initial, reset state.FacetConfigrenameColumnDependencies(Map<String,String> substitutions)Updates the facet config after a renaming of columns.
-
-
-
Method Detail
-
apply
Facet apply(ColumnModel columnModel, Map<String,OverlayModel> overlayModels, long projectId)
Instantiates the given facet on a particular column model. This allows to check the validity of the configuration against a particular table schema (checking that the dependent columns exist, for instance).- Parameters:
columnModel- the header of the table the facet is applied to.overlayModels- the overlay models of the table the facet is applied to (can be accessed by expressions evaluated by the facet)projectId- the id of the project this facet is evaluated on- Returns:
- a computed facet on the given project.
-
getColumnDependencies
Set<String> getColumnDependencies()
Computes the set of columns the facet depends on. If the facet relies on an unknown set of columns, or if it is not row-wise, this returns null.- Returns:
- the set of column names the facet depends on.
-
renameColumnDependencies
FacetConfig renameColumnDependencies(Map<String,String> substitutions)
Updates the facet config after a renaming of columns.- Returns:
- null if the update could not be performed, or the new facet config if the update could be performed.
-
isNeutral
boolean isNeutral()
A neutral facet is a facet that does not filter out any row, i.e. it is in its initial, reset state. Neutral facets are still useful to visualize the distribution of values in a column.
-
getJsonType
String getJsonType()
The facet type as stored in json.
-
-