snakesonabrain / groundhog

Groundhog, a general-purpose geotechnical library
GNU General Public License v3.0
94 stars 24 forks source link

directly attach background images to plotly figures #24

Closed KawanaReeves closed 11 months ago

KawanaReeves commented 2 years ago

for plots with background Image(s) (f.e. plotrobertson chart). Attach pictures directly to the plotly figure rather than accessing it via a local filepath. That way plots can be uploaded to online libraries (f.e. Chart Studio etc.) and are in general less dependant. Solution proposal: opening the image as a PIL.Image.Image object (this requires the pillow package) and passing that image object as the image source property. This will convert the image into a base64 encoded string and embed it in the figure so that it no longer depends on the file on the filesystem. greyed out original code vs. suggested code below: robertson_chart_code note that the package dependency needs to be amended

snakesonabrain commented 11 months ago

@KawanaReeves I finally managed to resolve this one. The changes are in DEV

snakesonabrain commented 11 months ago

Closing after running pipelines successfully.