This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-25
Channels
- # aatree (3)
- # admin-announcements (14)
- # aws (2)
- # beginners (23)
- # boot (58)
- # braid-chat (15)
- # cider (8)
- # clara (5)
- # cljs-dev (1)
- # cljsrn (38)
- # clojure (82)
- # clojure-china (2)
- # clojure-czech (16)
- # clojure-dev (11)
- # clojure-finland (1)
- # clojure-ireland (6)
- # clojure-japan (3)
- # clojure-portugal (1)
- # clojure-russia (152)
- # clojure-sg (7)
- # clojurebridge (3)
- # clojurescript (86)
- # code-reviews (3)
- # core-matrix (4)
- # cursive (25)
- # data-science (1)
- # datascript (2)
- # datavis (98)
- # datomic (21)
- # dirac (97)
- # emacs (1)
- # hoplon (1)
- # jobs (2)
- # ldnclj (21)
- # off-topic (3)
- # om (204)
- # pedestal (3)
- # proton (12)
- # reagent (125)
- # ring-swagger (9)
- # slackpocalypse (1)
- # spacemacs (1)
- # vim (1)
- # yada (19)
@stathissideris: do you support embedding images in SVG with dali?
@kephale other SVGs or bitmaps?
bitmaps is more this question, sometimes i can get them to other vector graphics formats though
so you can embed them like you would do with normal SVG syntax (dali is just a layer over normal SVG anyway). There are currently no functions that make it more convenient, but I'd like to add some functionality for that
If you'd like to give me some use cases I'd be happy to take them into account
also, the 0.7.0-SNAPSHOT is release quality if you'd like to give it a go
the most minimal use case that would probably keep me happy for a long time would just be tiling images side-by-side with graphs
the reason I haven't announced yet is because of lack of documentation
which is in progress here: https://github.com/stathissideris/dali/tree/0.7.0
cool, i’ve been pretty happy so far, but being able to toss raster/bitmap images in would make it easier to go all-in
you mean you've used it already?
oh wow, hadn't realised I had users, that's good to know!
yeah, tell me a bit more about what you'd like to do and I'll add some stuff post-0.7 (I'd like to get the release out of the way before I add more features)
with rasters then i can start trying to convince people that i’ve made the plots in illustrator
@kephale: also, if you'd like to contribute any examples, that would be most welcome
i mean literally just being able to toss in bitmaps in, i have things like N images that biologists have taken, pull out a good example, and need to side by side that with a graph that describes all N images based on some measured features
right now there are still some manual steps at the end, where i’m tossing the raster image next to the vector-based graph in something like powerpoint or illustrator
I'll experiment a bit with the image
tag then
I was thinking that embedding other SVGs may be higher priority
but you have a real use case
yeah, i mean embedding other SVGs is certainly useful, but just supporting bitmaps would go a long way since worst case folks with existing SVGs cooould rasterize them if need be
so you'd lay them out using [:matrix]
or something?
for the tiling case, in the longer run i can definitely foresee some use cases where one has something like 1 big graph, then wants to put example images next to things like peaks in the graph (this bump corresponds to the healthy samples, and this other one one corresponds to the pathological cases)
that would have to be manual
I mean you'd have to mess around with coords
dali can only help you this grid-like layouts mainly
@kephale: https://github.com/stathissideris/dali/blob/0.7.0/examples/output/images1.svg
@stathissideris: awesome!
example here: https://github.com/stathissideris/dali/blob/0.7.0/examples/src/dali/examples.clj#L578-L595
get the latest snapshot to get this functionality
haven't tried with JPEGs, let me know if you do
just PNGs for now
embedded
just realized something
would you be opposed to leaving a function that could take the raw bytes + width + height as args?
the snapshot wont work, but I can fix it quickly
gimme a second
i frequently have the image in memory loaded from any one of many biological image formats
ah bytes, didn't think about that
what format is your image?
the in memory one
i can toss it into any byte format, but presumably RGB or RGBA would be the way to go
in order to embed it, you have to turn it into a byte array tha corresponds to PNG or something
even if it's in memory
i mean filename is fine anyway, since it can always be written to disk anyway, but just noting that an in-memory handoff could be useful sometimes
Y’all, FYI, just started a new job today, gotta turn notifications off for #C0F0V8DT5 — if anyone needs cljs-mathbox help or whatever, just ping me! Gotta drop out of general chatter for a while though...
@kephale: trying to think of good names for the different functions...
woohoo, good luck @eggsyntax !
yeah good luck
Probably silly to mention it, but since the channel’s been so tight-knit…I’m super glad this channel has taken off btw!
or if you went for just supporting BufferedImages raster-bufferedimage-attr, something like that?
I think most folks with in memory images in java are likely to have helpers to get to BufferedImage
so I'll do support for BufferedImage later (but it is useful, you're right)
for now you should be able to say:
[:image {:width w :height h :xlink:href (io/data-uri bytes)}]
where io
is
but a version for bufferedImage would be more like the file version
in that it would give you a map with width and height as well
but let's start with that if you think it's enough
@kephale: So I've changed the API a bit and it now would be [:image {:width w :height h :xlink:href (io/data-uri bytes "image/png")}]
you have to give it a mime type
and the file based version is slightly different, see the URL from before
I've pushed a new snapshot
turns out that supporting BufferedImage is really easy: https://github.com/stathissideris/dali/blob/0.7.0/examples/src/dali/examples.clj#L598-L603
so in your case you'd have an image already, without the need to load it as in the example
that should work
and I just pushed yet another snapshot
ok off to bed, let me know how it goes!
thanks @stathissideris i’ll have to delay on giving it a whirl for a couple of days, must get back to class prep, but this will be great for making figures!
yeah no rush, it'll be great to see what you make with it