Closed kgoyal000 closed 4 years ago
Since you closed it, you probably have found the location in the code where it was hard-coded, basically to make it the same size as the sun.
However, since a hard-coded number is always worse than a configurable one, I added an override to the configuration, under planets.symbols:
"lun": {symbol: "\u25cf", letter:"L", fill: "#ffffff", size: 12},
where the number for size is the (approximate) diameter of the symbol in pixels.
That also gave me the opportunity to size all the planetary disks consistently.
So thanks for the incentive to improve the code!
Thanks ofrohn for your time , there is an another issue with planets and moon , if we check them and then try to download svg an error came up and if we again click download svg then svg got downloaded but without white side of moon
Attaching screenshots of error as well as my code i wrote to make it work but i think the code i wrote is not fine although its working
I've just fixed the SVG module so that it also respects the size parameter I talked about above. If you use that setting instead of modifying the code, it should work as advertised. There was another issue that caused the Moon to be printed behind the stars. I put all the Solar System objects in a separate layer that will always be printed in front of the stars, which is the proper way for planets to behave.
Thanks for the fix , its really helpful 🙂
@ofrohn there still same error coming for which i used try catch attaching the settings which i implemented check that
when i click on download svg an error came up in console
then 2nd time i click download svg then it downloads the svg
OK, now I can replicate the error. It seems if you disable almost everything the d3.svg.customSymbol class doesn't get defined for some reason. Not sure why, but if I pull the declaration out of the saveSVG function it doesn't produce the error under the exact same settings. So I think I'll just do that and be done with it.
Can you check?
Thanks its all error free now really appreciate your time , sorry to bother you again but is this possible in future versions that if we increase width of canvas stars , planets all increase their sizes too , because we have to manually change the stellar size with exponential for stars to make them look nice
In the latest version the size of planetary objects is scaled when zooming in. That'll probably do what you want
Thanks ofrohn your work and personality is out of this world , thanks again
Hello ofrohn , hope you are doing well i found another issue with moon if we change symbol fill color to any other color it gets affected only on svg not on canvas
Good catch. That was a choice to use a hard-coded color for the moon symbol. But there really isn't any good reason to ignore the configuration setting, so I fixed if now.
Hi ofrohn sorry for disturbing again , i have a question i want to know whether i can use 🌑 this symbol for black moon or not when i replaced this with all moon unicode character's still that didn't worked for me , please guide me is that possible or not Thanks
I'm not sure I understand the issue correctly: You'd like to use a Unicode Moon symbol instead of the generated crescent? If yes, that is currently not possible because I always show the generated symbol with the settings 'symbol' and 'disk', because I like it so much. If you insist, I provide an override so that the 'symbol' setting uses the Unicode character.
I want moon to look like this , i thought this looks good than just white moon , but i don't know how i can achieve this Please help me in this
So you want to display the generated crescent in front of the unicode symbol? Well, that is pretty complicated, since the size of the crescent has to match the symbol exactly. That is somewhat problematic, since there are differences between fonts, browsers and OSes how the unicode is displayed. But if you want to do it for yourself for one specific setup, this code instead of the "darkluna" background circle should get you started:
planets.selectAll(".dmoon")
.data(jlun.features)
.enter().append("text")
.attr({dy: ".2em", dx: "-.75em", class: "darkluna"})
.style ( "fill", "#000" )
.attr("transform", function(d) { return point(d.geometry.coordinates); })
.text("🌑");
And adapt the size of the crescent in the configuration object via the size parameter in planets -> symbols -> 'lun'. The 'dy' and 'dx' attributes in the snippet above may need some adjustment as well.
Thanks ofrohn , i just want to improve the code and want to know that how is this thing possible , i will definitely try as you said Thanks again
hello @ofrohn first thanks for this awesome library , i want to increase the moon size i can't find any option can you please help. And thanks again 🙂