{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Large Table Handling\n", "\n", "BeakerX table widget protects itself against tables with too many rows or columns. The interactive preview is not intended for large datasets. Here's how these situations are handled.\n", "\n", "## Too Many Rows\n", "\n", "There is a limit of 10,000 rows. Longer tables show a warning and an interactive preview of the first 1000 rows. The following cell shows what happens if you by accident return a million rows to the client." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ArrayList list = new ArrayList();\n", "for(int i = 0 ; i< 1000000 ; i++){\n", " list.add([a:i, b:i+1, c:i+i]) \n", "}\n", "def display = new TableDisplay(list);\n", "display" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Too Many Columns\n", "\n", "There is a limit of 50 columns. If there are more, then the extras are hidden and you get a UI to make your own column selection, with search." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ArrayList rowList = new ArrayList();\n", "for(int row = 0 ; row< 10 ; row++){\n", " HashMap colMap = new HashMap();\n", " for(int col = 0 ; col< 1006; col++){\n", " colMap.put('a' + col, 'b' + col); \n", " }\n", " rowList.add(colMap);\n", "}\n", "def display = new TableDisplay(rowList);\n", "display\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "display = new TableDisplay(new CSV().read(\"../resources/data/interest-rates.csv\"))\n", "display" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Very Wide Cells\n", "\n", "The width of a cell is limited to 1000 characters. If a cell goes past that, it will be truncated with a '...' appended to the end." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "display = new TableDisplay(new CSV().read(\"../resources/data/long_lines.csv\"))\n", "display" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "beakerx_kernel_parameters": { "classpath": [], "imports": [ "com.twosigma.beakerx.easyform.EasyForm", "com.github.lwhite1.tablesaw.api.ml.regression.*", "static com.twosigma.beakerx.mimetype.MIMEContainer.VimeoVideo", "static com.twosigma.beakerx.mimetype.FileLinkContainer.FileLinks", "com.twosigma.beakerx.chart.Color", "com.github.lwhite1.tablesaw.api.*", "static com.twosigma.beakerx.mimetype.MIMEContainer.IFrame", "com.twosigma.beakerx.NamespaceClient", "com.twosigma.beakerx.chart.treemap.*", "com.twosigma.beakerx.jvm.object.OutputCell", "com.twosigma.beakerx.chart.treemap.util.*", "com.github.lwhite1.tablesaw.filtering.*", "static com.twosigma.beakerx.mimetype.MIMEContainer.HTML", "static com.twosigma.beakerx.mimetype.MIMEContainer.Javascript", "static com.twosigma.beakerx.mimetype.FileLinkContainer.FileLink", "static com.twosigma.beakerx.mimetype.MIMEContainer.ScribdDocument", "static com.twosigma.beakerx.mimetype.SVGContainer.SVG", "com.twosigma.beakerx.mimetype.MIMEContainer", "net.sf.jtreemap.swing.*", "com.twosigma.beakerx.chart.histogram.*", "static com.github.lwhite1.tablesaw.api.QueryHelper.*", "com.twosigma.beakerx.chart.heatmap.HeatMap", "com.twosigma.beakerx.chart.xychart.*", "static com.twosigma.beakerx.mimetype.ImageContainer.Image", "com.github.lwhite1.tablesaw.api.ml.clustering.*", "com.twosigma.beakerx.chart.Filter", "static java.lang.Math.*", "static com.twosigma.beakerx.mimetype.MIMEContainer.YoutubeVideo", "static com.twosigma.beakerx.mimetype.MIMEContainer.Math", "com.twosigma.beakerx.fileloader.CsvPlotReader", "static com.twosigma.beakerx.mimetype.MIMEContainer.Markdown", "java.util.concurrent.TimeUnit", "com.twosigma.beakerx.chart.categoryplot.plotitem.*", "static com.twosigma.beakerx.mimetype.MIMEContainer.Video", "com.twosigma.beakerx.chart.categoryplot.*", "static com.twosigma.beakerx.mimetype.MIMEContainer.Latex", "com.twosigma.beakerx.chart.xychart.plotitem.*", "com.twosigma.beakerx.table.*", "com.twosigma.beakerx.chart.KeyboardCodes", "com.twosigma.beakerx.chart.GradientColor", "com.github.lwhite1.tablesaw.columns.*", "com.twosigma.beakerx.chart.legend.*", "com.github.lwhite1.tablesaw.reducing.*" ] }, "kernelspec": { "display_name": "Groovy", "language": "groovy", "name": "groovy" }, "language_info": { "codemirror_mode": "groovy", "file_extension": ".groovy", "mimetype": "", "name": "Groovy", "nbconverter_exporter": "", "version": "2.4.3" } }, "nbformat": 4, "nbformat_minor": 2 }