dc-datatable
dc-datatable
is jquery-free lightweight dc.js addon library to represent data in a tabular format.
Screenshot
Quick start
You can follow one of the below methods.
Install using Npm
npm install dc-datatable
Install from Yarn
yarn add dc-datatable
Using Git repository
Clone the repository
git clone https://github.com/privateOmega/dc-datatable.git
Build from source
npm run build && npm run build_umd
Usage
This library is developed as an ES6 module but output is generated in UMD, systemJS and Common JS formats as well.
Include as a module:
; div "chartGroup";
Including files:
new dcDatatables.Datatable(div, "chartGroupName");
Dependencies:
dc-datatable
depends externally on dc.js.
To run the example, you have to include d3.js and crossfilter2
Initialization
Initialization is same as for any other chart in dc.js:
const chart = dcDatatable;
Methods
Initialization looks like this:
const chart = dcDatatable;
int size(int size)
Get or set the table size which determines the number of rows displayed in a page.
const size = chartsize;chartsize25;
void columns(object[] options)
Gets or sets column settings to be used. Check out: https://github.com/fiduswriter/Simple-DataTables/wiki/columns
chart;
void order(string order)
Gets or sets default sort type used in the chart.
chart;
bool enableSort(bool enable)
Get status or enable/disable sorting.
chart;
bool enableSearch(bool enable)
Get status or enable/disable searching.
chart;
bool enablePaging(bool enable)
Get status or enable/disable paging.
chart;
bool enableScrolling(bool enable)
Get status or enable/disable scrolling.
chart;
string scrollY(string scrollY)
Get or set scrolling options.
chart;
bool enablePagingSizeChange(bool enable)
Get status or enable/disable paging size change dropdown.
chart;
void enableHeader(bool enable)
Get status or set whether to show or hide header row.
chart;
void enableFooter(bool enable)
Get status or set whether to show or hide footer row.
chart;
bool enableAutoWidth(bool enable)
Get status or enable/disable automatic column width calculation.
chart;
Chaining
All of the exposed methods return dc-datatable
object so chaining subsequent calls is possible.
An example of this would be:
const chart = dc;chart; // and so on...
Copyright and license
Licensed under MIT license.