raphael icon indicating copy to clipboard operation
raphael copied to clipboard

Applying attr for the non-availableAnim attributes

Open AyanGhatak opened this issue 8 years ago • 1 comments

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.

AyanGhatak avatar Apr 30 '16 19:04 AyanGhatak

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.

AyanGhatak avatar Apr 30 '16 19:04 AyanGhatak