Drupal.behaviors.d3's attach function should only be run once per-visualization. Either use .once() or use a d3-processed class to mark what has been through the draw process.

This can be seen on https://drupal.org/project/d3 with dreditor enabled.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markhalliwell’s picture

Title: Only run attach behavior once » Only run attach behavior once (and general cleanup)
Status: Active » Needs review
Related issues: +#1998044: Port issue metric sparklines in statistics block on project pages to D7
FileSize
2.55 KB

I've fixed the original issue, but I also just took the time to rewrite this according to coding standards and best practices since it was so small.

Also attaching the related issue (which is where the "affects Drupal.org" tag came from).

  • Commit 56b94df on 7.x-1.x authored by Mark Carver, committed by asherry:
    Issue #2255069 by Mark Carver | drumm: Only run attach behavior once (...
asherry’s picture

Status: Needs review » Fixed

Great code, and thanks for the comments and coding standards as well!

drumm’s picture

Issue tags: +needs drupal.org deployment

Tagging so I can track deploying this for Drupal.org. A full release would be ideal, we avoid -dev whenever practical.

asherry’s picture

I'll have a beta release in the next week or so. I'm waiting on one more feature that I'd like to add in that was shown at DrupalCamp in Stanford.

drumm’s picture

Issue tags: -needs drupal.org deployment

Now deployed on Drupal.org. Thanks for the quick responses on this all around.

Wim Leers’s picture

#6: are you sure it's deployed? Five hard refreshes on http://drupal.org/project/drupal say it's still broken.

drumm’s picture

Issue tags: +needs drupal.org deployment

Yep, something misfired in packaging and we got an old version. It is ready to deploy, probably later today along with some other CSS changes I'm working on.

Wim Leers’s picture

Great :)

drumm’s picture

Issue tags: -needs drupal.org deployment

Should be deployed now.

Wim Leers’s picture

Yes, fix confirmed — thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

  • Commit 56b94df on 7.x-1.x, cdn authored by Mark Carver, committed by asherry:
    Issue #2255069 by Mark Carver | drumm: Only run attach behavior once (...