ofrohn / d3-celestial

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

[Question] Serverside render #111

Closed codihaus closed 3 years ago

codihaus commented 3 years ago

Hello,

I'm working on a project where I have to render the star map on the server-side, so I'm considering several options to achieve, I hope that you guys can point me out if my method is correct.

1/ Method 1: Server-side rendering

So, the question for this method is: how can we get the options to store as JSON file? What is the function to render the SVG file object from JSON on the server?

2/ Method 2: Client-side rendering

So, my question is:

Thank you very much for this awesome lib!

avachasov commented 3 years ago

Hi, you can easy get the SVG on client side using 'exportSVG' function. Here is an example: Celestial.exportSVG( function(data) { //the 'data' object is actually an SVG })

codihaus commented 3 years ago

Hi @avachasov

I have achieved it. Thank you much!