[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/framework-8?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) # Vaadin Framework *[Vaadin Framework](https://vaadin.com/framework) allows you to build modern web apps efficiently in plain Java, without touching low level web technologies.* For instructions about _using_ Vaadin to develop applications, please refer to [Vaadin tutorial](https://vaadin.com/docs/-/part/framework/tutorial.html) and other [documentation](https://vaadin.com/docs/). To contribute, first refer to [Contributing Code](https://github.com/vaadin/framework/blob/master/CONTRIBUTING.md) for general instructions and requirements for contributing code to the Vaadin framework. Instructions on how to set up a working environment for developing the Vaadin Framework follow below. ## Building a package The distribution files can be built by running the standard Maven goal `mvn install` in the project root. ## Eclipse Quick Setup 1. Run git clone https://github.com/vaadin/framework.git command or clone the repository your favorite Git tool. If using Windows, you might want to add these Git settings: `core.autocrlf=false`, `core.fileMode=false` and `core.longpaths=true`. 1. Run mvn install in the project root. Note that the first compilation takes a while to finish as maven downloads dependencies used in the projects. 1. Start Eclipse with the workspace you would like to use. It is usually a good idea to use the parent folder of the Git repository as the workspace folder. 1. Import the project into Eclipse as a maven project. Use *File* -> *Import* -> *Maven* -> *Existing Maven Projects*. 1. Select the *framework* folder (where you cloned the project) 1. Click “Finish” to complete the import of Vaadin Framework Now the project should compile without further configuration. ### Compiling the Default Widget Set and Themes * Compile the default widgetset by running install maven goal in `vaadin-client-compiled` module root. In Eclipse this is done by right clicking on vaadin-client-compiled project it and choosing *Run As* -> *Maven Build...*. * Compile the default themes by running install maven goal in `vaadin-themes` module root. In Eclipse this is done by right clicking on vaadin-themes project it and choosing *Run As* -> *Maven Build...*. ### Set up extra workspace preferences The following preferences need to be set to keep the project consistent. You need to do this especially to be able to contribute changes to the project. 1. Open *Window* -> *Preferences* (Windows) or *Eclipse* -> *Preferences* (Mac) 1. Go to *General* -> *Workspace* 1. Set *Text file encoding* to *UTF-8* 1. Set *New text file line delimiter* to *Unix* 1. Go to XML -> XML Files -> Editor 1. Ensure the settings are follows: * Line width: 72 * Format comments: true * Join lines: true * Insert whitespace before closing empty end-tags: true * Indent-using spaces: true * Indentation size: 4 ### Running a UI test 1. In a Project Explorer right-click *vaadin-uitest* 1. Open *Run As* -> *Maven build...* 1. Type in jetty:run-exploded into *Goals* and click *Run* 1. Open URL [http://localhost:8888/run/<testUI>](http://localhost:8888/run/) For full instructions please visit [README-TESTS.md](README-TESTS.md). ## Setting up IntelliJ IDEA to Develop Vaadin Framework 8 1. Install and run IDEA. Ultimate Edition is better but Community Edition should also work. 1. Ensure if Git and Maven plugins are installed, properly configured and enabled. 1. Clone the repository, using menu VCS -> Checkout from Version Control -> Git -> Git Repository URL -> https://github.com/vaadin/framework.git. When the repository is cloned, do **NOT** open it as a project. 1. Open cloned repository as a maven object. Use File -> Open and choose root _pom.xml_ file 1. Have a coffee break while IDEA is loading dependencies and indexing the project 1. Run Maven targets clean and install using *Maven Projects* tool window to compile the whole project ### Running a specific UI test 1. Open *Maven Projects* 1. Open *vaadin-uitest* -> *Plugins* -> *jetty* -> *jetty:run-exploded* 1. Open URL [http://localhost:8888/run/<testUI>](http://localhost:8888/run/) For full instructions please visit [README-TESTS.md](README-TESTS.md). ### Running a Development Server 1. Open *Run* menu and click *Edit Configurations* 1. Click green ***+*** sign at top left corner, select *Maven* from popup 1. In the run configuration page, set any name for the configuration, select *vaadin-uitest* project folder as *Working directory* 1. Type exec:exec@run-development-server into *Command line* and save the configuration 1. Run the configuration and open URL [http://localhost:8888/run/<testUI>](http://localhost:8888/run/) ### Running a Development Server in a debug mode 1. Type exec:exec@debug-development-server into *Command line* and save the configuration 1. In the same dialog, create new "Remote" debug configuration, using *localhost* and *Port 5005* 1. Start both configurations and open URL [http://localhost:8888/run/<testUI>](http://localhost:8888/run/) al { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# SVG.js

[![Build Status](https://travis-ci.org/svgdotjs/svg.js.svg?branch=master)](https://travis-ci.org/svgdotjs/svg.js)
[![Coverage Status](https://coveralls.io/repos/github/svgdotjs/svg.js/badge.svg?branch=master)](https://coveralls.io/github/svgdotjs/svg.js?branch=master)
[![CDNJS](https://img.shields.io/cdnjs/v/svg.js.svg)](https://cdnjs.com/libraries/svg.js)
[![Join the chat at https://gitter.im/svgdotjs/svg.js](https://badges.gitter.im/svgdotjs/svg.js.svg)](https://gitter.im/svgdotjs/svg.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

__A lightweight library for manipulating and animating SVG, without any dependencies.__

SVG.js is licensed under the terms of the MIT License.

## Installation

#### Bower:

`bower install svg.js`

#### Node:

`npm install svg.js`

#### Cdnjs:

[https://cdnjs.com/libraries/svg.js](https://cdnjs.com/libraries/svg.js)

## Documentation
Check [https://svgdotjs.github.io](https://svgdotjs.github.io/) to learn more.

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=pay%40woutfierens.com&lc=US&item_name=SVG.JS&currency_code=EUR&bn=PP-DonationsBF%3Abtn_donate_74x21.png%3ANonHostedGuest)

## Development

To develop svg.js, you have a few commands available to you. Firstly, you should clone this repo, then cd into the folder with this README and run:

    npm install

You'll now have all the dev dependencies installed, and you'll be ready to build the bundle. Once you've made your changes just run:

    npm run build

This will build svg.js and make a distribution in the `/dist` folder. While developing, this may not be so convenient as the build will fail if you have any linting errors, refer to the [standard coding styleguide](https://standardjs.com/) for style we use, linters are available for most popular text editors as well.

However, because we were too nice to put you through the pain of always having to work with a linter, we added a gentle mode that you can use by running:

    npm run build:dev

This will only warn you about linting errors and give you useful feedback about possible errors you may have in your code (but this is no substitute for tests). Please make sure that **before making any pull requests**, you pass all of our tests and can build with `npm run build` first.

> ⚠️⚠️⚠️ WARNING ⚠️⚠️⚠️
> This library still uses es5, so if you do anything like using `let`, it will
> probably break, and you probably won't be able to figure out why. This is
> only a temporary trouble 🙃 We will fix it as soon as we can!
>
> The linter is ready for es6, but the build process is not, so if you get an
> error and the linter says nothing; check for es6iness 😍

### Testing

This will set up everything. While you are working, you should make sure your changes pass all of our tests, so just run:

    npm run test

Or just launch the jasmine test runner from `/spec/SpecRunner.html`. Its good to try the spec runner on a few different browsers.

### Performance

You can run performance tests by making a new benchmarks, look in the `/bench` folder and just add a new js file with the test you want to make. We include a few examples in the repo to make it easy for you to make your own.

### Playgrounds

If you would like a simple sandbox that you can use

## Pull Requests

We welcome any pull requests and will try our hardest to review them as soon as possible. If you need any help or would like to chat, check out our [gitter group](https://gitter.im/svgdotjs/svg.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge), we are always happy to see new users!