heavysixer / d4

A friendly reusable charts DSL for D3
MIT License
432 stars 46 forks source link

Support SVG filters on chart elements #16

Open heavysixer opened 10 years ago

heavysixer commented 10 years ago

Something like this is the proposed API:

// create a chart
var columnChart = d4.baseChart()

// mix in a feature to the chart
.mixin([{name: 'bars', feature: d4.features.stacked-shapes-series}])

// when using the feature apply a filter to the rects.
.using('bars',function(bar){
      bar.svgFilter('feGaussianBlur', function(filter){
            filter
            .in("SourceGraphic")
            .stdDeviation("5");
      });
 });

Thoughts?

Timopheym commented 10 years ago

Looks cool, in D4 way. Famo.us will use modificator, but "using" looks flexible.

heavysixer commented 10 years ago

@Timopheym cool will look up modificator