Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6958829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:11:28+00:00 2026-05-27T15:11:28+00:00

I am using the visualisation arborjs and I am trying to implement the zoom-function.

  • 0

I am using the visualisation arborjs and I am trying to implement the zoom-function. This isn’t included in the visualisation itself so I had to try some different approches.

I can’t use the html5 canvasfunction .scale because with this the positions given by the visualisation don’t match the real positions anymore.
For the moment I just increase the height and width of the canvas to zoom in. This doesn’t give any problems with the positioningproblem, but I can’t scroll in the canvas.

The only problem that I have to solve is the scrollfunction to make this work. So my question is: can I add scrollbars to the canvas when the canvas becomes too big.
Initially the canvas has width 100% and height 100%, so no scrollbars are needed, but when I enlarge this I need those scrollbars.

I tried the css-style overflow:scroll for both the canvas and the surrounding div, but no results.

Here is the relevant code:

HTML:

<div class="explore_area">
    <canvas class="explore_area" id="viewport">
    </canvas>   
</div>

javascript:

zoom: function(){
            var canvas = document.getElementById("viewport");
            var ctx = canvas.getContext('2d');
            sys.screenSize((canvas.width*1.5), (canvas.height*1.5));
        }

css:

div.explore_area {
    position:relative;
    width:100%;
    height:600px;
    overflow:hidden;
}

canvas.explore_area{
    float:left;
    height:550px;
    width:100%;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:11:29+00:00Added an answer on May 27, 2026 at 3:11 pm

    Setting the width and height of canvas using css is not a good idea. To achieve what you required you should not give width and height of canvas in css. Even if you change the dimension css will reset it.

    so first you need to give dimension like this

    <canvas class="explore_area" id="viewport" width="400" height="300">
    

    css for container

    div.explore_area {
        position:relative;
        width:400px;
        height:300px;
        overflow:auto;
    }
    

    see the demo here : http://jsfiddle.net/diode/sHbKD/22/ ( not using arborjs)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C# .NET 3.5 and WCF, I'm trying to write out some of the
I am trying to write an OpenGL visualization program for some scientific data using
I would like to implement a visualisation of this video in Java as experience
I'm using Google Chart ( http://code.google.com/apis/chart/ ) to produce some graphs for my company.
I am trying to set Google Chart using API generated from below link Google
I am trying to make a line chart by using the Google Visualization API,
I'm new to phoneGap, and i'm trying to implement a webview in android with
Situation I have a visualisation using JGraph . The graph is updated by a
I would like to create a sound visualisation system using C# language and .NET
I want to represent some data visually, using a visualization component. Now I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.