error in area generator

Hello,

I am continuing my work and came to a problem. My code is working fine inside Observable but in the browser I get a TypeError: selection.selectAll is not a function. (In 'selection.selectAll(".domain")', 'selection.selectAll' is undefined).

This is thrown on a call to axis.js line 56, because in previous line the following code selection = context.selection ? context.selection() : context is executed with context equal 4800. Where this is coming from? I am using an area generator that defines lower limit y0

speedLine = d3.area()
  .x(d => xScale(d.time))
  .y0(yScale2(4800))
  .y1(d => yScale2(d.value.speed))
  .defined(d => d.value !== undefined);

According to the docs this code should work:

If y is specified, sets the y0 accessor to the specified function or number and returns this area generator.

I am not sure if my problem is created by me or I this is a bug. Furthermore, I am puzzled why my code is working inside Observable and not in the browser.

I have found the bug. I made a mistake - I was calling axis generators inside area generator instead of scales. Topic closed.

You can mark the topic as resolved by clicking the “Solution” button below your last reply. :slight_smile: