Skip to content

Commit

Permalink
Merge pull request #3885 from robertcv/fix/owlinearprojection_vars
Browse files Browse the repository at this point in the history
[FIX] OWLinearProjection: limit axis
  • Loading branch information
janezd authored Jun 26, 2019
2 parents 6f3aef2 + 6489e6b commit 1abbe2c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Orange/widgets/visualize/owlinearprojection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
from Orange.widgets.widget import Msg


MAX_LABEL_LEN = 20


class LinearProjectionVizRank(VizRankDialog, OWComponent):
captionTitle = "Score Plots"
n_attrs = Setting(3)
Expand Down Expand Up @@ -215,7 +218,11 @@ def update_anchors(self):
if self.anchor_items is None:
self.anchor_items = []
for point, label in zip(points, labels):
anchor = AnchorItem(line=QLineF(0, 0, *point), text=label)
anchor = AnchorItem(line=QLineF(0, 0, *point))
anchor._label.setToolTip(f"<b>{label}</b>")
label = label[:MAX_LABEL_LEN - 3] + "..." if len(label) > MAX_LABEL_LEN else label
anchor.setText(label)

visible = self.always_show_axes or np.linalg.norm(point) > r
anchor.setVisible(visible)
anchor.setPen(pg.mkPen((100, 100, 100)))
Expand Down

0 comments on commit 1abbe2c

Please sign in to comment.