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 7558971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:30:47+00:00 2026-05-30T12:30:47+00:00

I have an upcoming project that I would like to use the HTML5 canvas

  • 0

I have an upcoming project that I would like to use the HTML5 canvas element to accomplish what would have had to be done in the past with either images and absolutely paced div’s or Flash. Here is a basic example of the concept

enter image description here

Here are my concerns:

  1. I am ok with using div’s with corner radius to create the circles as they will be styled, and I’m not sure if I can do that with a mix of svg and the canvas element.
  2. My main concern is the stroke that joins the outer circles to the inner, I would like to do this with canvas but am not sure A) How to get multiple canvas elements on one page in one containing element (a wrapper div) and B) how to figure out the starting points, I would assume the ending point would just be the center of the wrapper div (IE if its 600×600 = x=300, y=300)

Can anyone shed some light on this and offer any suggestions? Is there an advantage to using any of the jQuery canvas plugiins over vanilla JS?

thank you!

  • 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-30T12:30:49+00:00Added an answer on May 30, 2026 at 12:30 pm

    The canvas API consists of some functions which seem to do the job just fine:

    • .moveTo/.lineTo for a line path
    • .arc for a circle path
    • .stroke to stroke a path (line)
    • .fill to fill a path (circle)

    Here’s a very trivial proof of concept: http://jsfiddle.net/eGjak/275/.

    I’ve used (x, y) for both the lines and the circles, which means the lines go from and to the midpoint of two circles. r is the radius of a circle.

    var ctx = $('#cv').get(0).getContext('2d');
    
    var circles = [ // smaller circles
        { x:  50, y:  50, r: 25 },
        { x: 250, y:  50, r: 25 },
        { x: 250, y: 250, r: 25 },
        { x:  50, y: 250, r: 25 },
    ];
    
    var mainCircle = { x: 150, y: 150, r: 50 }; // big circle
    
    function drawCircle(data) {
        ctx.beginPath();
        ctx.arc(data.x, data.y, data.r, 0, Math.PI * 2); // 0 - 2pi is a full circle
        ctx.fill();
    }
    
    function drawLine(from, to) {
        ctx.beginPath();
        ctx.moveTo(from.x, from.y);
        ctx.lineTo(to.x, to.y);
        ctx.stroke();
    }
    
    drawCircle(mainCircle); // draw big circle
    
    $.each(circles, function() { // draw small circles and lines to them
        drawCircle(this);
        drawLine(mainCircle, this);
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning socket programming for use in an upcoming project, and I have
I'd like to use C#, Java and PHP in an upcoming project. What potential
I have an upcoming C project where I'm going to have to use makefiles
Hey All, I have an upcoming project that will require the same assets (images,
I have an upcoming project that requires me to make a custom layout. I
I have an upcoming project in a class that will allow me to work
I have a bit of a unique problem with an upcoming project; I need
I have read two recent posts that discuss Depends and Imports Upcoming NAMESPACE, Depends,
We have a web-based product that is used for project management and planning. Each
I would like to know about the compatibility between upcoming versions of KO3. I

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.