Mapd-table example?


#1

I was trying to find a mapd-table example.It seems there is none. https://omnisci.github.io/mapd-charting/example/ also don’t have a mapd-table example.

can anyone give me an example how to use mapd-table?


#2

Hi @shovon -

Could you provide a bit more detail about what you are trying to accomplish? Are you looking for information about OmniSci the SQL engine and product, information about one of our open-source connectors (JavaScript, Python, Java) or something else?

Best,
Randy


#4

@randyzwitch it’s JavaScript.

I am trying to implement a data table using MapD Charting, mapd-connector and mapd-crossfilter

there are some example on mapd-charting example page on how to make a Bar Chart, Time Chart and some other chart.

But I didn’t find an example on how to make a data table using mapd-table

Something like this


#5

In this case, we don’t provide a customized library for making tables, as we’re using a stock tables library and the binning code is calculated using SQL. We provide the open-sourced JavaScript library as cross-filtering and our other widgets require much more customized JavaScript.

To create a data table, you can use this library or similar:
https://datatables.net/


#6

This might helps you a bit —

var allColumns = crossFilter.getColumns();
/an attempt at a data table/
var dtMultiReduce = [
{
expression: “col_name”,
agg_mode: “approx_count_distinct”,
name: “val”
},
{
expression: “*”,
agg_mode: “count”,
name: “val”
}
];

var dtDimension = crossFilter.dimension(['col_alias4']);
var dtGroup = dtDimension.group().reduceMulti(dtMultiReduce);

var dtChart = dc.mapdTable(".data-table")
    .width(800)
    .height(400)
    .size(10)
    .tableFilter(crossFilter.filter());

dtChart.dimension(dtDimension).group(dtGroup);
dtChart.showNullDimensions(true);
dtChart.sampling(true);
dtChart.colAliases(['Col_Alias1', 'Col_Alias2', 'Col_Alias3']);

#7

thanks. it solves the problem.