Skip to content

Don't connect dots unless they are adjacent in the data #339

Open

Description

@openjck

This is a rare issue that can make affected charts somewhat confusing. Imagine that a particular population is only in the data on two days: January 1, 2017 and January 1, 2019. Ensemble will show a line connecting those two points, even though that population isn't actually in the dataset for most of that time.

This can happen on the Top Languages chart. The chart shows only the top 5 languages. For some time, zh-CN and es-ES were fighting for 5th place. zh-CN overtook es-ES exactly twice: once in December 2018 and once in April 2019. It wasn't in 5th place in January, February, or March. Nonetheless, Ensemble drew a line between December 2018 and April 2019 for zh-CN, implying that it was one of the top 5 languages that whole time when it was not.

Screen Shot 2019-08-19 at 6 32 02 PM

One solution might be to show separate dots in these situations and only draw lines between dots that represent consecutive dates in the dataset.

Activity

  1. stephaniehobson commented on Nov 6, 2026

    @stephaniehobson
    Collaborator

    Still valid after #481, which replaces metrics-graphics with Observable Plot. The new chart joins each population's points in date order, as the old one did, so a population that drops out of the data for a few weeks still gets a straight line across the gap.

    It's more common than the Top Languages example suggests. In today's live data, 28 populations on 8 charts have weeks missing within their date range. The worst:

    Chart Population Weeks missing
    Usage Behavior › Top Languages ru 243 of 261
    Hardware › Operating System Linux Other 250 of 378
    Hardware › Operating System Windows Other 160 of 406
    Hardware › CPU Speeds 1.4 GHz to 1.49 GHz 53 of 104
    Hardware › GPU Model Kepler-GK208B 22 of 132

    zh-CN on Top Languages still has 6 missing weeks. In every case the missing weeks are absent from the data, not stored as nulls.

    Observable Plot makes the fix simpler. A Plot line leaves a gap wherever a point's value is missing, so the chart can:

    1. Add an empty point for each week a population is missing. The chart can tell which weeks those are because other populations on the same chart have them.
    2. Draw a dot for any point left isolated by gaps on both sides, as suggested above.
    3. Keep the hover readout from landing on the empty points.

    This should be done after #481 lands, as a separate change.

  2. stephaniehobson commented on Nov 6, 2026

    @stephaniehobson
    Collaborator

    Current:

    Image

    Proposed:

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions