pageClass | sidebarDepth | title | lang |
---|---|---|---|
change-log |
3 |
Two.js Changelog |
en-US |
All notable changes to this project will be documented in this file. The format is inspired by Keep a Changelog, and this project adheres to Semantic Versioning.
- Improved
types.d.ts
forTwo.Group
Two.Text
rendered to SVG directly instead of<defs />
Two.SVGRenderer
disposes of unused effects from<defs />
- Override
Two.Collection.map
method to be more explicit - Improved
types.d.ts
for renderers and baseTwo
class
- Added
Two.Arc
to/extras
directory - Made
/extras/js/zui.js
ES6 compliant - Removed
/extras
modules from generated documentation - Added method documentation to
Two.ZUI
- Improved
types.d.ts
- Fixed Commonjs imports from
package.json
- Fixed documentation links
- Made
Two.Group
andTwo.Text
properties public in TypeScript types - Added overloaded methods to TypeScript types
- Fixed
Two.Path.ending
discrepancies whenTwo.Path.curved = true
- Added
Two.Gradient
parent parameter toTwo.Stop.clone
- Breaking: Added export maps so extras are imported like so
import { ZUI } from 'two.js/extras/zui.js'
- Improved
Two.Element.className
flagging andclassList
construction - Manually amended
types.d.ts
for better TypeScript developing
- Removed
#
private declared variables for better EcmaScript compatibility - Fixed
Two.Path.begining
andTwo.Path.ending
interpolation whenTwo.Anchor.relative = false
- Added
Two.Utils.read.path(string)
which allows for string interpretation of an SVG path'sd
attribute - Added
Two.Shape.worldMatrix
- Added
Two.Element
as an EcmaScript 6 class - Converted
Two.ImageSequence
to EcmaScript 6 class - Converted
Two.Sprite
to EcmaScript 6 class - Converted
Two.Texture
to EcmaScript 6 class - Converted
Two.Stop
to EcmaScript 6 class - Converted
Two.RadialGradient
to EcmaScript 6 class - Converted
Two.LinearGradient
to EcmaScript 6 class - Converted
Two.Gradient
to EcmaScript 6 class - Converted
Two.Star
to EcmaScript 6 class - Converted
Two.RoundedRectangle
to EcmaScript 6 class - Converted
Two.Rectangle
to EcmaScript 6 class - Converted
Two.Polygon
to EcmaScript 6 class - Converted
Two.Points
to EcmaScript 6 class - Converted
Two.Line
to EcmaScript 6 class - Converted
Two.Ellipse
to EcmaScript 6 class - Converted
Two.Circle
to EcmaScript 6 class - Converted
Two.ArcSegment
to EcmaScript 6 class - Converted
Two.Path
to EcmaScript 6 class - Converted
Two.Group
to EcmaScript 6 class - Converted
Two.Text
to EcmaScript 6 class - Converted
Two.Shape
to EcmaScript 6 class - Converted
Two.Matrix
to EcmaScript 6 class - Converted
Two.Registry
to EcmaScript 6 class - Converted
Two.Children
to EcmaScript 6 class - Converted
Two.Collection
to EcmaScript 6 class - Converted
Two.Events
to EcmaScript 6 class - Converted
Two.Anchor
to EcmaScript 6 class - Converted
Two.Vector
to EcmaScript 6 class Two.interpret
appropriately inherits classes to<g />
tags @elShiaLabeoufTwo.interpret
inherits classes anddata-*
attributes @elShiaLabeouf
- Improved SVG gradient interpretation
Two.interpret
can properly unwrap CSSurl()
commands- Added
Two.Gradient.units
and respected in all renderers - Default units space for
Two.Gradient
isobjectBoundingBox
- Removed destructive attribute assignments in
Two.interpret
- Interpreted gradients are reused as
<defs />
- Made mask removal possible on
Two.Group
s,Two.Path
s, andTwo.Points
' - Simplified
Two.Points.vertices
management for renderers improving adaptability
- Fixed empty vertices issue on
Two.Points
- Made
Two.load
andTwo.interpret
consistently apply SVGviewBox
- Made
Two.Rectangle.origin
act as inverse anchor positioning - Made
Two.Path.toObject
objectifyfill
andstroke
attributes that areTwo.Texture
andTwo.Gradient
- Improved reassigned id selection on interpreted SVG elements
- Improved
Two.load
group duplication - Added
Two.Points
andTwo.makePoints
to all renderers - Made
Two.release
mimic behavior ofTwo.remove
- Made
types.d.ts
a shim of a module so that it can at least be loaded in TypeScript projects while the ES6 class declaration is still work-in-progress
- Fixed
id
setting on all objects of Two.js - Fixed
Two.ArcSegment.clone
outer radius issue - Standardized vertex generation in higher order primitives
- Type declaration improvements
- Improved
Two.Group.center
,Two.Group.corner
,Two.Path.center
,Two.Path.corner
- Improved SVG gradient interpretation
- Added
<defs />
interpretation - Added
Two.Path.mask
andTwo.Text.mask
properties - Standardized
Texture.id
to be compliant with otherTwo.Shape.id
- Added ability to interpret
<clipPath />
and<image />
SVG elements
- Improved
Two.Circle.beginning
&Two.Circle.ending
behavior - Improved
fitted
logic on instances ofTwo
- Improved
Two.Children
andTwo.Collection
instantiation versatility - Improved
Two.Group.getBoundingClientRect
,Two.Path.getBoundingClientRect
, andTwo.Text.getBoundingClientRect
- Improved higher level shapes', like
Two.Circle
, ability to handle zeroed out arguments
- Improved Typescript type declarations
- Successfully export
extras/
directory in both JavaScript and JavaScript Module format - Added
Two.Shape.skewX
andTwo.Shape.skewY
@gburlet
- Exposed
Two.Shape.renderer
for easier access to underlying SVG elements - Added Typescript declaration types to Two.js
- Made
Two.Group
listen toTwo.Shape.id
changes through new observable property and flags - Improved
Two.interpret
performance and functionality through improved regular expressions @adroitwhiz Two.Group.visible
is a property held on the group and does not trickle down to children- Improved scientific notation interpretation in SVG elements
Two.load
appends a hidden DOM element to the document's<head />
so thatgetComputedStyles
works more consistently withTwo.interpret
- Added
Two.AutoCalculateImportedMatrices
to control different ways of importing SVG transformations - Fixed
Two.Text.className
application - Added basic text support in
Two.interpret
- Exposed
Two.fit
for external use - Added a
fitted
argument to theTwo
constructor to make instance adaptively match the size of its parent element - Simplified
Two.release
method - Added support for scientific notation in
Two.interpret
- Added
Two.Text.decoration
styling toTwo.CanvasRenderer
andTwo.WebGLRenderer
- Increased precision on
Two.Utils.toFixed
for Firefox transformation engine performance increase - Added support to import
<use />
tags from SVG interpretation @eulertour - Removed extraneous underscore calls from
Two.Utils
@adroitwhiz - Ensured
Two.interpret
respects theadd
parameter to be added (or not) to the current instance - Modularized Two.js classes / files @adroitwhiz
- Made Two.js compatible with
import
modules @adroitwhiz - Added wiki as VuePress project
- Exposed
resolution
parameter inTwo.makeCircle
andTwo.makeEllipse
as the final parameter - Made
Two.Circle
andTwo.Ellipse
recalculate controls points on_update
and made vertex amounts cyclical @adroitwhiz - Added ESLint scripts to development environment @adroitwhiz
- Improve performance of WebGLRenderer by leveraging uniform to construct plane and removing duplicate render calls @adroitwhiz
- Unpacked
scale
objects in WebGLRenderer @adroitwhiz - Removed unnecessary
gl.colorMask
calls @adroitwhiz - Removed
Two.Utils.toFixed
calls on Canvas and WebGLRenderers @adroitwhiz Two.Shape.clone
clonesTwo.Shape.matrix
whenTwo.Shape.matrix.manual
is set totrue
- Improved
Two.Group.mask
rendering inTwo.WebGLRenderer
- Fixed
Two.WebGLRenderer.setSize
recursive loop error - Connected
Two.Shape.className
toTwo.Shape.classList
for searching and class assignment in SVG elements - Performance improvements on canvas HTML5 styles @brandonheyer
- Added trickle down styling to
Two.Group.closed
,Two.Group.curved
, andTwo.Group.automatic
- Check for Duplicity on
Two.Group.add
- Accounted for offset positions in
Two.Path.center
andTwo.Group.center
methods - Exposed
Two.Shape.matrix
as a publicly accessible property - Removed
Two.Utils.deltaTransformPoint
and patchedTwo.Utils.decomposeMatrix
to more accurately parse matrices - Added support for various position inclusion of gradients and other effects in
Two.interpret
- Improved
Two.Utils.applySvgAttributes
rotation from SVG interpretation - Added
Two.makeArrow
for Simple Triangular Tipped Arrows @mike168m - Improved
Two.Matrix
efficiency of calculations - Added
Two.Path.dashes.offset
andTwo.Text.dashes.offset
properties for animating dashed strokes in all renderers - Fixed
Two.Path.corner
method to not be additive on successive invocations - Split
Two.Matrix.toArray
into two different functions. One for 2D transforms and one for a plain object (JSON) representation - Added
Two.Matrix.toTransformArray
intended for 2D transformation use internally WebGLRenderer
more robustly supports displaying bitmap content- Added
<g />
attributes to be inherited by children in SVG interpretation - Added
offscreenElement
as an option when constructing WebGL Renderers for WebWorker compatibility - Added
Two.Shape.position
accessor toTwo.Shape.translation
for ease of use with matter.js - Added
Two.Path.dashes
andTwo.Text.dashes
support to WebGL and Canvas Renderers
- Canvas Renderer supports dashed and non dashed paths
- Enforce
Two.Rectangle
has fourvertices
- Fixed
Two.Path.closed
on latestending
calculations
- Updated Two.js compatibility with webpack and node-canvas 2.0.0+
- Altered
Two.Path.clone
andTwo.Text.clone
to use references where possible and to_update()
on return - Improved multi-decimal and arc SVG interpretation
- Added
Two.Commands.arc
for better arc rendering across all renderers Two.Path
andTwo.Text
now havedashes
property to define stroke dashing behavior @danvanordenTwo.Vector
arithmetic methods made more consistent — still need to improve performanceTwo.Path.vertices
will not clone vectors, improving developer clarity- Two.js clone methods do not force adding to a parent
Two.ImageSequence
,Two.Sprite
, andTwo.Rectangle
haveorigin
properties for offset renderingTwo.Group.getBoundingClientRect
will pass-through on effects instead of breakTwo.interpret
apply SVG nodestyle
attributes to paths. Inherits from groupsand infers SVGviewBox
attribute against Two.js instanceTwo.interpret
improves multi-decimal formattedd
attributesTwo.ZUI
added through the new/extras
folderTwo.Text.getBoundingClientRect
now returns an estimated bounding box objectTwo.interpret
properly assigns back calculatedZ
coordinatesTwo.load
now immediately returns aTwo.Group
for use without callbacks if desired- Added
Two.Group.length
to return the calculated length of all child paths Two.Group.beginning
andTwo.Group.ending
calculate based on childTwo.Path
s for intuitive grouped animating- Added
Two.Utils.shim
to properly handlecanvas
andimage
element spoofing in headless environments - Improved conformance between primitive shapes
Two.Path.getBoundingClientRect
considers control points from bezier curvesTwo.Path.beginning
andTwo.Path.ending
calculate based on distance increasing accuracy for animation, but also performance load- Moved
Two.Path._vertices
underlying to list of rendered points toTwo.Path._renderer.vertices
- Improved accuracy of
Two.Path.ending
andTwo.Path.beginning
on open paths - Added specific
clone
method toTwo.ArcSegment
,Two.Circle
,Two.Ellipse
,Two.Polygon
,Two.Rectangle
,Two.RoundedRectangle
, andTwo.Star
primitives - Added ability to read
viewBox
property from root SVG node inTwo.interpret
- Added more reliable transform getter in
Two.interpret
- Added
rx
andry
property reading onTwo.Utils.read.rect
- Added
Two.Utils.read['rounded-rect']
to interpret Rounded Rectangles - Added ability for
Two.RoundedRectangle.radius
to be aTwo.Vector
for x, y component styling - Added ES6 compatible
./build/two.module.js
for importing library - Improved
Q
SVG interpretation Two.Texture
,Two.Sprite
, andTwo.ImageSequence
implemented inWebGLRenderer
- Added
className
property toTwo.Shape
s for easier CSS styling inSVGRenderer
@fr0 Two.Events.resize
is now bound to a renderer'ssetSize
function giving a more generic solution to change scenegraph items based on dimensions changing
- Fixed closed
Two.Path.getPointAt
method to clamp properly - Added
Two.Texture.repeat
for describing pattern invocations - Added
Two.Texture
,Two.Sprite
, andTwo.ImageSequence
- Removed
Two.Shape
inheritance forTwo.Gradient
s - Added
Two.Vector.rotate
method @ferm10n - Objects clone to parent only if parent exists @ferm10n
- Vendor agnostic
requestAnimationFrame
@ferm10n Two.Utils.Events.listenTo
andTwo.Utils.Events.stopListening
@ferm10nTwo.Utils.Events
added toTwo.Path.prototype
for event inheritance @ferm10n- Enhanced
Two.Shape.scale
to allow both numbers andTwo.Vector
as property value - Made
Two.interpret
use latest primitives - Added
Two.Circle
primitive Two.Shape.translation
is now a getter/setter and can be replaced- Fixed translation interpretation to strip out
'px'
strings - Removed
Two.SineRing
— makeTwo.Star.curved = true
and it's the same effect - Enhanced
Two.ArcSegment
,Two.Ellipse
,Two.Polygon
,Two.Rectangle
,Two.RoundedRectangle
,Two.Star
- Fixed
Two.Anchor.relative
interpretation insvg
,canvas
, andwebgl
renderers - Made Getters / Setters enumerable for iteration compatibility
- Fixed Two.Utils.Collection.splice method and added additional test
- Added compatibility with node.js, browserify, and node-canvas
- Removed third party dependencies
- Added
remove
method toTwo.Text
- Fixed ordering on same parent additions for
Two.Group
- Updated
Two.CanvasRenderer.ctx.imageSmoothingEnabled
to not use deprecated invocation, issue 178 - Fixed
Two.Group.mask
inSVGRenderer
to append to DOM correctly - Updated
require
imports to be compatible with require.js - Added
Two.Text
for programmatically writing text in Two.js
- Added support for
two.interpret
to importsvg
's gradients - Added
Two.Utils.xhr
andtwo.load
methods to asynchronously load SVG files - Added
Two.Gradient
,Two.LinearGradient
, andTwo.RadialGradient
- Added dependency check to ensure ASM loading in environments like NPM as well as in the browser
- Properly deleted
webgl
textures on removal ofTwo.Path
- Added support for
two.interpret
to importsvg
's Elliptical Arcs - Added
Two.ArcSegment
andTwo.SineRing
as new shapes invoked likeTwo.Path
@chrisdelbuck - Added
Two.Line
,Two.Rectangle
,Two.RoundedRectangle
,Two.Ellipse
,Two.Polygon
, andTwo.Star
as new shapes invoked likeTwo.Path
- Breaking: renamed
Two.Polygon
toTwo.Path
- Performance enhancements to
webgl
renderer - Performance enhancements to
canvas
renderer Leo Koppelkamm - Enabled render ordering in
Two.Group.children
based on previous augmentation - Augmented
Two.Group.children
to inherit fromTwo.Collection
effectively making it an array instead of a map Leo Koppelkamm- The map can still be accessed at
Two.Group.children.ids
- The map can still be accessed at
- Updated
Two.interpret
to handle polybezier path data - Added
Two.Group.mask
andTwo.Polygon.clip
in order to create clipping masks Two.Group
has ownopacity
property Leo Koppelkamm- Rendering optimizations Leo Koppelkamm
Two.noConflict
non-destructive command internally to the libraryTwo.interpret
decomposestransform
attribute of source tagTwo.interpret
handles item irregularities from Inkscape- Changed
Two.Identifier
to use underscores instead of hyphens for dot-notation access Leo Koppelkamm - Added
Two.Group.getById
andTwo.Group.getByClassName
methods for convenient selection Leo Koppelkamm - Added
classList
to allTwo.Shape
s Leo Koppelkamm - Enabled inference of applied styles on imported svgs Leo Koppelkamm
- Added
Two.Polygon.getPointAt
method to get coordinates on a curve/line - Added
Two.Polygon.length
property andTwo.Polygon._updateLength
method to calculate length of curve/line - Updated
Two.Group.prototype
observable properties onTwo.Polygon.Properties
to ensure each property is considered unique Two.Polygon.vertices
first and last vertex create automated control points whenTwo.Polygon.curved = true
- Updated
Two.Polygon.subdivide
method to accommodateTwo.makeEllipse
- Enabled
id
to be properly interpreted from SVG elements @chrisdelbuck - Updated
webgl
renderergetBoundingClientRect
to accommodaterelative
anchors - Updated
beginning
andending
to clamp to each other - Reorganized
Two.Polygon._update
andTwo.Polygon.plot
in order to handlebeginning
andending
properties - Updated
Two.getComputedMatrix
andTwo.Polygon.getBoundingClientRect
to adhere to nested transformations - Updated
Two.Anchor
to changecontrol
points relatively by default throughanchor.relative
property - Updated
Two.Polygon.subdivide
method to accommodatecurved = false
circumstances - Updated
svg
,canvas
, andwebgl
renderers to properly reflect holes in curvedTwo.Polygon
s - Updated
Two.Group
clone
method - Added
toObject
method toTwo.Group
,Two.Polygon
,Two.Anchor
Two.Polygon
initializespolygon.cap = 'butt'
andpolygon.join = 'miter'
based on Adobe Illustrator defaultsTwo.Polygon.subdivide
method now works withTwo.Commands.move
for noncontiguous polygons- Internally update matrices on
getBoundingClientRect
in order to remove the need to defer or wait for internal variables to be up-to-date - Refactor of renderers and scenegraph for performance optimization and lower memory footprint
- Relinquished internal events for flags
- Prototypical declaration of
Object.defineProperty
- Added
_update
andflagReset
methods toTwo.Shape
,Two.Group
, andTwo.Polygon
- Decoupled
canvas
andwebgl
renderers and are now independent - Added
_matrix.manual
to override the default behavior of aTwo.Polygon
transformation - Localized variables per file as much as possible to reduce Garbage Collection on runtime
- Can properly pass
domElement
on construction of new instance of two - Added
overdraw
boolean towebgl
renderer @arodic - Added support for ie9 svg interpretation @tomconroy
- Added
subdivide
method forTwo.Polygon
andTwo.Group
- Ensure sure that
manual
properly is set on construction ofTwo.Polygon
that it bindsTwo.Anchor.controls
change events - Added automatic High DPI support for
webgl
renderer - Updated
two.interpret(svg)
to handle compound paths - Added
Two.Anchor
which represents all anchor points drawn in two.js - Modified source to not have any instances of
window
for node use - Updated to underscore.js 1.5.1
- Added
Two.Utils.getReflection
method to properly get reflection's in svg interpretation - Made
Two.Vector
inherently not broadcast events and now needs to be explicity bound to in order to broadcast events, which two.js does internally for you - Created
Two.Utils.Collection
an observable array-like class thatpolygon.vertices
inherit @fchasen - Added
Two.Events.insert
andTwo.Events.remove
for use withTwo.Utils.Collection
- Properly recurses
getBoundingClientRect
for bothTwo.Group
andTwo.Polygon
- Added
Two.Version
to clarify forthcoming builds - Updated hierarchy ordering of
group.children
incanvas
andwebgl
renderers - Updated shallow and bidirectional
remove
method forTwo.Group
andTwo.Polygon
- Added
corner
method toTwo.Group
andTwo.Polygon
allowing anchoring along the upper lefthand corner of the form - Modified
center
method ofTwo.Group
andTwo.Polygon
to not affect thetranslation
property to stay inline withcorner
method and any future orientation and anchoring logic - Added automatic High DPI support for
canvas
renderer - Added
overdraw
boolean tocanvas
renderer - Added AMD loader compatibility @thomasrudin
- Deferred
two.update();
to account for canvas and webgl - Added
remove
andclear
methods totwo
instance - Updated svg interpretation for
webgl
context Added matrix property to allTwo.Shape
's for advanced transformations- Added
inverse
method toTwo.Matrix
- Remove execution path dependency on utils/build.js @masonblier
- Added
timeDelta
property to everytwo
instance - Added gruntfile, package.json for more integration with
npm
, and dependency free build (build/two.clean.js
) @iros - Crossbrowser compatibility with
noStroke
andnoFill
commands
- First alpha release
- Proof of Concept built from Three.js