Does anyone here know of a library where I can make a chart, like a histogram or bar graph, and have it converted to an svg?
Something like this? https://github.com/metasoarous/oz https://github.com/hypirion/clj-xchart/tree/stable
Thank you! I see the second has an option to export as an svg, I'll see what I can do
First one should work too
Oh thanks, I didn't look hard enough clearly. If I'm having issues with clj-xchart I'll be sure to check out the other option. Thanks again 🙂
Since SVG is pretty straight forward to write in Clojure using https://github.com/weavejester/hiccup + https://clojuredocs.org/clojure.core/spit there is also the no library option. You can make some LLM generate some SVG bar charts examples and generate your hiccup based on that
Like :
(add-lib 'hiccup/hiccup {:mvn/version "RELEASE"})
(require '[hiccup.core :as h])
(->> [:svg {:xmlns ""}
[:line {:x1 0 :x2 100 :y1 0 :y2 100 :stroke "black"}]]
h/html
(spit "line.svg")) @jpmonettas That would be smart idea, probably a better fit for my use case but alas I have already gotten the graphs working minus the caveat that I couldn't figure out transparent backgrounds (which your solution would fix 🥲) Thanks anyway for your suggestion, I'll keep it in mind for the future