ofrohn / d3-celestial

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

redraw() method does nothing #104

Closed donjajo closed 3 years ago

donjajo commented 3 years ago

Hi,

I am not sure I am doing this the right way, I probably might be missing something. I wish to pass the coordinates on runtime, I am using this:

Celestial.location(5.0, 6.0)
Celestial.redraw()

But it does nothing, I have tried other methods and then redraw() but nothing happens. How to I set options on runtime?

ofrohn commented 3 years ago

Celestial.location has the parameters [lat, long] and optionally timezone. So try Celestial.location([5.0, 6.0]) to set 5° N / 6° E as your location. If you don't set a timezone, it will be set automatically.

donjajo commented 3 years ago

Thank you. The problem is not the location method. Thanks for clearing it up, I have passed an array instead, but the redraw method does nothing. I am using this on React component, and implemented well as I have with other nonReact libraries.

donjajo commented 3 years ago

Figured it. I used Celestial.apply() method to make changes on runtime

Thanks