Skip to content

Commit 1abbe2c

Browse files
authored
Merge pull request #3885 from robertcv/fix/owlinearprojection_vars
[FIX] OWLinearProjection: limit axis
2 parents 6f3aef2 + 6489e6b commit 1abbe2c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Orange/widgets/visualize/owlinearprojection.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
from Orange.widgets.widget import Msg
3636

3737

38+
MAX_LABEL_LEN = 20
39+
40+
3841
class LinearProjectionVizRank(VizRankDialog, OWComponent):
3942
captionTitle = "Score Plots"
4043
n_attrs = Setting(3)
@@ -215,7 +218,11 @@ def update_anchors(self):
215218
if self.anchor_items is None:
216219
self.anchor_items = []
217220
for point, label in zip(points, labels):
218-
anchor = AnchorItem(line=QLineF(0, 0, *point), text=label)
221+
anchor = AnchorItem(line=QLineF(0, 0, *point))
222+
anchor._label.setToolTip(f"<b>{label}</b>")
223+
label = label[:MAX_LABEL_LEN - 3] + "..." if len(label) > MAX_LABEL_LEN else label
224+
anchor.setText(label)
225+
219226
visible = self.always_show_axes or np.linalg.norm(point) > r
220227
anchor.setVisible(visible)
221228
anchor.setPen(pg.mkPen((100, 100, 100)))

0 commit comments

Comments
 (0)