heavysixer / d4

A friendly reusable charts DSL for D3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Order of execution of features.

heavysixer opened this issue · comments

There seems to be a disconnect between when the order of execution of the rendering cycle.

For example consider this example where bars is rendered before the labels:

var total = 0;
chart.using('bars', function(bars){
    bars.x(function(){
        total+=1;
    });
})
.using('labels', function(labels){
    labels.x(function(){
          // => 0 instead of 1;
          console.log(total);
    });
});

This is actually not a bug. Features are executed in the order they are mixed into the chart not in the order they are "used".