Information labels on points - only a portion show

52 views
Skip to first unread message

walksam...@gmail.com

unread,
Nov 9, 2016, 3:27:40 PM11/9/16
to MathBox
I am plotting points in three dimensional space and they appear just fine. However, when I try and apply labels to the points, only the first ~16 show.
It does not appear to be a problem with the information in my arrays as the data seems fine by inspection in debug, and I've also replaced the labels[i] look up with just using the index i that is given as the label.
I've loaded the "labels" examples and they appear to work just fine and there are far more labels being rendered there, so I am unsure as to why it doesn't work.

Ideas?



var points = []; //each concept will be listed here once
var labels = []; //each label will be listed here once.

/* Not shown here -
Data is populated into the arrays for the points and their locations*/

// draw the points
view.array({
width: points.length,
items: 1,
channels: 3,
data: points,
live: false
}).point({
color: 0xff4444,
size: 20
})
.text({
font: 'Helvetica',
style: 'bold',
width: 20,
height: 5,
expr: function (emit, i) {
emit(
labels[i]
);
}
})
.label({
snap: false,
outline: 2,
size: 12,
offset: [0, -32],
depth: 0.5,
zIndex: 1
});

kzei...@gmail.com

unread,
May 29, 2017, 3:21:55 PM5/29/17
to MathBox, walksam...@gmail.com
Sorry you didn't get a response earlier – I'm digging through the archives trying to understand how labels work in Mathbox. I replicated the issue you were having, and the culprit I think is the value assigned to `text.width`. Setting it to `points.length` fixes the issue on my end. 
Reply all
Reply to author
Forward
0 new messages