Skip to content

TypeError: o[n] is not a function for empty color domain #2210

@jeremy-rifkin

Description

@jeremy-rifkin

I'm setting up a plot where the data set used for the plot may be empty. In such cases, I end up passing color: { legend: true, domain } where domain is an empty array but this leads to an error. Here's a demo that produces the error due to an empty data set and empty domain https://observablehq.com/d/f1142c360da5114b.

Locally I see:

TypeError: I[i2] is not a function
    piecewise piecewise.js:9
    legendRamp ramp.js:95
    legendColor legends.js:53
    createLegends legends.js:76
    plot plot.js:325
    render_chart main.ts:110
    do_query main.ts:278
    onreadystatechange utils.ts:6
    http_get utils.ts:3
    do_query main.ts:263
    query_keystroke main.ts:66
    timeoutId utils.ts:23
    setTimeout handler*debounce/< utils.ts:22
    App main.ts:33
    <anonymous> main.ts:288

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions