dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.41k stars 1.81k forks source link

Tip: make dataTable.columns accept object path #1880

Open lgrkvst opened 1 year ago

lgrkvst commented 1 year ago

Unsure if the project has found any active maintainers. In the meantime, if you like me are looking for a way to make dataTable.columns accept path into deep objects (e.g. info.address.zip), here's a way:

Change d[v] on this line: https://github.com/dc-js/dc.js/blob/0e37f132c00496555e9cd44fc706234d1a8a29b2/src/charts/data-table.js#L74

into:

v.split(".").reduce((o, i) => o[i], d)