Commit Graph

546 Commits

Author SHA1 Message Date
Saivan
685d53295d The timeline is now decoupled from the real time
This commit allows the timeline to exist independently of the actual
time. This will allow it to be used to seek through an animation
with relative ease. We also made some architectural changes to the
timeline to support this.

Changes
=======
- Refactored the runner into its own file without exposing it to the
user (changed the gulpfile)
- The timeline no longer depends on the current time
- The user can supply absolute times to queue events
- Some more methods have been integrated into the timeline
2018-05-15 15:03:28 +10:00
Ulrich-Matthias Schäfer
8b80921347 make morphing work, fix inheritance, animations now work 2018-05-01 23:51:35 +02:00
Saivan
6d46e412ae The animations work with the .queue method 2018-05-01 21:47:47 +10:00
Saivan
2bbfb1c24c Another collaboration session with @Fuzzyma 2018-04-30 22:46:28 +10:00
Saivan
7a4979d0cf Initial planning for the Timeline Module
This commit just includes a few plans and a massive derrangement
of the fx module before it is to be refactored into the Timeline
module. The basic methods are included, but everything is broken
2018-04-18 20:55:06 +10:00
Saivan
c37d94a4dc Removed gbox and fixed a few typos
Since gbox is completely replaced by rbox, we don't need
it anymore. There were also a few small errors to fix.
2018-03-05 02:40:32 +11:00
Saivan
4a03212d2d Fixed recommendations by @Fuzzyma regarding transforms
This commit fixes a number of issues with transformations:
- Removed move/dmove/etc... on groups
- Sugar was being passed origin instead of ox, oy
- Updated the changelog
- Removed parseMatrix in favor of new SVG.Matrix()
- .matrix is the getter for a matrix, not .transform
- added a [02:24:41] Using gulpfile ~/Desktop/svg/svg.js/gulpfile.js
[02:24:41] Starting 'lint'...
[02:24:43] Finished 'lint' after 2.32 s directive
2018-03-05 02:24:43 +11:00
Saivan
c64401369e Added the dots test and restored the old tests 2018-03-04 21:44:05 +11:00
Saivan
026e991251 Integrated the transformations into the changes in 3.0.0 2018-03-04 20:58:07 +11:00
Saivan
59efb1e9e9 Build the final transformation code and fixed linting errors 2018-03-04 08:56:15 +11:00
Saivan
86dee4db2f Fixed most of the tests relating to transformations 2018-03-04 01:56:12 +11:00
Saivan
e065a4415b Added matrix composition and decompositions
This commit adds matrix composition and decompositions (untested),
it also adds another playground to test that this is working as
expected in every case.

We also fixed a few linting errors.
2018-03-03 22:08:26 +11:00
Ulrich-Matthias Schäfer
31e94c28d8 removed size() from SVG.Text to avoid name clash 2018-03-03 12:00:22 +01:00
Saivan
8991bd1958 All transformations except fx and Transformations are passing now
This commit modifies the specification (and in some places the code) to
reflect the changes to the transformations.
2018-03-02 23:11:11 +11:00
Saivan
25a95447f7 Investigating a possible rbox issue when transforming 2018-03-02 20:51:26 +11:00
Saivan
e0964238b0 Fixed a few more specifications regarding the new transforms 2018-03-02 19:54:01 +11:00
Saivan
a208ed5c5d Fixed some tests involving transforms and elements 2018-03-02 12:48:43 +11:00
Saivan
1582edb423 Implemented new transformations
This commit implements the new transformation model, but it also
needs to modify a few tests to fit the new format. This is still
a work in progress.
2018-03-02 12:14:42 +11:00
Saivan
1cb509f863 Made developing a little more enjoyable
This commit adds playgrounds and a build:dev mode. Now you
can call npm run build:dev to make the linter warn you about
errors without breaking. Also, we now have playgrounds, where
you can use a built version of svg.js to run your own tests.
2018-02-27 17:23:59 +11:00
Saivan
e74c37c3c4 Built the final linted file 2018-02-27 03:38:34 +11:00
Saivan
97abec91d6 Fixed a few hanging issues with the linter
This commit fixes a few typesetting issues that probably resulted
from the automated linting process
2018-02-27 03:37:31 +11:00
Saivan
bac8fc4226 So the standard linter is operational and our code is compliant
This commit completes the compliance of our code with the standard
linter. It is now building correctly and error messages are displayed
when somebody tries to build bad code!
2018-02-27 02:52:25 +11:00
Saivan
dc6a25c008 Actually added the linter to gulp and fixed most errors
This commit fixes most of the errors raised by standard.
There is still a strange call error, but that will be the
focus of the next commit
2018-02-27 02:08:37 +11:00
Saivan
15637375c5 All files now loosely abide by standard linting
This commit completes the rest of the files, making sure they are
in the standard linting format. Next we will add the linter to
the build process of our application.
2018-02-27 01:14:06 +11:00
Saivan
bec7881979 The first half of the library complies with Standard linting
This commit reformats the code so that it complies with the
standard linting style. Its currently a work in progress, but
it is meant to pave the way for linting in the build process
2018-02-27 00:48:11 +11:00
Ulrich-Matthias Schäfer
ec0a8aee0e make sure to remove event handlers from temporary image (#805) 2018-02-07 10:32:15 +01:00
Ulrich-Matthias Schäfer
47568ce3a8 remove SVG.A.show() to resolve nameclash (fix #802) 2018-02-06 23:12:35 +01:00
Ulrich-Matthias Schäfer
1f8a1993da improved SVG.on and el.on (#727)
- `SVG.on()` calls the listener in the context of the passed object. el.on always uses the svg.js object as context
- `SVG.on()` and `el.on()` now accepts multiple comma or space seperated events e.g. "mousedown, foo bar" (#727)
2017-07-28 15:07:36 +02:00
Ulrich-Matthias Schäfer
6faf2c538a The dom is checked for an svgjs:data attribute which is imported when creating an element 2017-07-28 14:20:48 +02:00
Ulrich-Matthias Schäfer
ecea84ea3a fix bug where defs returns nothing 2017-07-25 14:52:13 +02:00
Ulrich-Matthias Schäfer
ee0b340bfe add new default constructor (#714) 2017-07-25 14:19:49 +02:00
Ulrich-Matthias Schäfer
d6d3891334 Lots of breaking changes. Read below! (#646, #716)
- added `SVG.HTMLNode` which is the object wrapped around html nodes to put something in them
- moved `defs()` method from `SVG.Parent` to `SVG.Element`
- `SVG()` can be called with css selector, node or svg string, now. Without an argument it creates a new `SVG.Doc()` (#646)
- `add()`, `put()`, `addTo()`, `putIn()` now excepts all arguments accepted by `SVG()`
- `SVG.Nested` is not `overflow:visible` by default
- all `SVG.*` objects now can have a node as parameter when constructing
- `SVG()` does not set a default size anymore
2017-07-25 09:14:48 +02:00
Ulrich-Matthias Schäfer
bc9bfb6025 use children instead of childNodes (#710), renamed previous() to prev() 2017-07-10 13:51:06 +02:00
Ulrich-Matthias Schäfer
932969dca9 renamed fill() method on SVG.Gradient and SVG.Pattern to url() (#708) 2017-07-07 14:02:39 +02:00
Ulrich-Matthias Schäfer
dfae5055f1 renamed SVG.Stop constructor at() on SVG.Gradient to stop() (#707) 2017-07-07 11:24:24 +02:00
Ulrich-Matthias Schäfer
b9ce105304 reworked textPath (see #705) 2017-07-07 09:43:02 +02:00
Ulrich-Matthias Schäfer
f1bd0b48ea Merge branch 'master' into 3.0.0
Conflicts (All resolved):
	dist/svg.js
	dist/svg.min.js
	package.json
	src/doc.js
2017-07-06 11:07:29 +02:00
Ulrich-Matthias Schäfer
a19b4f1dfe fix array values which were not animated (#698) 2017-07-06 10:16:31 +02:00
Ulrich-Matthias Schäfer
ecc3882209 bump 2.6.2 2017-06-05 11:35:23 +02:00
Rémi Tétreault
49d15fa977 Update CHANGELOG and rebuild the lib 2017-05-27 01:20:09 -04:00
Rémi Tétreault
efc4fdf111 fixed SVG.FX.step so that the animation doesn't stop if an afterAll callback call animate (#677) 2017-05-14 13:21:50 -04:00
Rémi Tétreault
5f22d28f66 revert the previous commit
remove the typeof check in the initialisation of SVG.Matrix
2017-05-02 21:52:46 -04:00
Rémi Tétreault
f9a7d38782 allow SVG.Matrix to be passed SVG.Number 2017-05-01 20:41:23 -04:00
Rémi Tétreault
0ba5e1f394 fixed SVG.FX.once so that it add its callback on the last situation instead of the current one 2017-04-30 15:14:11 -04:00
Ulrich-Matthias Schäfer
5816fdb903 SVG.extend now expects exactly one module or an array of modules
Conflicts:
	dist/svg.js
	dist/svg.min.js
2017-04-25 15:10:09 +02:00
Ulrich-Matthias Schäfer
ac3b9941c7 fixed a bug in path parser which made it stop parsing when hitting z command (#665)
Conflicts:
	bench/runner.html
	dist/svg.js
	dist/svg.min.js
	package.json
2017-04-25 12:25:46 +02:00
Ulrich-Matthias Schäfer
9325620c17 fixed a bug in path parser which made it stop parsing when hitting z command (#665) 2017-04-25 12:05:49 +02:00
Ulrich-Matthias Schäfer
54362a872c ids are not generated upon creation anymore
Instead they are generated when requested (#559)
2017-04-23 12:52:51 +02:00
Ulrich-Matthias Schäfer
ab1c07e80b changed style() to css()
it now accepts array as input and returns object when no argument given (#517)
also removed sub-pixel offset fix
2017-04-22 22:16:36 +02:00
Ulrich-Matthias Schäfer
408940add5 Merge branch 'master' into 3.0.0
# Conflicts - all resolved:
#	dist/svg.js
#	dist/svg.min.js
#	package.json
#	spec/SpecRunner.html
#	spec/spec/boxes.js
#	spec/spec/element.js
#	spec/spec/image.js
#	spec/spec/svg.js
#	src/boxes.js
#	src/flatten.js
#	src/image.js
#	src/polyfill.js
#	src/style.js
#	src/svg.js
2017-04-22 20:31:58 +02:00
Ulrich-Matthias Schäfer
04e21b18c3 added options to on(), back to sloppy mode
- added `options` object to `SVG.on()` and `el.on()` (#661)
- back to sloppy mode because of problems with plugins (#660)
2017-04-21 12:49:25 +02:00
Ulrich-Matthias Schäfer
1a42cd3b05 add options arguments to on() 2017-04-20 15:29:30 +02:00
Ulrich-Matthias Schäfer
230d2a2fa4 bump 2.5.3 2017-04-17 17:13:50 +02:00
Rémi Tétreault
35ff6ba258 Fix the flip transform on both axis
This fix the bug that made calling flip without any argument (`element.flip()`)
not work.
2017-04-15 22:38:22 -04:00
dotnetCarpenter
aed9305152
skip coverage for UMD 2017-04-11 20:02:35 +02:00
dotnetCarpenter
117b7fbe8d
patch release for strict mode 2017-04-11 18:41:05 +02:00
dotnetCarpenter
1d9f1a7f8e
clean up and added changes to CHANGELOG 2017-04-11 16:46:49 +02:00
dotnetCarpenter
016720aec2
changing to strict mode - some failures occur 2017-04-11 15:23:17 +02:00
Ulrich-Matthias Schäfer
4dd7ce3388 make last test passing in svg docs 2017-04-09 21:02:20 +02:00
Ulrich-Matthias Schäfer
bb38273b6a clear does not remove parser anymore
make test work in svg documents
2017-03-29 16:10:36 +02:00
Ulrich-Matthias Schäfer
ebf7436261 make path parsing even faster 2017-03-27 19:19:38 +02:00
Ulrich-Matthias Schäfer
06c2f7b06e bump 2.5.1 2017-03-27 13:31:31 +02:00
wout
8324870a9b Speed improvements for plot() on path, polygon and poly line elements. 2017-03-24 15:17:31 +01:00
Ulrich-Matthias Schäfer
a749f7aa6e fixed SVG.PathArray.parse that did not correctly parsed flat arrays 2017-03-24 10:58:19 +01:00
Ulrich-Matthias Schäfer
459a56e40e onclick events are now bound with SVG.on, prefixed globals, relax tests to work with svgdom, image loading uses eveents now, can now run jasmine tessts with svgdom when jasmine globally available 2017-03-21 18:16:13 +01:00
Ulrich-Matthias Schäfer
60d3ad099f removed loaded() and error()/changed load()
SVG.Image is now constructed with:
- container.image(src, callback)
- new SVG.Image().load(src, callback)
2017-03-19 16:41:01 +01:00
Ulrich-Matthias Schäfer
c2ff36620b typescript definitions updated, minor fix in Transformations 2017-03-19 15:48:48 +01:00
Ulrich-Matthias Schäfer
dc846f3eea missed another one 2017-03-19 14:06:50 +01:00
Ulrich-Matthias Schäfer
77b20c72d0 missed another one 2017-03-19 14:05:16 +01:00
Ulrich-Matthias Schäfer
50ab9266a8 missed one 2017-03-18 13:18:18 +01:00
Ulrich-Matthias Schäfer
c482c60250 prefix globals with window so window can be injected properly 2017-03-18 13:13:54 +01:00
Ulrich-Matthias Schäfer
bc4542df03 prefix globals with window so window can be injected properly 2017-03-18 13:07:00 +01:00
Ulrich-Matthias Schäfer
60236e07f1 removing SVG.Set completely 2017-03-16 19:43:20 +01:00
Ulrich-Matthias Schäfer
4cf9fe96c6 rework import/export method to be more straight forward and without regex magic 2017-03-16 13:40:53 +01:00
Ulrich-Matthias Schäfer
dddf54fa85 remove feature to set style with css string 2017-03-16 13:35:35 +01:00
Ulrich-Matthias Schäfer
5c287c95a3 fixes bug in style when css string ends with ; 2017-03-16 13:15:04 +01:00
Ulrich-Matthias Schäfer
2e215f1bd2 Merge branch 'master' into 3.0.0
Conflicts (all resolved):
	dist/svg.js
	dist/svg.min.js
	spec/spec/boxes.js
2017-03-16 13:03:35 +01:00
Ulrich-Matthias Schäfer
9bfcbc184e unified all boxes (#634)
unified all boxes

- SVG.Box for everything
- bbox, rbox and viewbox as methods
- boxes can be created with string, array, object, list...
- added helper to simplify boxes code
2017-03-16 12:48:20 +01:00
Ulrich-Matthias Schäfer
a8202e5660 make more tests pass in IE 2017-03-15 11:33:09 +01:00
Ulrich-Matthias Schäfer
af45360b7b move most regexe to SVG.regex, fix matrix constructor for string argument 2017-03-14 18:43:22 +01:00
Ulrich-Matthias Schäfer
3409a21507 update specs, fix mistakes, include flatten.js to dist 2017-03-10 14:57:00 +01:00
Ulrich-Matthias Schäfer
1b8d97b266 Release 2.5.0
### Added
- added a plot and array method to `SVG.TextPath` (#582)
- added `clone()` method to `SVG.Array/PointArray/PathArray` (#590)
- added `font()` method to `SVG.Tspan`
- added `SVG.Box()`
- added `transform()` method to boxes
- added `event()` to `SVG.Element` to retrieve the event that was fired last on the element (#550)

### Changed
- changed CHANGELOG to follow the conventions described in [“Keep a CHANGELOG”](http://keepachangelog.com) (#578)
- make the method plot a getter when no parameter is passed for `SVG.Polyline`,`SVG.Polygon`, `SVG.Line`, `SVG.Path` (related #547)
- allow `SVG.PointArray` to be passed flat array
- change the regexp `SVG.PointArray` use to parse string to allow more flexibility in the way spaces and commas can be used
- allow `plot` to be called with 4 parameters when animating an `SVG.Line`
- relative value for `SVG.Number` are now calculated in its `morph` method (related #547)
- clean up the implementation of the `initAnimation` method of the FX module (#547, #552, #584)
- deprecated `.tbox()`. `.tbox()` now map to `.rbox()`. If you are using `.tbox()`, you can substitute it with `.rbox()` (#594, #602)
- all boxes now accept 4 values or an object on creation
- `el.rbox()` now always returns the right boxes in screen coordinates and has an additional paramater to transform the box into other coordinate systems
- `font()` method can now be used like `attr()` method (#620)
- events are now cancelable by default (#550)

### Fixed
- fixed a bug in the plain morphing part of `SVG.MorphObj` that is in the FX module
- fixed bug which produces an error when removing an event from a node which was formerly removed with a global `off()` (#518)
- fixed a bug in `size()` for poly elements when their height/width is zero (#505)
- viewbox now also accepts strings and arrays as constructor arguments
- `SVG.Array` now accepts a comma seperated string and returns array of numbers instead of strings
- `SVG.Matrix` now accepts an array as input
- `SVG.Element.matrix()` now accepts also 6 values
- `dx()/dy()` now accepts percentage values, too but only if the value on the element is already percentage
- `flip()` now flips on both axis when no parameter is passed
- fixed bug with `documentElement.contains()` in IE
- fixed offset produced by svg parser (#553)
- fixed a bug with clone which didnt copy over dom data (#621)
2017-03-10 09:32:16 +01:00
Ulrich-Matthias Schäfer
1e6af7da2f fix bug in box when box with top and left is given which is 0 (#632) 2017-03-09 22:51:17 +01:00
Ulrich-Matthias Schäfer
1bcabca97d fixed a bug with clone which didnt copy over dom data (#621) 2017-03-09 12:30:02 +01:00
Ulrich-Matthias Schäfer
761623033b make events cancelable by default (#550) - version 5 2017-03-09 10:07:50 +01:00
Ulrich-Matthias Schäfer
4f4f098c80 start the animation when after(All)/during(All) is called (#583) 2017-03-09 09:47:23 +01:00
Ulrich-Matthias Schäfer
8a0a4d797f Fix offset produced by svg parser (#553) 2017-03-08 19:48:20 +01:00
Ulrich-Matthias Schäfer
5587dd76de add ability to use font() method like attr() method (#620) 2017-03-08 19:34:22 +01:00
Ulrich-Matthias Schäfer
7c4e225c01 fix documet.contains bug in IE (#612) 2017-03-08 14:44:45 +01:00
Ulrich-Matthias Schäfer
0534a6760a added SVG.Box, added transform method to boxes, fix rbox (#626)
added SVG.Box, added transform method to boxes, fix rbox

Also:
- workaround for screenCTM with nested svg (FF bug)
- remove unneeded workaround in toParent()
- rbox accepts additional parameter to transform the box
2017-03-08 14:29:15 +01:00
Ulrich-Matthias Schäfer
2fc62c55b8 fixes SVG.PointArray.size() which created NaN when the bbox of the point array had zero height/width (#625)
fixes SVG.PointArray.size() which created NaN when the bbox of the point array had zero height/width

* update changelog
2017-03-08 14:02:13 +01:00
Rémi Tétreault
1f16a667e1 Fix Animating a flip transform does not work #624 2017-03-07 20:46:09 -05:00
Rémi Tétreault
9165ee80ec Make the method dequeue stop the current animation
There was a bug in the dequeue method of the FX module. It was not stopping
the current animation as it was supposed too. This bug is now fixed. Also,
I rewritten the test that @fuzzyma left commented. I changed its
implementation to not use the once callback since there seem to be some issues
when combining once and dequeue. The method stop was also modified, it now
call start only when it's revelant.
2017-03-07 20:44:58 -05:00
Ulrich-Matthias Schäfer
41b55427a7 make flip working with both axis when no parameter / only offset is passed 2017-03-06 18:52:28 +01:00
Ulrich-Matthias Schäfer
9ceaf63493 fix bug in rebuild, remove x adjusting in x method (#616) 2017-03-06 15:15:39 +01:00
Ulrich-Matthias Schäfer
083d4eb036 speed up path parsing for most cases
added test, added pathArray speed bench
2017-03-06 13:39:53 +01:00
Ulrich-Matthias Schäfer
250f97ff2c added font() method to SVG.Tspan (#599) 2017-03-05 15:42:11 +01:00
Ulrich-Matthias Schäfer
901de657bd dx()/dy() now accepts percentage values, too (#524)
but only if the value on the element is already percentage
2017-03-05 14:14:31 +01:00
Ulrich-Matthias Schäfer
020627905e fixed error in event which did not clean up SVG.handlerMap properly (#518) 2017-03-05 13:52:11 +01:00
Ulrich-Matthias Schäfer
7aea4fa6db removed at() helper which is not used anymore 2017-03-03 17:55:33 +01:00