* typos in 1000-accesses.js * typos in transforms.js * typos in Controller.js * typos in Runner.js * typos in Timeline.js * typos in Dom.js * typos in Marker.js * typos in Mask.js * typos in Tspan.js * typos in containerGeometry.js * typos in event.js * typos in css.js * typos in data.js * typos in sugar.js * typos in EventTarget.js * typos in List.js * typos in Matrix.js * typos in SVGArray.js * typos in utils.js * typos in RAFPlugin.js * typos in Runner.js * typos in Timeline.js * typos in Dom.js * typos in Pattern.js * typos in arrange.js * typos in Box.js * typos in SVGNumber.js * typos in utils.js * typos in CONTRIBUTING.mdtags/3.1.0
@@ -6,7 +6,7 @@ When contributing to this repository, please first discuss the change you wish t | |||
## Pull Request Process | |||
When you want to make contriubtions to the project, the process is pretty simple: | |||
When you want to make contributions to the project, the process is pretty simple: | |||
1. Discuss in an issue or on gitter what you'd like to change | |||
2. Fork the repository to make your own local copy |
@@ -1,5 +1,5 @@ | |||
SVG.bench.describe('Access a dom attribues vs dom properties vs object properties', function(bench) { | |||
SVG.bench.describe('Access a dom attributes vs dom properties vs object properties', function(bench) { | |||
bench.test('using an object', function() { | |||
var sum = 0 | |||
var obj = {x: "30"} | |||
@@ -13,7 +13,7 @@ SVG.bench.describe('Access a dom attribues vs dom properties vs object propertie | |||
var obj = bench.draw.rect(100, 100).move(0, 0) | |||
}) | |||
bench.test('using dom attriutes', function () { | |||
bench.test('using dom attributes', function () { | |||
var sum = 0 | |||
var obj = bench.draw.rect(100, 100).move(0, 0) | |||
var node = obj.node |
@@ -2,7 +2,7 @@ | |||
let canvas = SVG('#canvas') | |||
// Make the green rectange | |||
// Make the green rectangle | |||
canvas.rect(200, 400).move(200, 400) | |||
.attr('opacity', 0.3) | |||
.addClass('green') |
@@ -1,6 +1,6 @@ | |||
/* globals jasmine */ | |||
/** | |||
* Jasmine RequestAnimationFrame: a set of helpers for testing funcionality | |||
* Jasmine RequestAnimationFrame: a set of helpers for testing functionality | |||
* that uses requestAnimationFrame under the Jasmine BDD framework for JavaScript. | |||
*/ | |||
function RAFPlugin (jasmine) { |
@@ -384,7 +384,7 @@ describe('Controller.js', () => { | |||
expect(pid.done(context)).toBe(true) | |||
}) | |||
it('caculates a new value', () => { | |||
it('calculates a new value', () => { | |||
const pid = new PID() | |||
expect(pid.step(0, 100, 16, {})).toBe(20) | |||
}) |
@@ -886,7 +886,7 @@ describe('Runner.js', () => { | |||
describe('private Methods', () => { | |||
describe('_rememberMorpher()', () => { | |||
it('adds a morper for a method to the runner', () => { | |||
it('adds a morpher for a method to the runner', () => { | |||
const runner = new Runner() | |||
const morpher = new Morphable() | |||
runner._rememberMorpher('move', morpher) | |||
@@ -1078,7 +1078,7 @@ describe('Runner.js', () => { | |||
}) | |||
describe('_addRunner()', () => { | |||
it('adds a runenr to the runner array of this element', () => { | |||
it('adds a runner to the runner array of this element', () => { | |||
const rect = new Rect() | |||
rect._prepareRunner() | |||
const spy = spyOn(rect._transformationRunners, 'add') | |||
@@ -1569,7 +1569,7 @@ describe('Runner.js', () => { | |||
expect(element.x()).toBe(15) | |||
}) | |||
it('retargets corectly', () => { | |||
it('retargets correctly', () => { | |||
const element = new Rect().x(10) | |||
const runner = new Runner(100).ease('-').element(element) | |||
runner._queueNumberDelta('x', 10) | |||
@@ -1606,7 +1606,7 @@ describe('Runner.js', () => { | |||
expect(element.fill()).toBe('#808080') | |||
}) | |||
it('retargets corectly', () => { | |||
it('retargets correctly', () => { | |||
const element = new Rect().x(10) | |||
const runner = new Runner(100).ease('-').element(element) | |||
runner._queueObject('x', 20) |
@@ -385,7 +385,7 @@ describe('Timeline.js', () => { | |||
it('does a step in the timeline and runs all runners', () => { | |||
const timeline = new Timeline() | |||
const runner = new Runner(1000) | |||
timeline.schedule(runner).play() // we have to play because its syncronous here | |||
timeline.schedule(runner).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(16) | |||
expect(runner.time()).toBe(16) | |||
}) | |||
@@ -393,7 +393,7 @@ describe('Timeline.js', () => { | |||
it('doenst run runners which start later', () => { | |||
const timeline = new Timeline() | |||
const runner = new Runner(1000) | |||
timeline.schedule(runner, 100).play() // we have to play because its syncronous here | |||
timeline.schedule(runner, 100).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(16) | |||
expect(runner.time()).toBe(0) | |||
}) | |||
@@ -412,7 +412,7 @@ describe('Timeline.js', () => { | |||
it('doesnt run runners if they are not active', () => { | |||
const timeline = new Timeline() | |||
const runner = new Runner(1000).active(false) | |||
timeline.schedule(runner).play() // we have to play because its syncronous here | |||
timeline.schedule(runner).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(16) | |||
expect(runner.time()).toBe(0) | |||
}) | |||
@@ -420,7 +420,7 @@ describe('Timeline.js', () => { | |||
it('unschedules runner if its finished', () => { | |||
const timeline = new Timeline() | |||
const runner = new Runner(1000) | |||
timeline.schedule(runner).play() // we have to play because its syncronous here | |||
timeline.schedule(runner).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(1000) | |||
jasmine.RequestAnimationFrame.tick(1) | |||
expect(runner.time()).toBe(1001) | |||
@@ -430,7 +430,7 @@ describe('Timeline.js', () => { | |||
it('does not unschedule if runner is persistent forever', () => { | |||
const timeline = new Timeline() | |||
const runner = new Runner(1000).persist(true) | |||
timeline.schedule(runner).play() // we have to play because its syncronous here | |||
timeline.schedule(runner).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(1000) | |||
jasmine.RequestAnimationFrame.tick(1) | |||
expect(runner.time()).toBe(1001) | |||
@@ -440,7 +440,7 @@ describe('Timeline.js', () => { | |||
it('does not unschedule if runner is persistent for a certain time', () => { | |||
const timeline = new Timeline() | |||
const runner = new Runner(1000).persist(100) | |||
timeline.schedule(runner).play() // we have to play because its syncronous here | |||
timeline.schedule(runner).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(1000) | |||
jasmine.RequestAnimationFrame.tick(1) | |||
expect(runner.time()).toBe(1001) | |||
@@ -452,7 +452,7 @@ describe('Timeline.js', () => { | |||
const timeline = new Timeline().on('finished', spy) | |||
const runner = new Runner(1000) | |||
spy.calls.reset() | |||
timeline.schedule(runner).play() // we have to play because its syncronous here | |||
timeline.schedule(runner).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(1000) | |||
jasmine.RequestAnimationFrame.tick(1) | |||
expect(spy).toHaveBeenCalled() | |||
@@ -463,7 +463,7 @@ describe('Timeline.js', () => { | |||
const timeline = new Timeline().on('finished', spy).time(1200).reverse(true) | |||
const runner = new Runner(1000) | |||
spy.calls.reset() | |||
timeline.schedule(runner, 0).play() // we have to play because its syncronous here | |||
timeline.schedule(runner, 0).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(1) | |||
expect(spy).not.toHaveBeenCalled() | |||
}) | |||
@@ -473,7 +473,7 @@ describe('Timeline.js', () => { | |||
const timeline = new Timeline().on('finished', spy).reverse(true) | |||
const runner = new Runner(1000) | |||
spy.calls.reset() | |||
timeline.schedule(runner, 0).play() // we have to play because its syncronous here | |||
timeline.schedule(runner, 0).play() // we have to play because its synchronous here | |||
jasmine.RequestAnimationFrame.tick(1) | |||
expect(spy).toHaveBeenCalled() | |||
}) |
@@ -89,7 +89,7 @@ describe('Dom.js', function () { | |||
expect(rect.addTo(g)).toBe(rect) | |||
}) | |||
it('puts an element innto another element', () => { | |||
it('puts an element into another element', () => { | |||
const g = new G() | |||
const rect = new Rect() | |||
const spy = spyOn(g, 'put') | |||
@@ -531,7 +531,7 @@ describe('Dom.js', function () { | |||
expect(rect.round(1).attr()).toEqual({ id: 'foo', x: 10.7, y: 3, width: 123.5 }) | |||
}) | |||
it('rounds the given attribues whose values are numbers to the passed precision', () => { | |||
it('rounds the given attributes whose values are numbers to the passed precision', () => { | |||
const rect = new Rect({ id: 'foo', x: 10.678, y: 3, width: 123.456 }) | |||
expect(rect.round(1, [ 'id', 'x' ]).attr()).toEqual({ id: 'foo', x: 10.7, y: 3, width: 123.456 }) | |||
}) |
@@ -38,7 +38,7 @@ describe('Marker.js', function () { | |||
}) | |||
describe('ref()', () => { | |||
it('sets refX and refY attriute', () => { | |||
it('sets refX and refY attribute', () => { | |||
const marker = new Marker().ref(10, 20) | |||
expect(marker.attr('refX')).toBe(10) | |||
expect(marker.attr('refY')).toBe(20) |
@@ -55,7 +55,7 @@ describe('Mask.js', () => { | |||
describe('Element', () => { | |||
describe('masker()', () => { | |||
it('returns the instance of Mask the current element is maskped with', () => { | |||
it('returns the instance of Mask the current element is masked with', () => { | |||
const canvas = SVG().addTo(container) | |||
const mask = canvas.mask() | |||
const rect = canvas.rect(100, 100).maskWith(mask) |
@@ -125,7 +125,7 @@ describe('Tspan.js', () => { | |||
describe('Text', () => { | |||
describe('newLine()', () => { | |||
it('creates a tspan and calles newLine() on it', () => { | |||
it('creates a tspan and calls newLine() on it', () => { | |||
const text = new Text() | |||
const tspan = text.newLine() | |||
expect(tspan).toEqual(any(Tspan)) |
@@ -101,7 +101,7 @@ describe('containerGeometry.js', () => { | |||
expect(g.x()).toBe(g.bbox().x) | |||
expect(g.x()).toBe(10) | |||
}) | |||
it('calls move with the paramater as x', () => { | |||
it('calls move with the parameter as x', () => { | |||
const canvas = SVG().addTo(container) | |||
const g = canvas.group() | |||
g.rect(100, 200).move(111, 223) | |||
@@ -127,7 +127,7 @@ describe('containerGeometry.js', () => { | |||
expect(g.y()).toBe(20) | |||
}) | |||
it('calls move with the paramater as y', () => { | |||
it('calls move with the parameter as y', () => { | |||
const canvas = SVG().addTo(container) | |||
const g = canvas.group() | |||
g.rect(100, 200).move(111, 223) |
@@ -55,7 +55,7 @@ describe('event.js', () => { | |||
expect(spy).toHaveBeenCalledWith(any(getWindow().CustomEvent)) | |||
}) | |||
it('binds to multiple events with space or comma seperated string', () => { | |||
it('binds to multiple events with space or comma separated string', () => { | |||
const eventTarget = new EventTarget() | |||
const spy = createSpy('spy') | |||
on(eventTarget, 'event1 event2, event3', spy) | |||
@@ -95,7 +95,7 @@ describe('event.js', () => { | |||
expect(spy).toHaveBeenCalledTimes(1) | |||
}) | |||
it('unbinds multiple events with space or comma seperated string', () => { | |||
it('unbinds multiple events with space or comma separated string', () => { | |||
const eventTarget = new EventTarget() | |||
const spy = createSpy('spy') | |||
on(eventTarget, 'event1 event2, event3', spy) | |||
@@ -109,7 +109,7 @@ describe('event.js', () => { | |||
expect(spy).toHaveBeenCalledTimes(3) | |||
}) | |||
it('unbinds multiple events with space or comma seperated string', () => { | |||
it('unbinds multiple events with space or comma separated string', () => { | |||
const eventTarget = new EventTarget() | |||
const spy = createSpy('spy') | |||
on(eventTarget, [ 'event1', 'event2', 'event3' ], spy) | |||
@@ -133,7 +133,7 @@ describe('event.js', () => { | |||
expect(spy).toHaveBeenCalledTimes(1) | |||
}) | |||
it('unbinds all events incuding namespaced ones when only event is passed', () => { | |||
it('unbinds all events including namespaced ones when only event is passed', () => { | |||
const eventTarget = new EventTarget() | |||
const spy = createSpy('spy') | |||
on(eventTarget, [ 'event1.ns1', 'event2.ns2', 'event3' ], spy) |
@@ -15,7 +15,7 @@ describe('css.js', () => { | |||
}) | |||
}) | |||
it('returns an object with selected css properries', () => { | |||
it('returns an object with selected css properties', () => { | |||
const rect = new Rect({ style: 'fill: none; outline-width: 1px; stroke: none' }) | |||
expect(rect.css([ 'fill', 'stroke' ])).toEqual({ | |||
fill: 'none', |
@@ -15,7 +15,7 @@ describe('data.js', () => { | |||
}) | |||
}) | |||
it('returns an object with selected data properries', () => { | |||
it('returns an object with selected data properties', () => { | |||
const rect = new Rect({ 'data-fill': 'none', 'data-outline-width': '1px', 'data-stroke': 'none' }) | |||
expect(rect.data([ 'fill', 'stroke' ])).toEqual({ | |||
fill: 'none', |
@@ -268,7 +268,7 @@ describe('sugar.js', () => { | |||
expect(spy).toHaveBeenCalledWith({ flip: 'both', origin: 'center' }, true) | |||
}) | |||
// this works because only x and y are valid flip values. Evereything else flips on both axis | |||
// this works because only x and y are valid flip values. Everything else flips on both axis | |||
it('sets flip to both and origin to number when called with origin only', function () { | |||
const rect = new Rect() | |||
const spy = spyOn(rect, 'transform') |
@@ -26,7 +26,7 @@ describe('EventTarget.js', () => { | |||
}) | |||
describe('dispatch()', () => { | |||
it('evemtually calls dispatchEvent on the target and returns the event', () => { | |||
it('eventually calls dispatchEvent on the target and returns the event', () => { | |||
const target = new EventTarget() | |||
const spy = spyOn(target, 'dispatchEvent').and.callThrough() | |||
const options = { cancelable: false } |
@@ -43,7 +43,7 @@ describe('List.js', () => { | |||
})) | |||
}) | |||
it('calls a method on every element in the list and passes aguments when a string is passed', () => { | |||
it('calls a method on every element in the list and passes arguments when a string is passed', () => { | |||
const list = new List([ 10, 11, 12 ]) | |||
expect(list.each('toString', 16)).toEqual([ 'a', 'b', 'c' ]) | |||
}) |
@@ -148,7 +148,7 @@ describe('Matrix.js', () => { | |||
} | |||
}) | |||
it('throws if matrix is not inversable', () => { | |||
it('throws if matrix is not invertible', () => { | |||
const matrix = new Matrix(0, 0, 0, 0, 0, 0) | |||
expect(() => matrix.inverse()).toThrowError('Cannot invert matrix(0,0,0,0,0,0)') | |||
}) |
@@ -23,11 +23,11 @@ describe('SVGArray.js', () => { | |||
expect(array + '').toBe('0.343 0.669 0.119 0 0 0.249 -0.626 0.13 0 0 0.172 0.334 0.111 0 0 0 0 0 1 0') | |||
}) | |||
it('parses space seperated string and converts it to array', () => { | |||
it('parses space separated string and converts it to array', () => { | |||
expect((new SVGArray('1 2 3 4')).valueOf()).toEqual([ 1, 2, 3, 4 ]) | |||
}) | |||
it('parses comma seperated string and converts it to array', () => { | |||
it('parses comma separated string and converts it to array', () => { | |||
expect((new SVGArray('1,2,3,4')).valueOf()).toEqual([ 1, 2, 3, 4 ]) | |||
}) | |||
@@ -70,7 +70,7 @@ describe('utils.js', function () { | |||
}) | |||
describe('degrees()', function () { | |||
it('converts radians to degreens', function () { | |||
it('converts radians to degrees', function () { | |||
expect(degrees(1.5 * Math.PI)).toBe(270) | |||
expect(degrees(Math.PI / 2)).toBe(90) | |||
}) |
@@ -422,7 +422,7 @@ export default class Runner extends EventTarget { | |||
} | |||
// We have to resume the timeline in case a controller | |||
// is already done without beeing ever run | |||
// is already done without being ever run | |||
// This can happen when e.g. this is done: | |||
// anim = el.animate(new SVG.Spring) | |||
// and later |
@@ -108,7 +108,7 @@ export default class Timeline extends EventTarget { | |||
// The start time for the next animation can either be given explicitly, | |||
// derived from the current timeline time or it can be relative to the | |||
// last start time to chain animations direclty | |||
// last start time to chain animations directly | |||
var absoluteStartTime = 0 | |||
var endTime = this.getEndTime() | |||
@@ -244,7 +244,7 @@ export default class Timeline extends EventTarget { | |||
// FIXME: | |||
// However, reseting in insertion order leads to bugs. Considering the case, | |||
// where 2 runners change the same attriute but in different times, | |||
// where 2 runners change the same attribute but in different times, | |||
// reseting both of them will lead to the case where the later defined | |||
// runner always wins the reset even if the other runner started earlier | |||
// and therefore should win the attribute battle |
@@ -129,7 +129,7 @@ export default class Dom extends EventTarget { | |||
this.node.id = eid(this.type) | |||
} | |||
// dont't set directly with this.node.id to make `null` work correctly | |||
// don't set directly with this.node.id to make `null` work correctly | |||
return this.attr('id', id) | |||
} | |||
@@ -24,7 +24,7 @@ export default class Pattern extends Container { | |||
return baseFind('svg [fill*="' + this.id() + '"]') | |||
} | |||
// Alias string convertion to fill | |||
// Alias string conversion to fill | |||
toString () { | |||
return this.url() | |||
} |
@@ -6,7 +6,7 @@ export function siblings () { | |||
return this.parent().children() | |||
} | |||
// Get the curent position siblings | |||
// Get the current position siblings | |||
export function position () { | |||
return this.parent().index(this) | |||
} |
@@ -159,7 +159,7 @@ export function bbox () { | |||
export function rbox (el) { | |||
const getRBox = (node) => node.getBoundingClientRect() | |||
const retry = (el) => { | |||
// There is no point in trying tricks here because if we insert the element into the dom ourselfes | |||
// There is no point in trying tricks here because if we insert the element into the dom ourselves | |||
// it obviously will be at the wrong position | |||
throw new Error(`Getting rbox of element "${el.node.nodeName}" is not possible`) | |||
} | |||
@@ -200,7 +200,7 @@ registerMethods({ | |||
zoom (level, point) { | |||
// Its best to rely on the attributes here and here is why: | |||
// clientXYZ: Doesn't work on non-root svgs because they dont have a CSSBox (silly!) | |||
// getBoundingClinetRect: Doesn't work because Chrome just ignores width and height of nested svgs completely | |||
// getBoundingClientRect: Doesn't work because Chrome just ignores width and height of nested svgs completely | |||
// that means, their clientRect is always as big as the content. | |||
// Furthermore this size is incorrect if the element is further transformed by its parents | |||
// computedStyle: Only returns meaningful values if css was used with px. We dont go this route here! |
@@ -1,6 +1,6 @@ | |||
import { numberAndUnit } from '../modules/core/regex.js' | |||
// Module for unit convertions | |||
// Module for unit conversions | |||
export default class SVGNumber { | |||
// Initialize | |||
constructor (...args) { |
@@ -43,7 +43,7 @@ export function camelCase (s) { | |||
}) | |||
} | |||
// Convert camel cased string to dash seperated | |||
// Convert camel cased string to dash separated | |||
export function unCamelCase (s) { | |||
return s.replace(/([A-Z])/g, function (m, g) { | |||
return '-' + g.toLowerCase() |