Did anybody compare the two libraries, svg.js and snap.svg.js?
Why would you prefer one over the other?
Magnus
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
On Thursday, February 27, 2014 8:07:50 PM UTC+1, Jens wrote:
>
> Working example:
>
This works! Thanks!!!
Magnus
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an
Working example:
public class SvgEntryPoint implements EntryPoint {
public class SvgWidget extends Widget {
public SvgWidget() {
setElement(Document.get().createDivElement());
// SVG library should draw inside the widget's container element
drawExample(getElement());
On Thursday, February 27, 2014 2:21:47 PM UTC+1, Ümit Seren wrote:
>
> In your GraphicsPanel.java
>
> try to use
>
> var draw = $wnd.SVG('drawing') instead of SVG
>
>
When I do this, the error message changes to:
*Object [object global] has no method 'SVG'*
Well, I only injected svg.min.js
Hi,
if I understand the js fragment you posted at the beginning of this thread
var draw = SVG('drawing').size(300, 300)
means create an object SVG using as a parent element the element with the
id 'drawing'
(cause 'drawing' is a string, you can pass an element instead, i checked
the code) so the
In your GraphicsPanel.java
try to use
var draw = $wnd.SVG('drawing') instead of SVG
On Thursday, February 27, 2014 6:25:07 AM UTC+1, Magnus wrote:
>
> Hi,
>
> ok, I used the GWT ScriptInjector, and now also the identifier "SVG" can
> be resolved.
> This brought me one step further, but now
Hi,
ok, I used the GWT ScriptInjector, and now also the identifier "SVG" can be
resolved.
This brought me one step further, but now I get another error message:
[ERROR] [wgp] - Failed to load module 'wgp' from user agent 'Mozilla/5.0
> (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
>
> Hi,
>
> ok, I used the GWT ScriptInjector, and now also the identifier "SVG" can
> be resolved.
> This brought me one step further, but now I get another error message:
>
> [ERROR] [wgp] - Failed to load module 'wgp' from user agent 'Mozilla/5.0
> (X11; Linux x86_64) AppleWebKit/537.36 (KHTM
Hi,
ok, I used the GWT ScriptInjector, and now also the identifier "SVG" can be
resolved.
This brought me one step further, but now I get another error message:
[ERROR] [wgp] - Failed to load module 'wgp' from user agent 'Mozilla/5.0
(X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
C
>
> But when call testSVG I get the following error:
> com.google.gwt.core.client.JavaScriptException: (ReferenceError)
> @wgp.client.lib.GraphicsPanel::test()([]): SVG is not defined
>
You have added a
Hi,
I have a minimal example now, see below.
I included the JS code as a ClientBundle and also called injectScript:
public class SampleLoader
{
public void injectScript()
{
String raw = SampleAssetsBundle.instance.myScript().getText();
ScriptElement e = Document.get().createSc
If this script is central to your application, you can simply include it in
your host page. Then you can access it from your GWT code.
If this script is used only under certain conditions, you can inject it when
necessary using a ScriptInjector.
Both approaches work well.
--
You received this
Hi Alain,
I understand that you fetch all the JS code with the method getJsObj() and
pass it to the method setupMap. So I believe that setupMap will embed the
JS code into the div element.
But what exactly is going on there?
(I do not know the Maps API):
private native void setUpMap(Elemen
You basically create a GWT widget based on a div element. Once that widget
is create you call your js code. Have a look at the onAttach method in the
link I showed early on.
So you call call myClientBundle.executeJSCode() inside the onAttach method
of your widget.
Hope that helps
2014-02-26
On Wednesday, February 26, 2014 8:52:32 AM UTC+1, Alain wrote:
>
> One solution could be to create a GWT widget based on a DIV element and
> call the JSNI in the onLoad method.
> I did something similar with a Google Map widget.
>
>
Hello Alain,
thank you!
I understand that there is some
One solution could be to create a GWT widget based on a DIV element and
call the JSNI in the onLoad method.
I did something similar with a Google Map widget.
Have a look at
https://github.com/emitrom/Pilot/blob/master/Pilot/src/com/emitrom/pilot/maps/client/GMapWidget.java
2014-02-26 4:58 GM
Hi,
including a script tag in the module xml did not work for me:
The Cross-Site-Iframe linker does not support
Ok, this must be the method with ClientBundle. I missed this.
It seems that you can also simply include it in the module xml:
https://groups.google.com/forum/#!topic/google-web-toolkit/_7NnUCR4vD0
Magnus
--
You received this message because you are subscribed to the Google Groups
"Google Web T
I have already said how to load it into the browser, so not sure what you
mean. If you mean code completion in your IDE I have no idea how well
Eclipse handles it. In IntelliJ it works pretty well.
-- J.
--
You received this message because you are subscribed to the Google Groups
"Google Web
Thanks, it covers most of the stuff relating to embed JS within Java code...
But one important thing seems to be missing at the first sight:
How to include a whole JS library into the GWT project and access its
methods...
Magnus
--
You received this message because you are subscribed to the Go
Should cover the most:
http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html
Personally I use ClientBundle + (External)TextResource + ScriptInjector to
inject the JS code into the browser.
-- J.
--
You received this message because you are subscribed to the Google Groups
"Googl
There's two general approaches:
1) Write large JSNI methods that do all the interaction in Javascript
2) Use GWT's JavaScriptObject, subclass the library's objects, and write
small JSNI methods that wrap individual methods of the JS object.
There's supposed to be better JS interop coming in GWT
Yes, it's cool! :-)
But what about my question? :-)
How to embed JS within GWT?
Thanks
Magnus
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-web
>
> Also have a look at http://snapsvg.io/
>
Oh that looks pretty cool. Worth a bookmark :)
-- J.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google
Also have a look at http://snapsvg.io/
2014-02-25 14:31 GMT+01:00 Magnus :
> Hi,
>
> I have been searching for SVG support in GWT for an long time.
> Now I have found something that seems to be exactly what I am looking for:
>
>
> http://svgjs.com/
>
>
>- It's lightweight.
>- It support
Hi,
I have been searching for SVG support in GWT for an long time.
Now I have found something that seems to be exactly what I am looking for:
http://svgjs.com/
- It's lightweight.
- It supports importing SVG files.
- The demo shows all the features I need (simple drawings, svg impor
26 matches
Mail list logo