DC.js Tutorial on DC.js Mixins

mixin is an abstract functional object having a lot of pre-defined functions, which can be mixed and used in javascript classes. however, they cannot be used as stand-alone. for example, dc.js has a mixin and dc.basemixin, which cannot be used as it is, but is used by all the dc chart classes such as the line chart, pie chart, etc. dc.js has a limited set of useful mixins to create charts easily and efficiently. they are as follows −

  • basemixin − basemixin provides common functionality for all type of charts. it integrates crossfilter and d3.js javascript library and provides a simple set of function to create charts with limited knowledge of d3.js.

  • capmixin − capmixin provides grouping support for the data elements below a limit (cap).

  • colormixin − colormixin provides color support for the charts.

  • marginmixin − marginmixin provides margin support for the charts.

  • coordinategridmixin − coordinategridmixin provides coordinate support for the charts.

  • stackmixin − stackmixin provides stacking support using the d3.layout.stack.

  • bubblemixin − bubblemixin provides bubble support for the charts.

let us understand all these mixins in detail in the subsequent chapters.