Search in sources :

Example 6 with HeatmapHighlighter

use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.

the class HeatmapHighlighterSerializerTest method serializeMinValue_resultJsonHasMinValue.

@Test
public void serializeMinValue_resultJsonHasMinValue() throws IOException {
    // given
    HeatmapHighlighter heatmapHighlighter = (HeatmapHighlighter) TableDisplayCellHighlighter.getHeatmapHighlighter("a", 1, 10);
    // when
    JsonNode actualObj = serializeHeatmapHighlighter(heatmapHighlighter);
    // then
    Assertions.assertThat(actualObj.has("minVal")).isTrue();
    Assertions.assertThat(actualObj.get("minVal").asInt()).isEqualTo(1);
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) HeatmapHighlighter(com.twosigma.beakerx.table.highlight.HeatmapHighlighter) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Example 7 with HeatmapHighlighter

use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.

the class HeatmapHighlighterSerializerTest method serializeMinColor_resultJsonHasMinColor.

@Test
public void serializeMinColor_resultJsonHasMinColor() 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("minColor")).isTrue();
    Assertions.assertThat(actualObj.get("minColor").get("rgb").asInt()).isEqualTo(Color.BLACK.getRGB());
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) HeatmapHighlighter(com.twosigma.beakerx.table.highlight.HeatmapHighlighter) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Example 8 with HeatmapHighlighter

use of com.twosigma.beakerx.table.highlight.HeatmapHighlighter in project beakerx by twosigma.

the class HeatmapHighlighterSerializerTest method serializeStyle_resultJsonHasStyle.

@Test
public void serializeStyle_resultJsonHasStyle() throws IOException {
    // given
    HeatmapHighlighter heatmapHighlighter = (HeatmapHighlighter) TableDisplayCellHighlighter.getHeatmapHighlighter("a", HighlightStyle.FULL_ROW);
    // when
    JsonNode actualObj = serializeHeatmapHighlighter(heatmapHighlighter);
    // then
    Assertions.assertThat(actualObj.has("style")).isTrue();
    Assertions.assertThat(actualObj.get("style").asText()).isEqualTo("FULL_ROW");
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) HeatmapHighlighter(com.twosigma.beakerx.table.highlight.HeatmapHighlighter) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Aggregations

KernelTest (com.twosigma.beakerx.KernelTest)8 HeatmapHighlighter (com.twosigma.beakerx.table.highlight.HeatmapHighlighter)8 Test (org.junit.Test)8 JsonNode (com.fasterxml.jackson.databind.JsonNode)7 TableDisplayCellHighlighter (com.twosigma.beakerx.table.highlight.TableDisplayCellHighlighter)1 ThreeColorHeatmapHighlighter (com.twosigma.beakerx.table.highlight.ThreeColorHeatmapHighlighter)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1