ofrohn / d3-celestial

A star map with d3.js
BSD 3-Clause "New" or "Revised" License
631 stars 179 forks source link

Is it possible to get only the stars' canvas location? #56

Open JoBerkner opened 4 years ago

JoBerkner commented 4 years ago

I would like to add a nightsky view into my application where the user can see the nightsky of his current location in the app. I was wondering how I could receive only the canvas coordinates of the stars without rendering the map. Is this possible?

ofrohn commented 4 years ago

At the moment this app is purely visual, for painting pixels on a canvas. The best way to do it would be to rewrite the redraw function to collect stellar positions and all other data you need in an object and return that instead of drawing it. Then you can set the current view with Celestial.skyview() and call data = Celestial.redraw()

ofrohn commented 4 years ago

If you are still following, I could provide a function to export the json data for a given configuration, essentially a headless setup without visual display.