Inconsistent intervals for Graduated Panels

We found a weird bug when using Graduated Panel.

When we create a panel with the following configuration

diagram.add(
  $(go.Part, "Graduated",
    {
      graduatedMin: 1, graduatedMax: 2,
      graduatedTickUnit: 0.1,
      background: "transparent"
    },
    $(go.Shape, { geometryString: "M0 0 H400" }),  // the main Shape
    // a short, frequent tick mark
    $(go.Shape, { geometryString: "M0 0 V5" }),
  ));

In the above case, we expect there should be 11 total ticks. Starting from 1, 1,1, 1,2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 and 2. But, the vertical line at 2 is missing.

However, if we change the option of graduatedMin to 4 and graduatedMax to 5, then we see all the ticks starting from 4, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, 5.

Similar bug appears when we chose options of 0.1. and 0.3 for graduatedMin and graduatedMax respectively.

We have noticed that this bug arises when the values are below 5. For values above 5 and for any increment we are seeing proper results.

Attached are the screenshots for the same with the config code.

It’s a floating point computation and comparison error. Thanks for bringing it to our attention. We’ll investigate it.

1 Like

How urgently do you need a fix? If you would like to try a beta version of 2.1.36, you can get it at GoJS - Build Interactive Diagrams for the Web. The library is available at https://gojs.net/beta/release/go.js or https://gojs.net/beta/release/go-debug.js.

We may make some more bug fixes before we release it in a week or so.

No urgency, we can use the beta version through npm module until actual release arrives.

Try the latest: GoJS version 2.1.36