use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.
the class TableDisplayTest method shouldSendCommMsgWhenAddHeatmapHighlighterForColumnChange.
@Test
public void shouldSendCommMsgWhenAddHeatmapHighlighterForColumnChange() throws Exception {
// given;
// when
TableDisplayCellHighlighter heatmapHighlighter = TableDisplayCellHighlighter.getHeatmapHighlighter(COL_1, TableDisplayCellHighlighter.FULL_ROW);
tableDisplay.addCellHighlighter(heatmapHighlighter);
// then
assertThat(tableDisplay.getCellHighlighters().get(0)).isEqualTo(heatmapHighlighter);
LinkedHashMap model = getModelUpdate();
assertThat(model.size()).isEqualTo(1);
List actual = getValueAsList(model, CELL_HIGHLIGHTERS);
Map column = (Map) actual.get(0);
assertThat(column.get(HeatmapHighlighterSerializer.TYPE)).isEqualTo(HeatmapHighlighter.class.getSimpleName());
assertThat(column.get(HeatmapHighlighterSerializer.STYLE)).isEqualTo(TableDisplayCellHighlighter.FULL_ROW.toString());
}
use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.
the class HeatmapHighlighterSerializerTest method serializeHeatmapHighlighter_resultJsonHasHeatmapHighlighterType.
@Test
public void serializeHeatmapHighlighter_resultJsonHasHeatmapHighlighterType() throws IOException {
// given
HeatmapHighlighter heatmapHighlighter = (HeatmapHighlighter) TableDisplayCellHighlighter.getHeatmapHighlighter("a");
// when
JsonNode actualObj = serializeHeatmapHighlighter(heatmapHighlighter);
// then
Assertions.assertThat(actualObj.has("type")).isTrue();
Assertions.assertThat(actualObj.get("type").asText()).isEqualTo("HeatmapHighlighter");
}
use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.
the class HeatmapHighlighterSerializerTest method serializeMaxValue_resultJsonHasMaxValue.
@Test
public void serializeMaxValue_resultJsonHasMaxValue() throws IOException {
// given
HeatmapHighlighter heatmapHighlighter = (HeatmapHighlighter) TableDisplayCellHighlighter.getHeatmapHighlighter("a", 1, 10);
// when
JsonNode actualObj = serializeHeatmapHighlighter(heatmapHighlighter);
// then
Assertions.assertThat(actualObj.has("maxVal")).isTrue();
Assertions.assertThat(actualObj.get("maxVal").asInt()).isEqualTo(10);
}
use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.
the class HeatmapHighlighterSerializerTest method serializeMaxColor_resultJsonHasMaxColor.
@Test
public void serializeMaxColor_resultJsonHasMaxColor() throws IOException {
// given
HeatmapHighlighter heatmapHighlighter = (HeatmapHighlighter) TableDisplayCellHighlighter.getHeatmapHighlighter("a", 1, 10, Color.BLACK, Color.BLUE);
// when
JsonNode actualObj = serializeHeatmapHighlighter(heatmapHighlighter);
// then
Assertions.assertThat(actualObj.has("maxColor")).isTrue();
Assertions.assertThat(actualObj.get("maxColor").get("rgb").asInt()).isEqualTo(Color.BLUE.getRGB());
}
use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.
the class HeatmapHighlighterSerializerTest method serializeColumnName_resultJsonHasColumnName.
@Test
public void serializeColumnName_resultJsonHasColumnName() throws IOException {
// given
HeatmapHighlighter heatmapHighlighter = (HeatmapHighlighter) TableDisplayCellHighlighter.getHeatmapHighlighter("a");
// when
JsonNode actualObj = serializeHeatmapHighlighter(heatmapHighlighter);
// then
Assertions.assertThat(actualObj.has("colName")).isTrue();
Assertions.assertThat(actualObj.get("colName").asText()).isEqualTo("a");
}
Aggregations