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

  • Home
  • SEARCH
  • 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 166285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:04:15+00:00 2026-05-11T12:04:15+00:00

I was wondering if it is possible to include SVG content inside a panel

  • 0

I was wondering if it is possible to include SVG content inside a panel (or whatever would work in GWT), be able to add more to the SVG (like add a circle or a curve) programmatically , and handle mouse events (would this be in SVG or GWT?). I’ve tried creating an HTML object adding something along the lines of:

<svg xmlns='http://www.w3.org/2000/svg' version='1.1'> <circle cx='50' cy='50' r='30' /> </svg> 

That didn’t work (nothing visible in output) but I’m not sure if it was because I did it wrong or it’s not allowed.

I was able to do a simple example in GWT with Google Visualization’s LineChart but I’d like to move away from Google Visualization and be able to generate the SVG myself and customize it further. I’ve looked around and many resources points to using Canvas but I’m not sure if that’s the best route yet.

I’m also a bit baffled about the example here. I tried a simple copy-paste of it to try locally and it didn’t seem to work at all. I was however able to get another sample working with just HTM (embed with src pointing to SVG file) L + separate SVG file but I haven’t been able to access it using GWT using RootPanel.get(…).

EDIT: I’ve read about SVG not working with Hosted Browser and compiling it does work but I am uncertain how to refer to the SVG (which I have placed into the HTML via ). If I can access it then presumably I can add to its innerHTML. I’ve tried in RootPanel.get(‘hi’).getElement().setInnerHTML(‘…’) but that doesn’t seem to work or did I mess up? I guess the goal is to be able to manipulate a SVG file which I linked somehow (whether in GWT or in HTML) and be able to modify it based on user’s input.

2nd EDIT So far, I’ve been programming functionality inside of the actual SVG file. In our setup, our SVG is an embedded object and we passed ‘document’ to the embedded SVG. Passing information from an embed object to and from HTML is quite doable since the HTML has access to our SVG functions and the SVG has access to the ‘document’.

There are more transparent ways of doing so (Rapahel) where FireBug could see the SVG directly which is nice but now not quite necessary. Thus far, I don’t think any of the solutions I’ve looked at were IFrames but I could be wrong. A little warning, SVG can be pretty slow sometimes.

I would say my issue is solved (sort of?) but I’m not using Raphael, jQuery, nor GWT at the moment but the method I described in my answer should still work if I want to use GWT.

  • 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. 2026-05-11T12:04:16+00:00Added an answer on May 11, 2026 at 12:04 pm

    After playing around a bit, I’ve been most successful with using Raphaël (which handles cross-browser compatibility) though I suspect anything along those lines would work just fine. Basically I do the following in JavaScript:

    var r = Raphael('someID', WND_WIDTH, WND_HEIGHT); // additional configuration and setup if needed.... 

    Then I would do the following in GWT:

    public native JavaScriptObject getRaphael() /*-{   return $wnd.r; }-*/;  // I now have access to the JavaScript object and could do the following:  public native void drawCircle(JavaScriptObject obj, int x, int y, int r) /*-{   obj.circle(x, y, r); }-*/; 

    I’ve also been reading around and it seems that porting Raphaël into GWT (this article is a good read) will not only increase performance (as per some post I read on Google Groups but can’t find at the moment – they mentioned the compiler does quite a bit of work) but also facilitate coding & debugging.

    So I accomplished my goal of being able to manipulate the SVG directly (somewhat until I port Raphaël into Java or at least create wrappers). I have yet to look seriously into the Google Visualization API but I suspect it might work just as well but I’m not sure if it is robust enough for my needs.

    An important thing I believe I was missing as stated on Raphaël’s site was the following:

    This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later.

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

Sidebar

Ask A Question

Stats

  • Questions 106k
  • Answers 106k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You probabbly want to use the OpacityMask property on your… May 11, 2026 at 8:58 pm
  • Editorial Team
    Editorial Team added an answer Place your XML generation code in a separate class. Have… May 11, 2026 at 8:58 pm
  • Editorial Team
    Editorial Team added an answer Actually, you can use ref and out - just not… May 11, 2026 at 8:58 pm

Related Questions

I was wondering if it is possible if I could include a Fix List
Is it possible to establish a set of templated function pointers, without the hassle
I know in php you can embed variables inside variables, like: <? $var1 =
I write a lot of short throwaway programs, and one of the things I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.