streamlit-image-comparison icon indicating copy to clipboard operation
streamlit-image-comparison copied to clipboard

Any way to make width = "wide" or "centered"?

Open ajinkya-kulkarni opened this issue 2 years ago • 1 comments

Basically just the title. I would love a way for the width to be detected automatically and centre the image-comparison component.

ajinkya-kulkarni avatar Mar 13 '23 19:03 ajinkya-kulkarni

if which_layout == "centered:
  image_comparison(
  img1 = image1,
  img2 = image2,
  label1="Image",
  label2="Result",
  width = 674,
  in_memory = True, show_labels = True, make_responsive = True
  )
if which_layout == "wide:
  image_comparison(
  img1 = image1,
  img2 = image2,
  label1="Image",
  label2="Result",
  width = 1169,
  in_memory = True, show_labels = True, make_responsive = True
  )

I came up with this ad-hoc solution, but is there a way you can implement this in the HTML/CSS block? I have zero knowledge of HTML/CSS, so I am not a 100% sure.

ajinkya-kulkarni avatar Mar 14 '23 14:03 ajinkya-kulkarni