flekschas / regl-scatterplot

Scalable WebGL-based scatter plot library build with Regl
https://flekschas.github.io/regl-scatterplot/
MIT License
194 stars 24 forks source link

Need atleast 2 annotations for drawAnnotations to work #187

Closed rpadmanabhan closed 4 months ago

rpadmanabhan commented 4 months ago

I was interested in a recent feature addition you had made for drawing annotations. I find that if I specify only a single annotation, for e.g. with :

        await scatterplot.drawAnnotations([
            {
                vertices: [[-1, -1], [1, 1]],
                lineColor: '#D55E00',
                lineWidth: 1,
            },
        ]);

I get the below warning and no annotation is drawn.

regl-scatterplot.js?v=f7c6d833:10895 The length of points (2) does not match the dimensions (2). Incomplete points are ignored.

Everything works fine if i draw 2 or more annotations. I can get around by just drawing a dummy annotation with the background color, just wondering if there was a way around this.

Thanks again for this wonderful library and the nifty feature additions that you are continuously adding.

flekschas commented 4 months ago

Thanks for reporting the bug. I have a fix ready. Should go out shortly with as part of a new patch version.

flekschas commented 4 months ago

Ooops I never released v1.10. Well, now it's out and includes a fix for the issue you found :)

flekschas commented 4 months ago

Never mind, I forgot to push v1.10 but fixed that version some weeks ago. So now v1.10.0 is released and I also just released v1.10.1 with a fix for your issue. Let me know if the latest version is working as intended.

rpadmanabhan commented 4 months ago

Thanks much it works as expected.