An Animated Graph provides a clean, engaging way to showcase key metrics, skillsets, or data points using an animated bar graph. The animation triggers automatically when the block scrolls into the user's viewport (inview) and resets when it leaves, ensuring visitors experience the motion every time they view the section.

Features

  • Scroll-Triggered Animation: Bar graphs smoothly animate to their target percentages only when visible on screen.
  • Automatic Viewport Reset: Progress bars reset when scrolled out of view, allowing the animation to replay cleanly on subsequent scrolls.
  • Intuitive Content Entry: Includes a custom field widget featuring a text title input and an interactive range slider (1%–100%) with live visual feedback.
  • Customizable Styling: Easily configure custom bar colours to match your site's branding.

Post-Installation

  1. Enable the module via Extend (/admin/modules) or Drush (drush en your_module_name).
  2. Add the custom field to any content type, block type, or paragraph under Manage fields.
  3. Configure the widget settings under Manage form display and customize your RGB colour/display options under Manage display.
  4. Place your content or block on a page and scroll to see the animation in action.

3.0.x JS Dependencies

Or via Composer with composer require npm-asset/jquery-inview npm-asset/jquery.easing. Ensure your Composer is pre-setup for this type of install:

# 1. Enhance composer with this tool:
composer require oomphinc/composer-installers-extender

# 2. Add the Asset Packagist repository:
composer config repositories.asset-packagist composer https://asset-packagist.org

# 3. Register npm-asset and bower-asset as installer types:
composer config --json extra.installer-types '["npm-asset", "bower-asset"]'

# 4. Map those types to Drupal's web/libraries folder (adjust 'web/' if your docroot is 'docroot/' or 'public_html/'):
composer config --json extra.installer-paths.web/libraries/{\$name} '["type:drupal-library", "type:npm-asset", "type:bower-asset"]'

Updating From Version 2?

Simply, remove any placed blocks & uninstall v2 before updating to v3 and then enable this new version. Also note, Farbtastic is no longer required as html colour input have become what the original D7/8 line could not attain natively.

Project information

Releases