Codeinwp / visualizer

WordPress Visualizer plugin is a simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages.
106 stars 29 forks source link

Add control for animation to start when user scrolls to the chart #1058

Open AndreeaCristinaRadacina opened 11 months ago

AndreeaCristinaRadacina commented 11 months ago

What problem does this address?

A user asked about a method for the animation to start when his visitors scroll down to the diagram and see it.

Ref: https://secure.helpscout.net/conversation/2435424329/394729?folderId=212385

What is your proposed solution?

Introduce a new option like "animation start" and have options like:

Will this feature require documentation? (Optional)

Yes, it requires documentation.

vytisbulkevicius commented 11 months ago

@AndreeaCristinaRadacina but if you have lazy-loading enabled for the chart it will only be rendered when you scroll to it (it's visible) so animation will only start only then. Your suggestion is still valid but for this case the workaround is to use lazy-loading.

So for example: [visualizer id="1" lazy="yes" class=""] Instead of: [visualizer id="18" lazy="no" class=""] if client is using a shortcode.

AndreeaCristinaRadacina commented 11 months ago

@vytisbulkevicius, I tried using lazy loading, but I thought it would be good to have such behavior in-built. Thank you!

vytisbulkevicius commented 11 months ago

I didn't see it suggested to the customer in the HS ticket that's why I shared this workaround 👌

AndreeaCristinaRadacina commented 11 months ago

Sure, I shared a few minutes ago. Thank you🙏🏻