These are chat archives for msalsbery/OpenSeadragonImaging

3rd
Dec 2015
Matt D
@dephora
Dec 03 2015 22:42
Hi there - So I'm using openseadragon in an app with which I need to draw thousands of ellipses and rectangles - being familiar with d3, I tried that first but from a performance standpoint - it's not going to work. I read that d3 is not optimal when getting into a high count like that though. So now I'm contemplating using a canvas and going that route. Has anyone done something similar with great performance results?
Ian Gilman
@iangilman
Dec 03 2015 23:16
@Dephora You might find more interested parties over in https://gitter.im/openseadragon/openseadragon
Matt D
@dephora
Dec 03 2015 23:17
@iangilman Thanks - yeah I wasn't sure which to post it to
Ian Gilman
@iangilman
Dec 03 2015 23:17
Anyway, sounds like you're trying to decide between SVG and Canvas. D3 supports both, for what it's worth.
Either way the key is going to be filtering your content so you're not drawing more than you need for the specific zoom/pan you're at.
I don't know of anyone who's done it with OSD, though it's certainly possible people have. At any rate, level of detail culling is definitely a thing in computer graphics
Matt D
@dephora
Dec 03 2015 23:19
Yeah, that is actually what my next approach was
Ian Gilman
@iangilman
Dec 03 2015 23:21
Sounds good. I assume you are using the svg-overlay plugin for your SVG stuff?
Matt D
@dephora
Dec 03 2015 23:21
Yeah
Ian Gilman
@iangilman
Dec 03 2015 23:22
If you want to draw to the canvas, you just need to watch the viewer for animation event and draw after that into viewer.drawer.canvas
(and of course do the appropriate coordinate conversion)
Matt D
@dephora
Dec 03 2015 23:24
Okay great - I'm going to give the canvas a shot and see how it is from a performance standpoint
Ian Gilman
@iangilman
Dec 03 2015 23:24
Awesome. Let me know how it goes!
Matt D
@dephora
Dec 03 2015 23:24
Will do, I appreciate the information!
Ian Gilman
@iangilman
Dec 03 2015 23:25
:)