graphvix icon indicating copy to clipboard operation
graphvix copied to clipboard

Choose file path to save graphs

Open lalo2302 opened this issue 7 years ago • 1 comments

I have a use case where I need to save the graph files (dot, png, svg, etc...) inside a specific folder.

I suggest using Application.get_env so the user can add the path through Mix.Config. Maybe place this inside the Writer.save function.

I thought inside each GenServer call, but I like how the name is handled there.

I can work on this if you have no problem, just let me know and I can get it in a couple of days.

Cheers and awesome library, you just made my life easier 👍

lalo2302 avatar Feb 06 '18 01:02 lalo2302

Giving it a second thought, and a deeper review, it is already implemented to choose where the .dot file will be saved. I was talking about the Writer.compile function. Should implement something like the save process.

Like this:

@file_store_path Application.get_env(:graphvix, :file_storage_location)
@default_file_store_path "/tmp"

...

defp file_store_path do
   @file_store_path || @default_file_store_path
end

lalo2302 avatar Feb 14 '18 16:02 lalo2302