kepler.gl icon indicating copy to clipboard operation
kepler.gl copied to clipboard

Image export function with map config

Open trietphan94 opened this issue 5 years ago • 7 comments

I want to export images with map config. Do we have this feature yet?

trietphan94 avatar Jul 31 '19 08:07 trietphan94

Hi @trietphan94 can you provide more details for your use case?

You can export your map to an image via the export image feature: https://github.com/keplergl/kepler.gl/blob/master/docs/user-guides/k-save-and-export.md#export-image

You can also export your map configuration/data via export_map feature: https://github.com/keplergl/kepler.gl/blob/master/docs/user-guides/k-save-and-export.md#export-map

When you export a map and choose JSON as your media, you are going to download both map configuration and data

macrigiuseppe avatar Aug 01 '19 16:08 macrigiuseppe

Hi @macrigiuseppe, Thanks for your support. In my case, I have JSON with my current map config and data. I need an image export function that I just need to pass JSON into and export the image, no need to export the map. Input: { datasets: datasets, config: config }

Output: Kepler image from the above input.

trietphan94 avatar Aug 02 '19 02:08 trietphan94

@trietphan94 our image export is using dom-to-image which means you still need to run kepler in a browser, We can provide a callback prop getMapImage or some sort for you to gather the map image with input like width and height resolution etc. Needs more details on how frequently you need to get an map image

heshan0131 avatar Aug 02 '19 18:08 heshan0131

@heshan0131, Thanks for your support. Very happy if the getMapImage function has the following parameters: type (optinal): The content-type of the file to output. Can be one of 'image/png', 'image/jpeg', 'application/pdf'. filename (optinal): The name of the exported file. Defaults to 'Kepler'. width (optinal): Set the exact pixel width of the exported image or pdf. callback

trietphan94 avatar Aug 05 '19 06:08 trietphan94

@heshan0131 Is there any update on getMapImage ? it would be a great help if this helps me to export the image of the map. Basically i want to save the thumbnail image of the visualization in database?

tanveer21 avatar May 14 '20 13:05 tanveer21

I agree, exporting the visualization as an image programmatically is a highly desired feature. There's often a requirement of creating many visualizations, for example per day, per month. Obviously, it's inconvenient to open 100s of images in a browser and saving them as image manually through the DOM.

agdhruv avatar Dec 14 '20 08:12 agdhruv

Hi, @heshan0131 I am using google colab and there is no export button in the menu (generally when using Keplergl on a notebook). so, I am trying to find a way to save the output map as an image or better a pdf file. how can I access the image? if there is a way then I can use PIL to manipulate the image and save it as a pdf. one more thing, how can I save the map as JSON(via python)?

d-shiri avatar Mar 10 '22 16:03 d-shiri