colinmeinke / wilderness

An SVG animation API
https://wilderness.now.sh
MIT License
155 stars 8 forks source link

Pass a dom node to `render` instead of a selector string #65

Closed colinmeinke closed 7 years ago

colinmeinke commented 7 years ago

There is no reason Wilderness needs to be doing querySelector work. It can just be passed a DOM node instead.

render({ selector: 'svg' }, circle)

Becomes:

const el = document.querySelector('svg')
render({ el }, circle)
colinmeinke commented 7 years ago

Same goes for shape function.

shape({ selector: 'path' })

Becomes:

const el = document.querySelector('path')
shape({ el })
colinmeinke commented 7 years ago

Closed in next cbc2211676db693d3659326912e939ba53ff4b2f