Print Data-Cubes in the terminal.
See the Data-Cube plugins page for loading instructions.
The module adds two methods to Array.prototype
:
-
print
: print a cube (or a standard array) -
info
: print summary information about a cube (or a standard array)
The methods call console.log
and return the cube/array.
Currently, the only formatting option is whether to draw lines between rows:
const setOps = require('@gjmcn/data-cube-print-console');
setOps({compact: false}); //draw lines
Notes
-
Since
print
andinfo
return the calling array, they can be used to print intermediate results. For example,x.sum().print().sqrt()
. -
print
andinfo
do not convert a standard array to a cube like core Data-Cube methods do. -
This module cannot be used in the browser; see data-cube-print-html.