Closed jochenberger closed 10 years ago
Never mind, I'm about to create a branch that uses AMD/CommonJS modules for all JS files at https://github.com/jochenberger/Flotr2/tree/create-amd-modules
I'm currently struggling with a circular dependency between Flotr.js
and DefaultOptions.js
via Flotr.defaultTickFormatter
and Flotr.defaultTrackFormatter
. I'll probably have to spin out a separate module for those.
@cesutherland Is there any special reason why the default tick and track formatters are defined in Flotr.js
instead of in DefaultOptions.js
?
I don't think so – probably that's where it was originally, and not moved.
Alright, thanks. However, moving it won't actually help. There will still be the problem that DefaultOptions.js
depends on Flotr.js
(because in non-module mode it wants to assign itself toFlotr.defaultOptions
) and Flotr.js
depends on DefaultOptions.js
because addType
, addPlugin
, and drawText
want to use it.
The only way I can think of to fix that would be to merge the two files, but that would make that the default options harder to override because it would have to happen after loading Flotr.js
but before loading the plugins/types.
Another option would be not depending on DefaultOptions.js
from Flotr.js
, but that would mean that in module mode, you would have to require
and probably assign it to Flotr.defaultOptions
manually.
I guess, I'll have to think about that for a little while longer...
Make the AMD/UMD build the default build. This way, Flotr (and especially the nolibs build) can be used via requireJS or as "traditional" libraries. Also, I removed the obsolete
build.json
file.