Closed snshn closed 3 years ago
@snshn thanks for reaching out.
The real issue is the sharing of data objects between layers. Each layer will associate some meta attributes to the data arrays passed onto it, and these are required for proper functioning. If you pass the exact same object reference to multiple layers it is very possible that they will conflict, and doing this is disadvised.
You can simply solve this by cloning the data structure, for instance:
const labelData = gData.map(d => Object.assign({}, d));
@vasturiano
that makes sense, thank you for the explanation and code snippet. I assumed the supplied data was cloned internally by default.
Describe the bug Calling
.pointsData()
on an already rendered globe causes it to lose its labels previously set via.labelsData()
.To Reproduce Steps to reproduce the behavior: 1.
2.
Expected behavior Labels should not disappear.
Screenshots N/A
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Calling
.labelsData()
right after.pointsData()
seems to be bringing back labels and render them again after a second or two, but it's definitely a bug that points data interferes with labels data.