GithubHelp home page GithubHelp logo

shalevy1 / dc.datatables.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dc-js/dc.datatables.js

0.0 1.0 0.0 1.71 MB

integration of datatables.js with dc.js

License: Other

JavaScript 95.63% CSS 3.27% HTML 1.09%

dc.datatables.js's Introduction

dc.datatables.js

The intent of this project is to integrate the powerful UI, styling, and plugins of DataTables with dc.js filtered data.

Demo using the dc.js stock example, but displaying the data with a DataTable.

NOTE: dc-tableview has a lot more features than this library, check it out!

Instead of generating an HTML table using dc.dataTable and then converting the DOM elements to a DataTable, use dc.datatables.js to import the data programmatically. This should be faster and less error-prone.

Implementation:

  • .render() creates the DataTable object and maps columns defined similar to those in dc.dataTable
  • .redraw() pulls all the data (.top(Infinity) from the dimension and puts it into the DataTable using rows.add()
  • .dt() fetches the underlying DataTable object for further customization.

For control over column formatting and behavior, use the object form of columns

  • columns.type, used for sorting, is 'num' by default; use type to override this
  • columns.name, used as a unique id, is read from the label
  • columns.title, used to provide heading text, is read from the label and capitalized
  • columns.render, used to fetch and format the data, uses the function format

In limited cases, you can also use the string form of columns. This will read the field with that name, use the default numeric ordering

See something missing? File an issue on this repo, or even better, fork this project and file a pull request!

dc.datatables.js's People

Contributors

gordonwoodhull avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.