d3-celestial
d3-celestial copied to clipboard
Bug when specifying zoomlevel in config
Hi,
there appears to be a bug when specifying a zoomlevel in the config that is passed to Celestial.display where the size and exponent values for stars are not properly evaluated. The stars are rendered much too tiny. Take a look at the following two pictures. The first one didn't have a zoomlevel specified and I zoomed in manually with the mouse-wheel. The second one has a specified zoomlevel of 5.
Does Anyone have an idea how to fix this? Thanks!

Well, I seemingly "fixed" it by commenting out line 71 in Celestial.display in celestial.js , i.e.
mapProjection = Celestial.projection(cfg.projection).rotate(rotation).translate([canvaswidth/2, canvasheight/2]).scale(scale * zoomlevel);
zoom = d3.geo.zoom().projection(mapProjection).center([canvaswidth/2, canvasheight/2]).scaleExtent([scale, scale * zoomextent]).on("zoom.redraw", redraw);
// Set initial zoom level
// scale *= zoomlevel;
var canvas = d3.select(parentElement).selectAll("canvas"),
culture = (cfg.culture !== "" && cfg.culture !== "iau") ? cfg.culture : "";
But I don't understand the code well enough and I assume this line is there for a reason. Maybe you can have a look @ofrohn ? Thanks!