taz_
taz_

Reputation: 137

How to add d3 GWT wrapper to vaadin?

I tried adding the d3 gtw wrapper found here to Vaadin. But since I am newby to Vaadin/GWT I am a bit confused as to how exactly I can add and use the wrapper. I tried adding the wrapper to the project as per manual using maven but I kept getting javax.servlet.ServletException: com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: com/github/gwtd3/api/D3. I get no warning in eclipse and I can see the documentaton for the classes when coding. Thanks!

Upvotes: 1

Views: 762

Answers (1)

kukis
kukis

Reputation: 4644

If you want to use d3.js library you have 3 options.

  1. Add d3.js using @JavaScript annotation. This option is explained in details on Vaadin website.
  2. Better approach (more clean, and easier to maintain in longterm) would be to write custom Vaadin component based on GWT. You can add and use your d3.js file while producing new GWT component. After that export it to the jar, recompile widgetsets and you can use it your Vaadin app. This approach is explained in details here.
  3. Check out already developed addon for Vaadin Freecode Charts and D3 Wrapper . Maybe functionality provided in this one will be just enough for you.

Upvotes: 1

Related Questions