I am utilizing d3 to visualize a compilation of meteors (Hostiles) on an image based on their x and y coordinates. This process is successful for me. However, I have a publish function that verifies the user's login status to determine if they are an admin or just a regular user. If the user is identified as an admin, all points are displayed using d3, whereas for any other user, only points specific to their location are drawn.
//Determining Points to Display Based on User Type
if (user === true) {
//Display all points for Admin users
return Hostiles.find();
} else {
//Display location-specific points for other users
return Hostiles.find({latitude: {$lte: xLoc + 80, $gte: xLoc - 80}, longitude: {$lte: yLoc + 80, $gte: yLoc - 80}});
};
The functionality described above works well. However, issues arise when I modify the xLoc
and yLoc
values for a particular Hostile
location. While changes reflect instantaneously for admins, there is a noticeable delay in redrawing for normal users. The redraw process using d3 typically takes somewhere between 3-10 seconds for normal users. Both my subscription and d3 drawing are enclosed within a Meteor.autorun(function() {
block on the client side. Is there a solution to address this lag? Thank you.