Comments (8)
I agree that serving BufferedImage
s as visible images is useful, that's why we made that feature! In this case, it's not clear what we want to do inside html
blocks, so there's going to be some design work around what feels right. :)
from clerk.
I have no idea what you had expected to happen in this case.
from clerk.
Thanks,
Here is the Slack discussion for reference:
https://clojurians.slack.com/archives/C035GRLJEP8/p1647906226495609
What I was wondering about was how to embed BufferedImage
values in a Hiccup block.
from clerk.
The linked Slack thread doesn't make clear what output you might have expected given the semantics of clerk/html
, which in turn leaves me unsure how to help you.
from clerk.
I might have expected to see the corresponding images inside the div, since typically, Clerk viewer types nest.
Edit:
But I was wondering about it too, still new to Clerk semantics.
This is documented as an Issue here simply because I was asked to do that on the Slack thread.
from clerk.
Let me try to refine my question a bit: if you are using the html
viewer to build a hiccup representation of some HTML you would like to show the user, what would it mean to dump the binary data of an image in the middle?
I would expect something like [:img {:src (url-for (ImageIO/read ...))}]
in this place so that you have control over the CSS applied to the element, can supply click handlers, and so on. (Note that this currently doesn't work! But to come up with a good solution that gives the user full power and no magic, we need to consider what should happen.)
from clerk.
Thanks, yes, I'm not sure about the desired API.
So, maybe the ticket title should have been: "What is the recommended practice for showing a few images in a div?".
A few thoughts:
- Currently, a top-level form returning a
BufferedImage
just renders as an image in the Clerk notebook, without asking the user to care about serving it through a URL, etc. - This is quite useful. Example use cases:
- The user is doing some image processing and wants to just see the resulting image.
- The user is getting an image from a plotting library (e.g., cljplot) and just wants to see it.
- I think that Clerk tends to render things (e.g., Vega plots) the same when nested inside a div and when not.
- I think this kind of consistency is nice. That is probably what made me assume some desired behavior here.
from clerk.
@daslu it took a while but it's now working with a8c5102:
from clerk.
Related Issues (20)
- Problems with tablecloth HOT 1
- Exceptions are not shown when watcher uses filter-fn HOT 1
- Source File is missing from git Links in Header of static App
- Viewer crashes trying to present exceptions with function values in their data
- static builds should include git links to source documents
- # anchors in links to static builds don't work in Firefox when first opening a page
- Consider adding a specific code example to `clerk/use-headers` or `clerk/table` docstring?
- An edge case where the analyzer crashes
- clerk/image should have an option to set the size HOT 2
- clerk/image should have have an option to encode images as jpeg
- clerk/image should have an option to include an `alt` tag
- The :no-cache option does not propagate through dependencies across files HOT 1
- Inline redefs crash during eval HOT 1
- Improve error message when predicate throws
- Browser UI disappears when exception is thrown HOT 5
- Clerk cannot render nested wrapped values HOT 2
- Clerk doesn't load in java 22 HOT 5
- Top-level multiline strings are not rendered HOT 1
- Scroll position lost after browser refresh / error popup
- honey.sql format crashes in clerk notebook HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clerk.