Scrollable Canvas

1,039 views
Skip to first unread message

Alan Gutierrez

unread,
Mar 27, 2010, 12:31:19 AM3/27/10
to Raphaël
Wondering if anyone has set out to create a scrollable canvas. Should
I simply use the behavior in the browser, wrap the paper div in a
scrollable div (overflow: auto), or is there a better way within
Raphaël?

Alan Gutierrez
http://twitter.com/bigeasy

Sebastian Gurin

unread,
Mar 27, 2010, 8:25:03 AM3/27/10
to raph...@googlegroups.com
On Fri, 26 Mar 2010 21:31:19 -0700 (PDT)
Alan Gutierrez <al...@blogometer.com> wrote:

> Wondering if anyone has set out to create a scrollable canvas. Should
> I simply use the behavior in the browser, wrap the paper div in a
> scrollable div (overflow: auto), or is there a better way within
> Raphaël?

I'm working with paper inside a div with css : overflow: scroll and it works ok.

>
> Alan Gutierrez
> http://twitter.com/bigeasy
>
> --
> You received this message because you are subscribed to the Google Groups "Raphaël" group.
> To post to this group, send an email to raph...@googlegroups.com.
> To unsubscribe from this group, send email to raphaeljs+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/raphaeljs?hl=en-GB.
>


--
Sebastian Gurin <sgu...@softpoint.org>

Janna Ermakova

unread,
Mar 27, 2010, 6:22:12 PM3/27/10
to raph...@googlegroups.com
Scrollable div didn't work for me. I used:

paper.canvas.style.overflow = "scroll";


----- Original Message -----
From: "Alan Gutierrez" <al...@blogometer.com>
To: "Rapha�l" <raph...@googlegroups.com>
Sent: Saturday, March 27, 2010 12:31 AM
Subject: Scrollable Canvas


Wondering if anyone has set out to create a scrollable canvas. Should
I simply use the behavior in the browser, wrap the paper div in a
scrollable div (overflow: auto), or is there a better way within

Rapha�l?

Alan Gutierrez
http://twitter.com/bigeasy

--
You received this message because you are subscribed to the Google Groups

"Rapha�l" group.

charles thomas

unread,
Mar 28, 2010, 10:38:04 PM3/28/10
to raph...@googlegroups.com
Janna

You can get the canvas to cover a very long window.

This code dynamically gets a canvas to fit the screen with 400 pixels extra height for example..
    var pScreenHeight = document.all&&document.getElementById ? document.body.clientHeight: window.innerHeight;
    var pScreenWidth =     document.all&&document.getElementById ? document.body.clientWidth: window.innerWidth;

var paper = Raphael(document.getElementById("notepad"), pScreenWidth, pScreenHeight+400);

--- On Sat, 3/27/10, Janna Ermakova <jerm...@rogers.com> wrote:

From: Janna Ermakova <jerm...@rogers.com>
Subject: Re: Scrollable Canvas
To: raph...@googlegroups.com
Received: Saturday, March 27, 2010, 3:22 PM

Scrollable div didn't work for me.  I used:

paper.canvas.style.overflow = "scroll";


----- Original Message ----- From: "Alan Gutierrez" <al...@blogometer.com>
To: "Raphaël" <raph...@googlegroups.com>

Sent: Saturday, March 27, 2010 12:31 AM
Subject: Scrollable Canvas


Wondering if anyone has set out to create a scrollable canvas. Should
I simply use the behavior in the browser, wrap the paper div in a
scrollable div (overflow: auto), or is there a better way within
Raphaël?

Alan Gutierrez
http://twitter.com/bigeasy

-- You received this message because you are subscribed to the Google Groups "Raphaël" group.

To post to this group, send an email to raph...@googlegroups.com.
To unsubscribe from this group, send email to raphaeljs+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/raphaeljs?hl=en-GB.

-- You received this message because you are subscribed to the Google Groups "Raphaël" group.

To post to this group, send an email to raph...@googlegroups.com.
To unsubscribe from this group, send email to raphaeljs+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/raphaeljs?hl=en-GB.



The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free!

Marcus Westin

unread,
Mar 28, 2010, 7:00:18 PM3/28/10
to Raphaël
I'm guessing that won't work since raphael seems to try to draw
everything inside of the canvas. There won't be any overflow.

You could construct your dom like this:

div width=200 overflow=scroll
raphael canvas width=500

Then the div should overflow and render a scroll bar, while the
raphael canvas draws on the full 500 as it's meant to.

On 27 Mar, 15:22, "Janna Ermakova" <jermak...@rogers.com> wrote:
> Scrollable div didn't work for me.  I used:
>
> paper.canvas.style.overflow = "scroll";
>
>
>
> ----- Original Message -----
> From: "Alan Gutierrez" <a...@blogometer.com>
> To: "Rapha l" <raph...@googlegroups.com>
> Sent: Saturday, March 27, 2010 12:31 AM
> Subject: Scrollable Canvas
>
> Wondering if anyone has set out to create a scrollable canvas. Should
> I simply use the behavior in the browser, wrap the paper div in a
> scrollable div (overflow: auto), or is there a better way within
> Rapha l?
>

> Alan Gutierrezhttp://twitter.com/bigeasy

Janna Ermakova

unread,
Mar 31, 2010, 11:13:59 PM3/31/10
to raph...@googlegroups.com
Will it work in IE7?

Marcus Westin

unread,
Apr 1, 2010, 2:31:22 PM4/1/10
to Raphaël
There's only one way to find out :) I suggest you just give it a try.

Josepssv

unread,
Apr 4, 2010, 5:54:45 AM4/4/10
to Raphaël
Hi

I find translate this to Raphael
http://onlypaths.com/aaopblog/2009/2/23/index.htm
IExplorer-VML window trims

graham.reeds

unread,
Apr 18, 2010, 6:38:52 PM4/18/10
to Raphaël
That's pretty nice scrolling - I looked at the code but there seems is
a lot of reliance on ExtJS and stuff.

What part of the code is actually handling the scrolling click event?
I did a test with jQuery and while the scrolling was fine I found that
jQuery also prevented me from clicking on the nodes - the click was
being intercepted as part of the scroll event.

Does yours suffer from this too?

G.
--
You received this message because you are subscribed to the Google Groups "Raphaël" group.

Josepssv

unread,
Apr 21, 2010, 8:39:03 AM4/21/10
to Raphaël

Josepssv

unread,
Apr 22, 2010, 1:24:45 AM4/22/10
to Raphaël
SVG: modify viewbox tag maintaining constant Width and Height

this.svgRoot.setAttributeNS(null,'viewBox', (-x+dx+zx) +' '+(-y+dy+zy)
+' '+windowSpace.w+' '+windowSpace.h);

VML: destroy selection and move Left and Top DIV container

if (document.selection){
document.selection.empty();
}else{
if (window.getSelection){
window.getSelection().removeAllRanges();
}
}
document.getElementById('richdraw').style.left=x-dx+zx;
document.getElementById('richdraw').style.top=y-dy+zy;


Details concrete
http://cloud.github.com/downloads/josepssv/View/zoomhand.txt
Reply all
Reply to author
Forward
0 new messages