Table-based Plots

Table-based Plots

Table Heatmap

using VegaLite, VegaDatasets

dataset("cars") |>
@vlplot(:rect, y=:Origin, x="Cylinders:o", color="mean(Horsepower)")
76158Mean of Horsepower34568CylindersEuropeJapanUSAOrigin

Table Binned heatmap

using VegaLite, VegaDatasets

dataset("movies") |>
@vlplot(
    :rect,
    width=300, height=200,
    x={:IMDB_Rating, bin={maxbins=60}},
    y={:Rotten_Tomatoes_Rating, bin={maxbins=40}},
    color="count()",
    config={
        range={
            heatmap={
                scheme="greenblue"
            }
        },
        view={
            stroke="transparent"
        }
    }
)
5101520Count of Records1.21.41.61.82.02.22.42.62.83.03.23.43.63.84.04.24.44.64.85.05.25.45.65.86.06.26.46.66.87.07.27.47.67.88.08.28.48.68.89.09.2IMDB_Rating (binned)05101520253035404550556065707580859095100Rotten_Tomatoes_Rating (binned)

Table Bubble Plot (Github Punch Card)

using VegaLite, VegaDatasets

dataset("github") |>
@vlplot(
    :circle,
    y="day(time):o",
    x="hours(time):o",
    size="sum(count)"
)
1020304050Sum of count000102030405060708091011121314151617181920212223time (hours)SundayMondayTuesdayWednesdayThursdayFridaySaturdaytime (day)

Layering text over heatmap

using VegaLite, VegaDatasets

cars = dataset("cars")

@vlplot(
    data=cars,
    y="Origin:o",
    x="Cylinders:o",
    config={
        scale={bandPaddingInner=0, bandPaddingOuter=0},
        text={baseline=:middle}
    }
) +
@vlplot(:rect, color="count()") +
@vlplot(
    :text,
    text="count()",
    color={
        condition={
            test="datum['count_*'] > 100",
            value=:black
        },
        value=:white
    }
)
1086669747246433108Count of Records34568CylindersEuropeJapanUSAOrigin