cBioPortal / clinical-timeline

Use d3-timeline to visualize clinical data
GNU Lesser General Public License v3.0
22 stars 18 forks source link

Fix #102 Multiple timelines on single page #103

Closed inodb closed 8 years ago

inodb commented 8 years ago

Fix #102 multiple timelines on single page

Fix #102.

Change clinicalTimeline to a function factory. This way previous environments of the closure are not overridden on consecutive calls. Another solution would have been to use prototypes, but since we don't instantiate a ton of timelines at one page it might not be that much faster than using a closure. See also performance of prototype vs closure in different browsers: https://ssobczak.wordpress.com/2014/02/16/prototype-vs-closure-js/

Changes proposed in this pull request:

@rohangoel96