Krona icon indicating copy to clipboard operation
Krona copied to clipboard

Use of Krona within another project

Open markschl opened this issue 2 years ago • 1 comments

I have just created a Github repo containing some useful code for using Krona charts from R and phyloseq (creating, embedding in RStudio and R-Markdown HTML/PDF/...). (https://github.com/markschl/embed_krona).

To allow for custom coloring schemes, I created a script here: krona_import.pl. However, I'm not completely sure if the note on top is enough to comply with the license of Krona. The script is somehow based on the import scripts of Krona and uses the KronaTools perl module, but has its own option parser.

Side note: Of course it would be nice if ktImportText offered importing custom color schemes. This seems to be on the list (https://github.com/marbl/Krona/issues/49), but in a more elaborate way than how my script solves it. Another note: I used some ugly Javascript hacks to allow taking snapshots programmatically (e.g. using URL parameters). Maybe I missed some way how this can already be done, but otherwise it would be a very nice feature to allow directly embedding Krona charts in R-Markdown.

markschl avatar Apr 26 '22 17:04 markschl

Small update: the R script in embed_krona now directly generates the XML, which is imported with ktImportXML, so the Perl script is not necessary anymore.

The remaining question would be, whether it is ok to modify the Krona JS code on the fly while creating snapshots (also, the code in interactive charts is minified). I would assume so, since I the embed_krona repo doesn't host any copy of the Krona source code, and thus no copyright notice should be needed.

From my side it would be a very nice feature to allow taking snapshots programmatically (e.g. through an URL parameter), making those JS hacks unnecessary that I've used for embedding snapshots into PDFs or other documents.

markschl avatar Nov 15 '22 17:11 markschl