From ab2a85173c7f9d2f1ba68bd47f419dc8b4e303de Mon Sep 17 00:00:00 2001 From: Krishna Chaudhary Date: Sun, 9 Aug 2026 23:00:40 +0530 Subject: [PATCH] feat: display label names on figures --- labellab-client/src/components/labeller/Figure.js | 10 +++++++--- labellab-client/src/components/labeller/LabelingApp.js | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/labellab-client/src/components/labeller/Figure.js b/labellab-client/src/components/labeller/Figure.js index 5344c4dde..23abe618c 100644 --- a/labellab-client/src/components/labeller/Figure.js +++ b/labellab-client/src/components/labeller/Figure.js @@ -1,5 +1,5 @@ import React, { Component, Fragment } from 'react' -import { Polyline, Polygon, CircleMarker } from 'react-leaflet' +import { Polyline, Polygon, CircleMarker, Tooltip } from 'react-leaflet' class Figure extends Component { constructor(props) { @@ -128,14 +128,18 @@ class Figure extends Component { fillColor={fillColor} opacity={sketch ? '0.7' : '1.0'} dashArray={dashArray} - interactive={id !== 'trace'} // always set interactive to true, to avoid bugs in leaflet-react + interactive={id !== 'trace'} onClick={() => { if (interactive) { onSelect() skipNextClick() } }} - /> + > + + {figure.label_name} + + {guideLines} {this.makeExtraElements()} {!finished || editing ? vertices : null} diff --git a/labellab-client/src/components/labeller/LabelingApp.js b/labellab-client/src/components/labeller/LabelingApp.js index d2da839b3..c67854e08 100644 --- a/labellab-client/src/components/labeller/LabelingApp.js +++ b/labellab-client/src/components/labeller/LabelingApp.js @@ -308,6 +308,7 @@ class LabelingApp extends Component { points: figure.points, id: figure.id, label_type: label.label_type, + label_name: label.label_name, tracingOptions: figure.tracingOptions }) // if (figure.id === selectedFigureId) {