DC.js - Mixins


Advertisements

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.

Advertisements