build-your-own-radar icon indicating copy to clipboard operation
build-your-own-radar copied to clipboard

Possibility to embed radar in another webpage

Open mostrovoi opened this issue 7 years ago • 4 comments

Hi, Would it be possible to embed a generated radar in a different webpage? My wish would be to import a certain javascript to a existing site rather than using iframes or web components. For instance, in the same way timeline library works: https://github.com/NUKnightLab/TimelineJS3

Would that be possible?

mostrovoi avatar Sep 20 '17 10:09 mostrovoi

It is not that difficult actually. There are some problems to be addressed though: 1.- Remove all general styles applying to the whole page 2.- Use

and proper id instead of
, i.e. give more control to the page containing these widgets on how to allocate them. The page itself may have own header already.. Use d3.select('#id') instead of d3.select('body') so that the widget could be placed wherever we please. 3.- Remove general things such as document.title or set_document_title I managed to have my own version. Just importing the generated javascript and css I can embed my own radar in any page. I am still missing a way to inject sheetURL via parameters or to pass a div id as parameter but for my use case I dont need it.

mostrovoi avatar Sep 26 '17 09:09 mostrovoi

It is not that difficult actually. There are some problems to be addressed though: 1.- Remove all general styles applying to the whole page 2.- Use

and proper id instead of , i.e. give more control to the page containing these widgets on how to allocate them. The page itself may have own header already.. Use d3.select('#id') instead of d3.select('body') so that the widget could be placed wherever we please. 3.- Remove general things such as document.title or set_document_title I managed to have my own version. Just importing the generated javascript and css I can embed my own radar in any page. I am still missing a way to inject sheetURL via parameters or to pass a div id as parameter but for my use case I dont need it.

Can you share how you were able to embed the radar?

Dhvani3 avatar Sep 23 '20 14:09 Dhvani3

I'm looking for an answer to this also I'm using Nextjs and was hoping to maybe create a react component or something... be interested to see how you achieved this??

liam-mctague-vl avatar Mar 16 '23 20:03 liam-mctague-vl