raphael
raphael copied to clipboard
Applying attr for the non-availableAnim attributes
In raphael, we have a list of availableAnimAttrs e.g. "stroke-opacity", ""stroke-width", etc. Apart from these other attributes are not even applied if asked to animate.
To illustrate the fact, say elem is the concerned element,
elem.animate({ path: <Array>, 'stroke-opacity': <Number>, 'stroke-dasharray': <Array>, 'stroke-linecap': <String> }, <animDuration>)
As path and 'stroke-opacity' are animatable or to say at present, we have a support for them, gets applied with an animation but for the other two attributes(namely 'stroke-dasharray' and 'stroke-linecap') do not even get applied as:
elem.attr({ 'stroke-dasharray': <Array>, 'stroke-linecap': <String> })
That is where I suggest some improvement. We do not have code for supporting animation of these attributes, thats fine, but if an user gives it should at least get applied.
One good argument against this might be: If its animatable, then why to show the change.
And for the thing is, in any situation if he wants to apply by .attr() well and good. But if its included in animate or .animateWith, it should ideally have a visual change.
It helps keeping the code simpler, compact.
Say I have attr = {path: ...., 'stroke-linecap':...}
and I apply elem.animate(attr, duration)
The animatable property gets animated and the others gets applied, atleast if not ignored. I want to know what others think of this.