-
Notifications
You must be signed in to change notification settings - Fork 524
feat: image_compare
#4216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: image_compare
#4216
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
{f'<div slot="{first_slot}-label" class="label">{before_label}</div>' if show_labels else ""} | ||
{f'<div slot="{second_slot}-label" class="label">{after_label}</div>' if show_labels else ""} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The labels feature isn't working correctly yet (doesn't seem to show up at all).
|
||
# Create HTML content | ||
html_content = f""" | ||
<script defer src="https://unpkg.com/img-comparison-slider@7/dist/index.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be a library in our package.json
so that this plugin can work offline.
we can create a stateless plugin ImageComparison
. you can see how we do this with JsonOutputPlugin
or AccordionPlugin
.
since img-comparison-slider
also may not be common. we should lazy-load the library. you can look at SliderPlugin to VegaPlugin for some exampels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure; will look into this. Thanks for the feedback.
📝 Summary
Add
mo.image_compare
component for side-by-side image comparison with interactive slider.Fixes #1524
🔍 Description of Changes
Still WIP (to work on certain attributes of the component not working as intended).
mo.image_compare
to allow side-by-side comparison of imagesexamples/image_comparison_demo.py
-> needs to be moved to an appropriate folder inexamples/
📋 Checklist
📜 Reviewers
@akshayka OR @mscolnick