Skip to content

Move updated libs to CRM.civisualize namespace; add license; update civix

bgm requested to merge github/fork/artfulrobot/artfulrobot-namespacing into master

Created by: artfulrobot

I found that civisualize was not working in the dashboard context. It turned out to be because Civisualize was defining d3, dc, crossfilter, but so had CiviCRM (with older versions).

These libs are now namespaced in CRM.civisualize and I've updated all the templates to use this.

Note that we now need to do this in our template scripts:

document.addEventListener('DOMContentLoaded', function() {
var d3 = CRM.civisualize.d3, crossfilter = CRM.civisualize.crossfilter, dc = CRM.civisualize.dc;
// ... body of tpl, remember to get {literal}{/literal} stuff correct. ...
});

This ensures our updated libs are loaded before we use them, as well as meaning that in the body of our script we can still just access d3... etc.

I've implemented this by creating an asset bundle. Pages that need it can bring it in with CRM_Civisualize_VisualBundle::register();

Merge request reports