I am going to write a small charting library (with chart types such as bar, pie, line etc.) to be used in a WordPress context. The library might depend on external libs such as D3.js, underscore.js etc. Ideally, I would not have to include all chart and all dependencies on each page.
What is a good way of managing the instantiation of these charts across WordPress pages and posts and the loading of their dependencies? Require.js examples, native WP loading resources or similar are much welcome.
Thanks.