Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
176 stars 15 forks source link

Constant line range geoms receive full DF #123

Closed Vindaar closed 3 years ago

Vindaar commented 3 years ago

When trying to draw a single line using geom_linerange, we still walk over a full data frame. Consider:

  ggplot(df, aes(x, y, color = charge)) +
    geom_point() +
    geom_linerange(aes = aes(y = 0, xMin = 128, xMax = 640)) +
    geom_linerange(aes = aes(y = 256, xMin = 0, xMax = 768)) +

This should simply draw two lines. Instead each line range draws df.len lines on top of one another. We need to make sure in case we're looking at a constant column in all columns that we only consider unique values.