Problem: Drawing polygons by clicking with the mouse for every point of the polygon is less optimal compared to simply being able to draw a polygon by holding down the mouse. Also the clicking technique does not work well with touchscreen devices or drawing pens, because the hovering feature is not easily available to these devices.
PoC: I implemented the improved drawing of polygons in the following branch of my LabelStudio fork:
https://github.com/cozeybozey/label-studio
The main changes are in DrawingTool.js (https://github.com/cozeybozey/label-studio/blob/ImprovedPolygonDrawing/web/libs/editor/src/mixins/DrawingTool.js). Here you can see I expanded the mousemove, mouseup and mousedown events to allow for polygon drawing by holding down the mouse. One obvious downside of this method is that lots of polygon points will be created by holding down the mouse. I solved this issue by using the simplify-geometry package to simplify the created polygon. This reduces the amount of points in the polygon while maintaining the overall shape.
I also took the liberty to add touchscreen support as well via the touchstart, touchmove and touchend events.
User Stories: As an annotator I want to draw polygons by simply dragging the mouse, so that I can annotate faster.
User Stories: As an annotator I want to draw polygons via touchscreen or pen devices, so that I can annotate faster and more comfortably.
(NOTE: You might notice that the branch also contains some other added code that adds a Done/In Progress toggle button to the project page. It also adds a All/In Progress toggle button to the projects page. The done button allows users to set a project to "Done", which also changes a newly added column in the project database table. The user can then filter on projects that are done or in progress in the projects page. I can take this feature out, but it might be useful as well.)
Problem: Drawing polygons by clicking with the mouse for every point of the polygon is less optimal compared to simply being able to draw a polygon by holding down the mouse. Also the clicking technique does not work well with touchscreen devices or drawing pens, because the hovering feature is not easily available to these devices.
PoC: I implemented the improved drawing of polygons in the following branch of my LabelStudio fork:
https://github.com/cozeybozey/label-studio
The main changes are in DrawingTool.js (https://github.com/cozeybozey/label-studio/blob/ImprovedPolygonDrawing/web/libs/editor/src/mixins/DrawingTool.js). Here you can see I expanded the mousemove, mouseup and mousedown events to allow for polygon drawing by holding down the mouse. One obvious downside of this method is that lots of polygon points will be created by holding down the mouse. I solved this issue by using the simplify-geometry package to simplify the created polygon. This reduces the amount of points in the polygon while maintaining the overall shape.
I also took the liberty to add touchscreen support as well via the touchstart, touchmove and touchend events.
User Stories: As an annotator I want to draw polygons by simply dragging the mouse, so that I can annotate faster.
User Stories: As an annotator I want to draw polygons via touchscreen or pen devices, so that I can annotate faster and more comfortably.
(NOTE: You might notice that the branch also contains some other added code that adds a Done/In Progress toggle button to the project page. It also adds a All/In Progress toggle button to the projects page. The done button allows users to set a project to "Done", which also changes a newly added column in the project database table. The user can then filter on projects that are done or in progress in the projects page. I can take this feature out, but it might be useful as well.)