<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://blog.benjaopazoc.cl/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.benjaopazoc.cl/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-10-22T17:21:09+00:00</updated><id>https://blog.benjaopazoc.cl/feed.xml</id><title type="html">Benjamín Opazo - Blog</title><subtitle>Benjamín Opazo&apos;s Blog. This is my writing companion of my main page.</subtitle><author><name>Benjamín Opazo</name></author><entry xml:lang="en"><title type="html">A table tailored to the data</title><link href="https://blog.benjaopazoc.cl/2026/09/a-table-tailored-to-the-data/" rel="alternate" type="text/html" title="A table tailored to the data" /><published>2026-09-30T21:17:00+00:00</published><updated>2026-09-30T21:17:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/09/a-table-tailored-to-the-data</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/09/a-table-tailored-to-the-data/"><![CDATA[<p>Dear reader, in this article we are going to explore the <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> algorithm that automatically adjusts the width of the columns. You are perhaps wondering <em>why</em> a piece of Software would need an <strong>algorithm</strong> (and a long, dense post like this one) to adjust the width of the columns, and the thing is, if this problem is taken seriously, you will see that the solution is not trivial. Before exploring the algorithm, I would like to tell you about the challenge Tabula Rasa faces every time it opens a CSV file. If you wish, you can skip straight to the <a href="#the-column-algorithm">algorithm</a> section, or alternatively, you can read this entertaining introduction. I recommend reading the whole article, because at the end, you will see a visualization like the following:</p>

<figure class="article__figure article__figure--media" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses.png" aria-label="A table of four columns that ends before the right edge of the screen; the space left over is marked with a dashed box. Below the screen, the bound V and the sum of the column widths, which reaches W_T and continues dashed up to V. Each column has its own colour: ochre, blue, green and red. Five empty glasses appear: one above each column, as tall as the width the column would need to truncate nothing, and a fifth to the right of the screen, labelled V − W_T. A line in each column&#39;s colour measures its width over the screen, turns until it stands vertical and settles beside its glass; the dashed stretch between W_T and V does the same beside the fifth glass, and the sum is left ending at W_T. The glasses fill up to those lines: the water level is the column&#39;s width. The blue and the green, both capped at W_k, start at the same level; the ochre and the red are already full and get a lid. Then the fifth glass empties while the blue and the green fill at the same rate, and their columns widen with them while the leftover space shrinks. The green fills first and gets its lid; the blue keeps rising until the fifth glass is empty, the table takes up the whole screen and the sum reaches V. The truncated cells get their text back, except the longest one in the blue column." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 1.</span> This is how Tabula Rasa divides the screen among the columns that ask for more space.</figcaption></figure>
<figure class="article__figure article__figure--media" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.png" aria-label="A table of four columns that ends before the right edge of the screen; the space left over is marked with a dashed box. Below the screen, the bound V and the sum of the column widths, which reaches W_T and continues dashed up to V. Each column has its own colour: ochre, blue, green and red. Five empty glasses appear: one above each column, as tall as the width the column would need to truncate nothing, and a fifth to the right of the screen, labelled V − W_T. A line in each column&#39;s colour measures its width over the screen, turns until it stands vertical and settles beside its glass; the dashed stretch between W_T and V does the same beside the fifth glass, and the sum is left ending at W_T. The glasses fill up to those lines: the water level is the column&#39;s width. The blue and the green, both capped at W_k, start at the same level; the ochre and the red are already full and get a lid. Then the fifth glass empties while the blue and the green fill at the same rate, and their columns widen with them while the leftover space shrinks. The green fills first and gets its lid; the blue keeps rising until the fifth glass is empty, the table takes up the whole screen and the sum reaches V. The truncated cells get their text back, except the longest one in the blue column." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 1.</span> This is how Tabula Rasa divides the screen among the columns that ask for more space.</figcaption></figure>

<p>And you will cry with joy.</p>

<h2 id="understanding-the-problem-of-columns">Understanding the problem of Columns</h2>

<p>As you may <a href="/2026/08/the-origin-of-tabula-rasa/">already know</a>, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> was born from my frustration with the lack of good tabular data viewers, of CSV files in particular. What’s more, and apparently this was asking too much, I had not managed to find a piece of Software that fit my needs, nor those of the people who live <em>submerged in data</em>. One of the most serious usability problems of tabular data viewers (read: Excel, Google Drive, even applications like PhpMyAdmin) is how little attention is paid to the distribution of the data in the table, or rather, to the width that is automatically assigned to the columns.</p>

<p>And the thing is that, in general, applications tend to fall into one of these two sins:</p>

<ul>
  <li>They adjust the width of the column to the content, or</li>
  <li>They apply a standard size to the columns</li>
</ul>

<p>The problem is that data is rarely <em>homogeneous</em> in a table, therefore, displaying the data by applying <strong>uniform criteria</strong> ends up producing indecipherable tables. The columns end up wider than necessary, or narrower than necessary.</p>

<span class="article__fig-anchor" id="fig-lo-sparse"></span><figure class="article__figure" data-fig-label="lo-sparse"><img src="/assets/img/tabula-rasa-columns/lo_sparse.png" alt="LibreOffice Calc with a file of 15 rows and five columns: a sequential number, a product code, a date and time, an IP address and a URL, after fitting each column to the width of its content. In three of the columns there is a single value much longer than the rest: a product code in row 7, an IPv6 address in row 4 and a URL with a long tail of parameters in row 10. That single value sets the width of its whole column, so the other cells are left almost empty: the URL column takes up more than half the screen and still can&#39;t show the long URL in full." loading="lazy" data-zoomable="" /><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 2.</span> Columns fitted to their content: a single long value widens the whole column. <a href="/assets/files/tabula-rasa-columns/autofit.csv">Fictitious data</a>.</figcaption></figure>

<p>These applications, therefore, end up counting on the user to do their <em>homework</em> and format their table manually. They will apply specific column widths to each value, choose the font, add colors to it, etc. The problem is that if the user wants to keep that formatting in the table, they must convert their CSV files to a proprietary format like Excel or Numbers.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> inverts that responsibility and seeks to arrange the data in the table <strong>automatically</strong>, so that a user who opens a file finds the data just as they would want it: ready to be analyzed.</p>

<p>To achieve that goal, there are certain rules, or rather heuristics, that I have been developing and that make it possible to improve the user experience in the context of tabular data viewers, some rules have to do with how the data is displayed, other rules are more associated with how we model the interactions in the application itself. Today we will focus on how we will display the data:</p>

<ul>
  <li>Data has value only in its context.</li>
  <li>The context of a value includes the column title, and the data in the adjoining rows and columns.</li>
  <li>A badly truncated value is useless (I have already talked about that in <a href="/2026/09/defaults-that-disappear/#truncations">this post</a>)</li>
</ul>

<p>The most important difficulty <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> faces is that a CSV file is plain text, it has no metadata, nor does it have styles embedded in the file, for example. Therefore, the only way Tabula Rasa has of enriching <strong>how</strong> it displays the data is <strong>with the data itself</strong>.</p>

<p>Now then, when you, dear reader, face the same challenge of formatting your CSVs using your tabular data viewer of yore, you are in the same situation as Tabula Rasa, because you have only the messy data in front of your eyes, and you use some <em>internal heuristic</em> to format your data.</p>

<p>Therefore, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> has no excuses, it must arrange your data, and it must do it well, even when the only thing it has at hand is just the data and nothing else. And boy does it pull it off! Well… each user’s <em>internal heuristics</em> are probably different, which is why the Software will try to arrange the data in the best way possible, but the user will always be able to arrange it to their liking afterwards.</p>

<h2 id="the-column-algorithm">The column algorithm</h2>

<p>The goal of the column algorithm is to make <em>A table tailored to the data</em>. Imagine that Tabula Rasa is your data’s tailor: it takes the measurements, plans the <em>cuts</em> of the fabric, sews the pieces of the suit and, finally, you put it on. The wonder of this suit is that if it is not to your liking, no problem! you can modify it.</p>

<p>Next we will look at the different parts of the algorithm, and how they combine to show your table like this</p>

<span class="article__fig-anchor" id="fig-tr-wall"></span><figure class="article__figure article__figure--media" data-fig-label="tr-wall">
  <video src="/assets/video/tabula-rasa-defaults/en_tr_wall.mp4" aria-label="Tabula Rasa scrolling right across all eighteen columns of a survey file. Each column has taken the width its content needs — narrow for id and age, wide for the free-text answers. Figures are right-aligned with thousands separators, from 73 up to 2,413,800,000, and no answer runs past about three lines before ending in an ellipsis. The row numbers stay pinned at the left edge and the column headers stay legible all the way across, so no row is ever orphaned from its identity" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 3.</span> A survey opened in Tabula Rasa. <a href="/assets/files/tabula-rasa-defaults/en_survey.csv">Fictitious data</a>.</figcaption></figure>

<p>instead of like this</p>

<span class="article__fig-anchor" id="fig-lo-wall"></span><figure class="article__figure article__figure--media" data-fig-label="lo-wall">
  <video src="/assets/video/tabula-rasa-defaults/en_lo_wall.mp4" aria-label="LibreOffice Calc scrolling right across the same survey file. Every column is the same default width whatever it holds, so the two thousand-word answers force their rows open to fill the window while the single-line rows stay pressed together, and the text in every long cell is cut flat at the column border. Past the last column of data the sheet runs on into empty lettered columns" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 4.</span> The same survey in LibreOffice: a wall of text. <a href="/assets/files/tabula-rasa-defaults/en_survey.csv">Fictitious data</a>.</figcaption></figure>

<p>To do that, we will first understand <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>’s design decisions, and how they affect the algorithm, then we will try to formalize the users’ intentions, in order to transform those intentions into widths and heights of columns and rows.</p>

<p>From a <em>bird’s-eye view</em>, Tabula Rasa’s algorithm does the following:</p>

<ul>
  <li>Calculates the width budget of each column</li>
  <li>Assigns that budget to each <em>column</em> intelligently</li>
  <li>Defines the height of each <em>row</em> given the calculated widths</li>
</ul>

<p>Each of those steps has details that make them very interesting… and make this post a bit long. Honestly, and although my recommendation may be a bit biased, I think this journey is truly worth it!</p>

<h3 id="tabula-rasas-design">Tabula Rasa’s design</h3>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>’s design is the starting point of the algorithm, because it lets us easily calculate how much space our table will need to display all its data.</p>

<p>To build up the algorithm, we have to start from the basic unit of a table: the cell. Once we have modeled a cell correctly, you will notice that we will be able to create an <em>abstraction layer</em> and in general we will start thinking only in terms of rows and columns.</p>

<p>There is a particular piece of the design that was not chosen at random. A perceptive <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> user will have noticed that all of Tabula Rasa’s fonts are <a href="https://en.wikipedia.org/wiki/Monospaced_font">monospace</a>, and that is very useful, because calculating the <em>space budget of a cell</em> (how many pixels a cell needs to display its data without truncating it) is simply</p>

\[b = N \cdot w
\label{eq:presupuesto}\]

<p>where \(N\) is the number of characters in the cell and \(w\) the width in pixels of each character.</p>

<span class="article__fig-anchor" id="fig-budget-row"></span><figure class="article__figure article__figure--media" data-fig-label="budget-row" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-row.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-row.png" aria-label="A row of 5 boxes, each w = 8 px wide, which together measure b = 40 px. First the row adds boxes one by one up to N = 10 and b grows to 80 px; then each box widens to w = 12 px and b reaches 120 px. Finally both go back to N = 5 and w = 8 px, and b to 40 px." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 5.</span> Budget visualization.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-row" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-row-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-row-light.png" aria-label="A row of 5 boxes, each w = 8 px wide, which together measure b = 40 px. First the row adds boxes one by one up to N = 10 and b grows to 80 px; then each box widens to w = 12 px and b reaches 120 px. Finally both go back to N = 5 and w = 8 px, and b to 40 px." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 5.</span> Budget visualization.</figcaption></figure>

<p>Note that the previous visualization is one-dimensional, but our model would probably benefit if we consider that cells can have height. If we have a cell that has \(N\) characters, and this cell has a width \(\hat{W}\), then its height \(H\) will be given by:</p>

\[H = \ceil{N / \hat{W}}
\label{eq:altura}\]

<p>where \(\ceil{\,\cdot\,}\) rounds a number up to the next integer (e.g.: 4.3 -&gt; 5), therefore \(H\) will always be an integer. Now, we must be careful with the previous equation, in particular with \(\hat{W}\), because what it represents is the <strong>width in characters of a cell</strong>, so the equivalent in pixels would be \(W = \hat{W} \cdot w\). That is why we can divide \(N\) by \(\hat{W}\)!</p>

<blockquote class="note">
  <p>If you feel confused by the different variables we have introduced, don’t worry, so far we have been careful to distinguish when the variables are measured in <em>pixels</em> and when they are measured in <em>characters</em>. But notice that we are building the abstraction so that we stop caring about that. From here on, except for one edge case, what we will pay attention to is <strong>pixels</strong>.</p>
</blockquote>

<p>If we rearrange equations \(\ref{eq:presupuesto}\) and \(\ref{eq:altura}\), we will see that the budget \(b\) has a bit of the shape of an <em>area</em>:</p>

\[b \approx H \cdot \hat{W} \cdot w\]

<p>But \(b\) is not exactly an area. It is a single number that encodes a whole family of rectangles, and out of that family it tells us which one is the <em>widest rectangle where all the characters fit without being truncated:</em></p>

<span class="article__fig-anchor" id="fig-budget-area"></span><figure class="article__figure article__figure--media" data-fig-label="budget-area" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-area.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-area.png" aria-label="A cell of 16 boxes laid out in lines of width Ŵ = 6, which gives H = 3 lines; the last line has two empty slots, marked with a dashed border. The enclosed area is b ≈ 144 px, with each box w = 8 px wide. When the cell narrows to Ŵ = 4, the boxes flow into H = 4 lines with no empty slots and b ≈ 128 px; when it widens to Ŵ = 8 there are H = 2 lines and b ≈ 128 px; when it goes back to Ŵ = 6 the empty slots reappear and b ≈ 144 px. Then the boxes widen to w = 12 px and the area grows to b ≈ 216 px, before going back to w = 8 px. At the end N = 16 appears, the number of boxes." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 6.</span> Budget visualization in 2 dimensions.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-area" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-area-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-area-light.png" aria-label="A cell of 16 boxes laid out in lines of width Ŵ = 6, which gives H = 3 lines; the last line has two empty slots, marked with a dashed border. The enclosed area is b ≈ 144 px, with each box w = 8 px wide. When the cell narrows to Ŵ = 4, the boxes flow into H = 4 lines with no empty slots and b ≈ 128 px; when it widens to Ŵ = 8 there are H = 2 lines and b ≈ 128 px; when it goes back to Ŵ = 6 the empty slots reappear and b ≈ 144 px. Then the boxes widen to w = 12 px and the area grows to b ≈ 216 px, before going back to w = 8 px. At the end N = 16 appears, the number of boxes." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 6.</span> Budget visualization in 2 dimensions.</figcaption></figure>

<p>Note, also, that the width and height of each cell can be calculated with very simple and direct equations, which makes the algorithm quite efficient.</p>

<p>Moreover, a perceptive reader will have noticed that in general I only talk about the <em>column width algorithm</em>, and that is also by design: the width of the columns calls the shots, and the height is calculated as a consequence of the width, except for <a href="#adjusting-to-the-data">one particular case</a> that we will explore later. This way, we reduce this multidimensional and perhaps recursive problem to a fairly approachable one. The following diagram helps illustrate the <em>ethos</em> behind the algorithm.</p>

<span class="article__fig-anchor" id="fig-causal-chain"></span><figure class="article__figure article__figure--media" data-fig-label="causal-chain" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/en_manim_causal-chain.mp4" poster="/assets/video/tabula-rasa-columns/en_manim_causal-chain.png" aria-label="At the top, a chain of four boxes joined by arrows: width, wrap, lines and row height. Below, a table with a header row, row numbers and three columns; the text in the cells is drawn as bars. The middle column narrows and width lights up: its text stays on a single line and what no longer fits sticks out, dimmed, past the edge. Wrap lights up. Lines lights up: the text that stuck out folds down into new lines, squeezed inside the row: one short cell doesn&#39;t change, another drops a small piece, another a larger one, and the longest ends up on three lines. Row height lights up: each row grows to the height of its tallest cell, which is outlined; row 1 was already tall because of the text in the first column. Then wrapping is turned off: width stays dark, wrap lights up, the lines go back onto a single one, sticking out past the edge, and the rows shrink. Finally the table returns to its initial state." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 7.</span> Ethos of Tabula Rasa's algorithm.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="causal-chain" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/en_manim_causal-chain-light.mp4" poster="/assets/video/tabula-rasa-columns/en_manim_causal-chain-light.png" aria-label="At the top, a chain of four boxes joined by arrows: width, wrap, lines and row height. Below, a table with a header row, row numbers and three columns; the text in the cells is drawn as bars. The middle column narrows and width lights up: its text stays on a single line and what no longer fits sticks out, dimmed, past the edge. Wrap lights up. Lines lights up: the text that stuck out folds down into new lines, squeezed inside the row: one short cell doesn&#39;t change, another drops a small piece, another a larger one, and the longest ends up on three lines. Row height lights up: each row grows to the height of its tallest cell, which is outlined; row 1 was already tall because of the text in the first column. Then wrapping is turned off: width stays dark, wrap lights up, the lines go back onto a single one, sticking out past the edge, and the rows shrink. Finally the table returns to its initial state." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 7.</span> Ethos of Tabula Rasa's algorithm.</figcaption></figure>

<p>Note, dear reader, that there is a variable, perhaps a little hidden, but a relevant one: text wrapping, that is, whether we want the text to take up more than one line or not. Even so, a user in their madness can turn it off if that is what they want.</p>

<h3 id="user-intention">User intention</h3>

<p>Remember that one of the heuristics of <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>’s design is that <em>the application’s buttons must translate the user’s intention</em>, and for that same reason, if we are going to design the buttons, we must be careful to faithfully interpret the user’s intention when they click on a button or on a specific menu. For column width, the user has 4 options:</p>

<table>
  <thead>
    <tr>
      <th>Intention</th>
      <th>Interpretation</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Min</td>
      <td>Shrink the column to the minimum Tabula Rasa allows.</td>
    </tr>
    <tr>
      <td>Fit</td>
      <td>Fit the width of the column to the cell with the most text.</td>
    </tr>
    <tr>
      <td>Auto</td>
      <td>Tabula Rasa takes care of the width. It is the default, and the interesting part of the algorithm.</td>
    </tr>
    <tr>
      <td>Manual</td>
      <td>The user wants to adjust the column to their liking. It is very important that they have that freedom.</td>
    </tr>
  </tbody>
</table>

<p>As you can see, the <strong>Min</strong> and <strong>Manual</strong> cases are trivial and don’t interest us. <strong>Auto</strong> is the reason we are here, and <strong>Fit</strong> is, deep down, a special case of <strong>Auto</strong>.</p>

<p>On the other hand, in <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, the user has the following options for height:</p>

<table>
  <thead>
    <tr>
      <th>Intention</th>
      <th>Interpretation</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Auto</td>
      <td>Tabula Rasa takes care of the height, limiting the maximum height to \(H_{\max} = 3\).</td>
    </tr>
    <tr>
      <td>1, 2, 3, …</td>
      <td>The user chooses \(H_{\max}\), that is, how many lines each row can use at most.</td>
    </tr>
    <tr>
      <td>Fit</td>
      <td>Each row grows until it shows the full text of its longest cell, no matter how tall it ends up.</td>
    </tr>
  </tbody>
</table>

<p>Recall figure <a class="figref" href="#fig-causal-chain">7</a>, there we saw that the algorithm calculates the width for each column, and gives each cell the height it needs to display the text, with a maximum given by \(H_{\max}\) (which in the case of <strong>Auto</strong> is \(3\)). If the height is in <strong>Fit</strong> mode, then the height grows until it shows all the text.</p>

<p>We could say, then, that <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>’s algorithm transforms the user’s intention (given by the two tables above) into the width and height needed to display the table.</p>

<h3 id="taking-your-datas-measurements">Taking your data’s measurements</h3>

<p>Although the design lets us calculate the budget that each individual cell <em>asks for</em> in order to display all its data, if the data is <em>heterogeneous</em>, that budget can be very inefficient when applied to the whole column.</p>

<p>That is why <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> analyzes the data to find the balance of how much data to show, given the <em>shape</em> in which your data comes. And perhaps, dear reader, you will think that taking the measurements is the trivial part of the algorithm, but it wouldn’t have its own section if that were the case: there are certain <em>enormous tiny details</em> that we don’t want to overlook.</p>

<p>The biggest sin tabular data viewers commit is assuming that data is <em>homogeneous</em> when it rarely is. It is quite common to come across a value in row 1000 that is much bigger than its peers.</p>

<p>Imagine the answers column of a survey where people don’t care to write long answers, a simple <em>yes</em> or <em>no</em> will do. But every now and then you have a user (probably you) who <strong>really loves <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code></strong> and wants to tell you about their experience in lavish detail. In that case, you don’t want to spend precious space widening every row of the answers column just to make room for that lengthy answer. Your table would look practically empty! It is more convenient to truncate the cell that is abnormally long, and if you are interested in reading it you can move the mouse over the lengthy answer and a friendly <em>hover</em> will appear with the full text.</p>

<span class="article__fig-anchor" id="fig-text-truncate"></span><figure class="article__figure article__figure--media" data-fig-label="text-truncate">
  <video src="/assets/video/tabula-rasa-defaults/en_tr_text-truncate.mp4" aria-label="A column of long survey answers in Tabula Rasa, each cut to three lines ending in an ellipsis so that every row keeps the same modest height. The pointer settles on one cell: it lights up in teal with a small cyan dot at its corner, and a tooltip opens over the rows beneath it carrying that answer in full. Then the column is widened and the same answers re-flow — still three lines each, but with more of every sentence visible." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 8.</span> Truncations and Tooltip in Tabula Rasa. <a href="/assets/files/tabula-rasa-defaults/en_survey.csv">Fictitious data</a>.</figcaption></figure>

<p>That is why <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> measures two candidate widths per column when loading a file: \(\hat{W}_{\max}\), the width the column would need to show its longest cell on a single line, and \(\hat{W}_{95}\), the width at which 95% of the cells fit in full (the \(p_{95}\)). That way, when assigning the budget \(b\), we can truncate the sample’s <em>outliers</em> by choosing \(\hat{W}_{\max}\) or \(\hat{W}_{95}\) according to some heuristic of our choosing. Phew! We have been saved from assuming that data is homogeneous!</p>

<span class="article__fig-anchor" id="fig-tail-p95"></span><figure class="article__figure article__figure--media" data-fig-label="tail-p95" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-p95.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-p95.png" aria-label="A table of 7 rows, whose text is drawn as bars. In the second column almost every answer is short, but the one in row 3 is very long and the column is as wide as it asks; for a moment the space the other cells don&#39;t use, almost the whole column, is marked with dashed boxes. Over the column, Ŵmax is measured, which only reaches the long answer, and Ŵ95, which covers all the rest. Ŵ95 is chosen: the column narrows, the empty space almost disappears, and only the long answer is truncated, sticking out dimmed past the edge." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 9.</span> Choosing the p95: the column narrows and only the longest value is truncated.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-p95" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-p95-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-p95-light.png" aria-label="A table of 7 rows, whose text is drawn as bars. In the second column almost every answer is short, but the one in row 3 is very long and the column is as wide as it asks; for a moment the space the other cells don&#39;t use, almost the whole column, is marked with dashed boxes. Over the column, Ŵmax is measured, which only reaches the long answer, and Ŵ95, which covers all the rest. Ŵ95 is chosen: the column narrows, the empty space almost disappears, and only the long answer is truncated, sticking out dimmed past the edge." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 9.</span> Choosing the p95: the column narrows and only the longest value is truncated.</figcaption></figure>

<p>But dear reader, the algorithm doesn’t stop there, because some data is much more <em>expensive</em> to truncate than other data. As we saw in <a href="/2026/09/defaults-that-disappear/#truncations">this post</a>, truncating numbers strips them of value immediately (if you see <code class="language-plaintext highlighter-rouge">8...</code>, you don’t know if it is <code class="language-plaintext highlighter-rouge">82</code>, <code class="language-plaintext highlighter-rouge">8M</code> or <code class="language-plaintext highlighter-rouge">8.02</code>), but truncating text is less serious (if you see “You can’t make a silk purse…”, you know how that saying ends)<sup id="fnref:proverb"><a href="#fn:proverb" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>. Consequently, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> will never truncate a number, but it gives itself license to truncate text (applying the \(p_{95}\) rule when necessary).</p>

<p>So it is worth asking, what does “when necessary” mean? Note that applying the \(p_{95}\) rule like that, to the letter, could backfire on us. There is a <em>certain</em> amount of heterogeneity in the data that is <em>acceptable</em>, perhaps choosing \(\hat{W}_{\max}\) in certain cases only means seeing a couple of empty pixels per row instead of 100.</p>

<span class="article__fig-anchor" id="fig-tail-blind"></span><figure class="article__figure article__figure--media" data-fig-label="tail-blind" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-blind.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-blind.png" aria-label="Another table of 7 rows, with the second column measured: Ŵmax and Ŵ95 are very close, because the longest answer, in row 5, is only slightly longer than the rest. Ŵ95 is chosen anyway: the column barely narrows and the answer in row 5 is truncated. Below the table the difference Ŵmax − Ŵ95 appears, a narrow strip: it is all the space that was saved." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 10.</span> The p95 applied to the letter: a perfectly readable value is truncated to save very little.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-blind" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-blind-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-blind-light.png" aria-label="Another table of 7 rows, with the second column measured: Ŵmax and Ŵ95 are very close, because the longest answer, in row 5, is only slightly longer than the rest. Ŵ95 is chosen anyway: the column barely narrows and the answer in row 5 is truncated. Below the table the difference Ŵmax − Ŵ95 appears, a narrow strip: it is all the space that was saved." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 10.</span> The p95 applied to the letter: a perfectly readable value is truncated to save very little.</figcaption></figure>

<p>That is why <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> also calculates the following:</p>

\[\hat{W}_{\max} - \hat{W}_{95} &gt; C
\label{eq:dispersion}\]

<p>Where \(C\) is the threshold that lets us decide how <em>expensive</em> it is to choose \(\hat{W}_{\max}\) over \(\hat{W}_{95}\).</p>

<p>For example, if \(\hat{W}_{\max} - \hat{W}_{95} &lt; C\) then the table would choose \(\hat{W}_{\max}\):</p>

<span class="article__fig-anchor" id="fig-tail-gap-keep"></span><figure class="article__figure article__figure--media" data-fig-label="tail-gap-keep" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-keep.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-keep.png" aria-label="The table from the previous figure, whose longest answer is only slightly longer than the rest. Over the column, Ŵmax and Ŵ95 are measured. The distance between the two measures is marked below the table and drops down to the left, labelled Ŵmax − Ŵ95. The table dims and, below that measure, starting from the same guide, a ruler of length C appears, with a vertical guide at its end. The difference falls short of C. Next to the comparison Ŵmax appears in the accent colour, and rises up to its measure above the table as the table comes back; Ŵ95 disappears and the column keeps its width." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 11.</span> The difference is smaller than C: the column keeps its maximum width.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-gap-keep" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-keep-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-keep-light.png" aria-label="The table from the previous figure, whose longest answer is only slightly longer than the rest. Over the column, Ŵmax and Ŵ95 are measured. The distance between the two measures is marked below the table and drops down to the left, labelled Ŵmax − Ŵ95. The table dims and, below that measure, starting from the same guide, a ruler of length C appears, with a vertical guide at its end. The difference falls short of C. Next to the comparison Ŵmax appears in the accent colour, and rises up to its measure above the table as the table comes back; Ŵ95 disappears and the column keeps its width." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 11.</span> The difference is smaller than C: the column keeps its maximum width.</figcaption></figure>

<p>Otherwise, if \(\hat{W}_{\max} - \hat{W}_{95} &gt; C\) then the table chooses \(\hat{W}_{95}\)</p>

<span class="article__fig-anchor" id="fig-tail-gap-cut"></span><figure class="article__figure article__figure--media" data-fig-label="tail-gap-cut" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-cut.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-cut.png" aria-label="The table whose answer in row 3 is very long. Over the column, Ŵmax and Ŵ95 are measured. The distance between the two measures is marked below the table and drops down to the left, labelled Ŵmax − Ŵ95. The table dims and, below that measure, starting from the same guide, a ruler of length C appears, with a vertical guide at its end. The difference goes past C. Next to the comparison Ŵ95 appears in the accent colour, and rises up to its measure above the table as the table comes back; Ŵmax disappears and the column narrows, leaving only the long answer truncated." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 12.</span> The difference exceeds C: the column narrows to the p95.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-gap-cut" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-cut-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-cut-light.png" aria-label="The table whose answer in row 3 is very long. Over the column, Ŵmax and Ŵ95 are measured. The distance between the two measures is marked below the table and drops down to the left, labelled Ŵmax − Ŵ95. The table dims and, below that measure, starting from the same guide, a ruler of length C appears, with a vertical guide at its end. The difference goes past C. Next to the comparison Ŵ95 appears in the accent colour, and rises up to its measure above the table as the table comes back; Ŵmax disappears and the column narrows, leaving only the long answer truncated." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 12.</span> The difference exceeds C: the column narrows to the p95.</figcaption></figure>

<p>The variable \(C\) has some details that make it interesting:</p>

<ul>
  <li>It is a fixed threshold, therefore it is not going to vary with the width of the text of each column or each cell.</li>
  <li>Its unit of measure is characters, and since the font is monospace, \(\hat{W}\) is also in characters.</li>
</ul>

<p>The second point is relevant because that is why we can compare \(\hat{W}\) with \(C\) without any fear, what’s more, and once again taking advantage of the monospace font, if we multiply by the character-width constant \(w\), \(C \cdot w\) is exactly the number of pixels of <em>extra budget</em> that we are willing to give a column with slightly heterogeneous data, which is exactly what we are after: being able to <em>dial in</em> how much heterogeneity we are willing to accept in our column without truncating.</p>

<blockquote class="note">
  <p>Remember, dear reader, that what interests us is not the number of characters that fit in a cell, but rather how many pixels of budget we are going to give it. Characters are simply the base unit of measure that the data gives us, the means of getting to tell the application “Ok, assign 88 pixels of width to this column”.</p>
</blockquote>

<p>There is one last detail about the variable \(C\), which I think is the most interesting of all, and it is a design decision that I hope makes sense to you. Note that in equation \ref{eq:dispersion} the comparison is made through a subtraction instead of some slightly more naive approach, such as making the comparison through a ratio, something like:</p>

\[\frac{\hat{W}_{\max}}{\hat{W}_{95}} &gt; C
\label{eq:dispersion_wrong}\]

<p>However, if you were tempted to use that formula, you would not be considering the extremes. What would happen if the column is generally very short? What would happen if the column is generally very long? Before answering those questions, it is worth asking ourselves what the real goal is of taking action in the face of the heterogeneity of the data, because, remember, what we want is to show the largest amount of data on your screen without losing its context.</p>

<p>The screen has a <strong>fixed</strong> budget of pixels: your screen is not going to grow because you have more data, therefore, it makes no sense for the variable \(C\) to be proportional, because the <em>cost</em> of each extra pixel in a column is the same, regardless of the content, shape or size of your data. And for that same reason, it makes more sense to use equation \(\ref{eq:dispersion}\) and not equation \(\ref{eq:dispersion_wrong}\).</p>

<p>An idea that occurred to me while writing this post is that perhaps \(C\) should be proportional to the size of the screen… but that is a problem for future Benja, besides, I think we have already complicated enough how we measure the width of the cells, and you will see that with this tremendous effort we have made, it is more than enough to cater to 80% of our users.</p>

<p>It may look like overengineering for something that only measures, but the complicated part is the <em>why</em>; the code is quite simple:</p>

<div class="language-rust highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">const</span> <span class="n">TAIL_GAP_CH</span><span class="p">:</span> <span class="nb">f32</span> <span class="o">=</span> <span class="mf">10.0</span><span class="p">;</span>

<span class="k">fn</span> <span class="nf">data_and_max_ch</span><span class="p">(</span>
    <span class="n">len</span><span class="p">:</span> <span class="nn">engine</span><span class="p">::</span><span class="n">ColLen</span><span class="p">,</span>
    <span class="n">num</span><span class="p">:</span> <span class="nb">Option</span><span class="o">&lt;</span><span class="nn">numfmt</span><span class="p">::</span><span class="n">NumShape</span><span class="o">&gt;</span><span class="p">,</span>
<span class="p">)</span> <span class="k">-&gt;</span> <span class="p">(</span><span class="nb">f32</span><span class="p">,</span> <span class="nb">f32</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">let</span> <span class="n">data_ch</span> <span class="o">=</span> <span class="k">match</span> <span class="n">num</span> <span class="p">{</span>
        <span class="nf">Some</span><span class="p">(</span><span class="n">shape</span><span class="p">)</span> <span class="k">=&gt;</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">width_ch</span><span class="p">(</span><span class="n">shape</span><span class="p">,</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">natural</span><span class="p">(</span><span class="n">shape</span><span class="p">)),</span>
        <span class="nb">None</span> <span class="k">if</span> <span class="p">(</span><span class="n">len</span><span class="py">.max</span> <span class="k">as</span> <span class="nb">f32</span> <span class="o">-</span> <span class="n">len</span><span class="py">.p95</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="n">TAIL_GAP_CH</span> <span class="k">=&gt;</span> <span class="n">len</span><span class="py">.max</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">,</span>
        <span class="nb">None</span> <span class="k">=&gt;</span> <span class="n">len</span><span class="py">.p95</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">,</span>
    <span class="p">};</span>
    <span class="k">let</span> <span class="n">max_ch</span> <span class="o">=</span> <span class="k">match</span> <span class="n">num</span> <span class="p">{</span>
        <span class="nf">Some</span><span class="p">(</span><span class="n">shape</span><span class="p">)</span> <span class="k">=&gt;</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">width_ch</span><span class="p">(</span><span class="n">shape</span><span class="p">,</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">natural</span><span class="p">(</span><span class="n">shape</span><span class="p">)),</span>
        <span class="nb">None</span> <span class="k">=&gt;</span> <span class="n">len</span><span class="py">.max</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">,</span>
    <span class="p">};</span>
    <span class="p">(</span><span class="n">data_ch</span><span class="p">,</span> <span class="n">max_ch</span><span class="p">)</span>
<span class="p">}</span>
</code></pre></div></div>

<p>where <code class="language-plaintext highlighter-rouge">len</code> holds a column’s statistics (among them, <code class="language-plaintext highlighter-rouge">max</code> and <code class="language-plaintext highlighter-rouge">p95</code>), if <code class="language-plaintext highlighter-rouge">num</code> is <code class="language-plaintext highlighter-rouge">Some(shape)</code> it is a number, if not, it is text. Note that <code class="language-plaintext highlighter-rouge">data_ch</code> is the budget we give the column, and <code class="language-plaintext highlighter-rouge">max_ch</code> is how much width we would need without truncating anything. If the column is numeric, then <code class="language-plaintext highlighter-rouge">data_ch == max_ch</code> and it is never truncated, otherwise, the value <code class="language-plaintext highlighter-rouge">data_ch</code> takes depends on the heterogeneity (in this case the constant \(C\) is the variable <code class="language-plaintext highlighter-rouge">TAIL_GAP_CH</code>).</p>

<p>The budget of column \(i\) is then \(b_i = \hat{W}_i \cdot w\), where \(\hat{W}_i\) is \(\hat{W}_{\max}\) or \(\hat{W}_{95}\) according to equation \eqref{eq:dispersion}.</p>

<h3 id="cutting-the-suit-to-fit-the-data">Cutting the suit to fit the data</h3>

<p>Oof! So you thought measuring was simple? Well, cutting the suit to measure is a bit more complex, but that doesn’t make it any more complicated. The complexity appears because the algorithm has many <em>moving parts</em>, and each of those parts has its reason for being. However, each part is very simple, and taken together, they make it possible to accomplish the goal of this section: to assign each column the width that maximizes the amount of <strong>contextualized</strong> information on the screen.</p>

<p>By now, we already know how many pixels each cell asks for so as not to be truncated, thanks to the budget \(b\), and we also know how much budget we are really willing to give each cell given its <em>homogeneity</em> or <em>heterogeneity</em>, but there is a budget we have not considered yet, and it is the size of your screen! We can’t go around giving away the pixels each cell, row or column wants willy-nilly, because we will quickly run out of space on screen to display all that data.</p>

<p>That is why, in order to <em>cut the suit to fit the data</em>, we first need to consider the size of the user’s screen, to then distribute this whole mountain of budgets we have calculated among the mountain of data our dear user wants to see.</p>

<h4 id="dividing-up-the-screen">Dividing up the screen</h4>

<p>In general, the algorithm seeks to divide up the screen <em>fairly</em>. In the previous section, we solved the problem of the heterogeneity of the data by calculating different <em>budgets</em> for each column. In this section, the question is, given the budgets calculated for each column, <strong>how do we share out the screen fairly?</strong></p>

<p>As any competent professional would say: the answer is, it depends. The procedure for this <em>divvying-up</em> of budgets has 4 central ideas:</p>

<ul>
  <li>Define a target maximum column width, \(W_t\), which we will later adjust to obtain the real maximum width, \(W_k\).</li>
  <li>Prevent the columns with a lot of budget from <em>hogging</em> the whole screen.</li>
  <li>Avoid truncations, prioritizing the columns that ask for less budget.</li>
  <li>Optimize edge cases when the budget is smaller than the amount of screen available.</li>
</ul>

<p>Notice that the first condition has an important consequence: by defining the maximum column width (whether the target \(W_t\) or the real \(W_k\) that we will properly define later), we are implicitly defining the minimum number of columns visible at all times, which we will call \(k\). Furthermore, \(k\) depends on the size of the screen, which we will call \(V\).</p>

<p>Therefore, \(k\) follows the equation</p>

\[k = V / W_t
\label{eq:k_notround}\]

<span class="article__fig-anchor" id="fig-viewport-k"></span><figure class="article__figure article__figure--media" data-fig-label="viewport-k" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/en_manim_viewport-k.mp4" poster="/assets/video/tabula-rasa-columns/en_manim_viewport-k.png" aria-label="A table, with its text drawn as bars, runs across a screen of width V and out both sides, where it is dimmed and fades away. All its columns measure W_t, and neither their width nor their position ever changes. Inside the screen the columns are lit, and below it reads k = V / W_t = 3.0. The screen shrinks from its right edge: fewer columns fit, the third is cut by the edge, and k drops to 2.2. Then the screen grows: more fit, and k rises to 4.2, with the last column half in again. Finally the screen returns to its initial size and k to 3.0." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 13.</span> The columns don't change, the screen does: k grows and shrinks with it.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="viewport-k" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/en_manim_viewport-k-light.mp4" poster="/assets/video/tabula-rasa-columns/en_manim_viewport-k-light.png" aria-label="A table, with its text drawn as bars, runs across a screen of width V and out both sides, where it is dimmed and fades away. All its columns measure W_t, and neither their width nor their position ever changes. Inside the screen the columns are lit, and below it reads k = V / W_t = 3.0. The screen shrinks from its right edge: fewer columns fit, the third is cut by the edge, and k drops to 2.2. Then the screen grows: more fit, and k rises to 4.2, with the last column half in again. Finally the screen returns to its initial size and k to 3.0." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 13.</span> The columns don't change, the screen does: k grows and shrinks with it.</figcaption></figure>

<p>A bigger screen can have more columns visible at all times! Note also that, in our goal of not <em>losing context</em>, we would like the columns not to appear cut off on screen, but rather to appear whole. Therefore, we could fix equation \ref{eq:k_notround} and we get the following</p>

\[k = \operatorname{round}\left( V / W_t \right)
\label{eq:k}\]

<p>Stop for a minute to contemplate how simple and compact this equation is. All that large quantity of paragraphs justifying one design decision or another can be summed up in a simple rounded division.</p>

<p>I chose the value \(W_t = 67 \cdot w\) <em>by eye</em>. In my experience, with the screen I use to develop the application (a 14’’ laptop, with about 1440 px of usable width), you get 3 columns, a value that works for me.</p>

<p>Finally, and once \(k\) is calculated, we can calculate the <em>real</em> value of \(W\), that is, the value that ensures we will see at least \(k\) columns on screen:</p>

\[W_k = V / k
\label{eq:ancho-maximo}\]

<span class="article__fig-anchor" id="fig-ksteps"></span><figure class="article__figure article__figure--media" data-fig-label="ksteps" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_ksteps.mp4" poster="/assets/video/tabula-rasa-columns/manim_ksteps.png" aria-label="The same table running across the screen of width V and out both sides, dimmed. Now k is a whole number, and below the screen it reads W_k = V / 2. At first exactly 2 columns fit. Then k changes to 3, to 4 and to 5: at each step the reading changes first, and then the columns narrow until exactly k whole columns fill the screen, with the W_k measure above the first column adjusting with them. Finally k goes back to 2 and the columns widen again." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 14.</span> With k a whole number, the columns adjust to fill the screen exactly.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="ksteps" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_ksteps-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_ksteps-light.png" aria-label="The same table running across the screen of width V and out both sides, dimmed. Now k is a whole number, and below the screen it reads W_k = V / 2. At first exactly 2 columns fit. Then k changes to 3, to 4 and to 5: at each step the reading changes first, and then the columns narrow until exactly k whole columns fill the screen, with the W_k measure above the first column adjusting with them. Finally k goes back to 2 and the columns widen again." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 14.</span> With k a whole number, the columns adjust to fill the screen exactly.</figcaption></figure>

<p>Thus, \(W_k\) divides the screen into exactly \(k\) equal columns, and since no column competing for space can exceed \(W_k\), you will always see at least \(k\) columns. And what if the columns don’t all fit? No problem: the table scrolls horizontally. \(W_k\) is not trying to make everything fit on screen, but to make sure you always have at least \(k\) columns in view, with their context. The following table shows the result on screens of different sizes, with \(w \approx 7.2\) px (that is, \(W_t \approx 482\) px):</p>

<table>
  <thead>
    <tr>
      <th>Screen</th>
      <th style="text-align: right">\(V\) (px)</th>
      <th style="text-align: right">\(V / W_t\)</th>
      <th style="text-align: right">\(k\)</th>
      <th style="text-align: right">\(W_k\) (px)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Laptop</td>
      <td style="text-align: right">1440</td>
      <td style="text-align: right">2.99</td>
      <td style="text-align: right">3</td>
      <td style="text-align: right">480</td>
    </tr>
    <tr>
      <td>24″ 1080p monitor</td>
      <td style="text-align: right">1920</td>
      <td style="text-align: right">3.98</td>
      <td style="text-align: right">4</td>
      <td style="text-align: right">480</td>
    </tr>
    <tr>
      <td>27″ 1440p monitor</td>
      <td style="text-align: right">2560</td>
      <td style="text-align: right">5.31</td>
      <td style="text-align: right">5</td>
      <td style="text-align: right">512</td>
    </tr>
    <tr>
      <td>34″ ultrawide</td>
      <td style="text-align: right">3440</td>
      <td style="text-align: right">7.13</td>
      <td style="text-align: right">7</td>
      <td style="text-align: right">491</td>
    </tr>
  </tbody>
</table>

<p>Note that \(W_k\) barely changes between screens: what grows with the screen is the minimum number of columns you will see.</p>

<span class="article__fig-anchor" id="fig-screen-fit"></span><figure class="article__figure article__figure--media" data-fig-label="screen-fit" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_screen-fit.mp4" poster="/assets/video/tabula-rasa-columns/manim_screen-fit.png" aria-label="The same table running across a screen of width V. Above the first column there are two measures: W_t, grey, which never changes, and W_k, which follows the real width of the columns. Below the screen it reads k = round(V / W_t) and W_k = V / k. The screen changes size several times. At each change, first the screen moves with the columns still, and k is recalculated: the columns that k counts light up, even if the last one sticks out past the edge, and the one it doesn&#39;t count goes dark even if it is partly inside the screen. Then the columns widen or narrow until exactly k columns fill the screen. W_k always stays close to W_t: k goes from 3 to 2, to 4, to 6, and back to 3." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 15.</span> When the screen changes size, k is recalculated and the columns adjust to fit whole.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="screen-fit" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_screen-fit-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_screen-fit-light.png" aria-label="The same table running across a screen of width V. Above the first column there are two measures: W_t, grey, which never changes, and W_k, which follows the real width of the columns. Below the screen it reads k = round(V / W_t) and W_k = V / k. The screen changes size several times. At each change, first the screen moves with the columns still, and k is recalculated: the columns that k counts light up, even if the last one sticks out past the edge, and the one it doesn&#39;t count goes dark even if it is partly inside the screen. Then the columns widen or narrow until exactly k columns fill the screen. W_k always stays close to W_t: k goes from 3 to 2, to 4, to 6, and back to 3." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 15.</span> When the screen changes size, k is recalculated and the columns adjust to fit whole.</figcaption></figure>

<h4 id="distributing-the-budget">Distributing the budget</h4>

<p>Dear reader, you must be wondering why we went to the trouble of calculating the budget with equation \ref{eq:presupuesto} if later we are going to divide the screen into \(k\) columns of width \(W_k\) and apparently <em>ignore</em> those budgets we worked so hard to calculate. The reason is that, sometimes it suits us to use one value, and other times the other value, and that will depend on whether the budget of column \(i\), which we will call \(b_i\), is greater than \(W_k\) or whether it is smaller.</p>

<p>Let’s start with the simplest situation, if \(b_i &lt; W_k\), then we can give column \(i\) the budget it asks for, because, remember, \(W_k\) is the most we are willing to give it, and the budget asks for less than the maximum.</p>

<p>On the other hand, if \(b_i &gt; W_k\), the space we will give the i-th column will be \(W_k\), which is the most we can give a column according to the previous section.</p>

<p>That is, we could summarize the previous idea by saying that the width of the i-th column, which we will call \(W_i\), is given by:</p>

\[W_i = \min(b_i, W_k)\]

<p>The following visualization shows a table that has some columns with budgets bigger than \(W_k\) and some columns with smaller budgets.</p>

<span class="article__fig-anchor" id="fig-budget-cap"></span><figure class="article__figure article__figure--media" data-fig-label="budget-cap" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-cap.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-cap.png" aria-label="A table of four columns on a screen of width V; W_k is measured above the screen. Each column starts at the width it asks for, b_i, measured above it; the whole table is visible and sticks out past the right of the screen. A copy of W_k drops onto the second column, which asks for more: the part that exceeds W_k is veiled, and the column narrows to W_k, its texts cut off with ellipses and the following columns moving to the left. The same happens with the fourth column. Below the screen the bound V appears; then each column&#39;s measure drops, one by one, onto a single line, where they end up one after another forming the sum of min(b_i, W_k), longer than V: the table still doesn&#39;t fit on the screen." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 16.</span> No column gets more than Wₖ, even if its budget asks for more.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-cap" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-cap-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-cap-light.png" aria-label="A table of four columns on a screen of width V; W_k is measured above the screen. Each column starts at the width it asks for, b_i, measured above it; the whole table is visible and sticks out past the right of the screen. A copy of W_k drops onto the second column, which asks for more: the part that exceeds W_k is veiled, and the column narrows to W_k, its texts cut off with ellipses and the following columns moving to the left. The same happens with the fourth column. Below the screen the bound V appears; then each column&#39;s measure drops, one by one, onto a single line, where they end up one after another forming the sum of min(b_i, W_k), longer than V: the table still doesn&#39;t fit on the screen." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 16.</span> No column gets more than Wₖ, even if its budget asks for more.</figcaption></figure>

<p>Notice that the visualization introduces a new concept: The total width of the <strong>table</strong>, with an expression that is perhaps a bit scary the first time you see it:</p>

\[W_T = \sum_i \min(b_i, W_k) = \sum_i W_i\]

<p>Or in other words, the total width \(W_T\) is the sum of the widths of all the columns in the table. Simple, right? The expression looks much uglier than it really is. And it turns out that it is in the next step that the algorithm’s final stroke of genius comes in: the columns negotiate among themselves the space they are going to use on screen, and these negotiations are based on the two variables each column can <em>dial in</em>: \(b_i\) and \(W_k\).</p>

<p>If there isn’t enough space on screen, and all the columns have a budget \(b_i &gt; W_k\), then there isn’t much to negotiate, all the calculated widths will end up equal to \(W_k\). The trick is when the total budget \(W_T &lt; V\), in that case we still have space left on the screen after distributing the whole budget:</p>

<span class="article__fig-anchor" id="fig-budget-leftover"></span><figure class="article__figure article__figure--media" data-fig-label="budget-leftover" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-leftover.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-leftover.png" aria-label="Another table, of four columns already capped at W_k, on the same screen. Below it, the bound V and the sum of min(b_i, W_k), which this time is shorter: the table ends before the right edge of the screen. The space left over is marked with a dashed box that flashes once. Then the ellipses of the cells that are still truncated flash: there is screen to spare, and even so there is data cut off." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 17.</span> There is screen to spare, and still there is truncated data.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-leftover" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-leftover-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-leftover-light.png" aria-label="Another table, of four columns already capped at W_k, on the same screen. Below it, the bound V and the sum of min(b_i, W_k), which this time is shorter: the table ends before the right edge of the screen. The space left over is marked with a dashed box that flashes once. Then the ellipses of the cells that are still truncated flash: there is screen to spare, and even so there is data cut off." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 17.</span> There is screen to spare, and still there is truncated data.</figcaption></figure>

<p>Consider that in this case, our pesky \(W_k\) limited the columns to that width, even though some columns were asking for more with their budget \(b_i\), leaving them truncated, and there was space available on the screen to hand out! In this case, we distribute what is left over with a <a href="https://en.wikipedia.org/wiki/Max-min_fairness">max-min fairness</a> criterion.</p>

<p>Imagine that each column is a <em>glass</em> of height \(b_i\), and where the amount of water in each glass is the width we gave it in the table. Perhaps to some columns we assigned the whole budget they were asking for, in that case the glass is full, but there are other columns that were asking for more than we could give them, and we only assigned them \(W_k\), in that case, a tall glass is <em>half empty</em>. As we saw earlier, we still have water left (which would be the amount of screen available) and we are going to try to distribute it equitably.</p>

<p>What the <strong>max-min fairness</strong> algorithm does is pour the <em>water</em> (screen width) we have left into each glass <strong>that is not full</strong>, equitably. If a glass fills up, then we stop giving it water (because it has already reached the budget it was asking for), and we give the rest of the water to the columns that haven’t finished filling up yet.</p>

<p>This way, we do everything possible to minimize the number of columns that will end up truncated, without neglecting the columns that ask for more, and without allowing any column to hog precious width.</p>

<span class="article__fig-anchor" id="fig-budget-glasses"></span><figure class="article__figure article__figure--media" data-fig-label="budget-glasses" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses.png" aria-label="The same table, which ends before the right edge of the screen; the space left over is marked with a dashed box. Below the screen, the bound V and the sum of the column widths, which reaches W_T and continues dashed up to V. Each column has its own colour: ochre, blue, green and red. Five empty glasses appear: one above each column, as tall as the width the column would need to truncate nothing, and a fifth to the right of the screen, labelled V − W_T. A line in each column&#39;s colour measures its width over the screen, turns until it stands vertical and settles beside its glass; the dashed stretch between W_T and V does the same beside the fifth glass, and the sum is left ending at W_T. The glasses fill up to those lines: the water level is the column&#39;s width. The blue and the green, both capped at W_k, start at the same level; the ochre and the red are already full and get a lid. Then the fifth glass empties while the blue and the green fill at the same rate, and their columns widen with them while the leftover space shrinks. The green fills first and gets its lid; the blue keeps rising until the fifth glass is empty, the table takes up the whole screen and the sum reaches V. The truncated cells get their text back, except the longest one in the blue column." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 18.</span> Max-min fairness: the space left over is shared among the columns that ask for it.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-glasses" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.png" aria-label="The same table, which ends before the right edge of the screen; the space left over is marked with a dashed box. Below the screen, the bound V and the sum of the column widths, which reaches W_T and continues dashed up to V. Each column has its own colour: ochre, blue, green and red. Five empty glasses appear: one above each column, as tall as the width the column would need to truncate nothing, and a fifth to the right of the screen, labelled V − W_T. A line in each column&#39;s colour measures its width over the screen, turns until it stands vertical and settles beside its glass; the dashed stretch between W_T and V does the same beside the fifth glass, and the sum is left ending at W_T. The glasses fill up to those lines: the water level is the column&#39;s width. The blue and the green, both capped at W_k, start at the same level; the ochre and the red are already full and get a lid. Then the fifth glass empties while the blue and the green fill at the same rate, and their columns widen with them while the leftover space shrinks. The green fills first and gets its lid; the blue keeps rising until the fifth glass is empty, the table takes up the whole screen and the sum reaches V. The truncated cells get their text back, except the longest one in the blue column." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en"><span class="article__fig-num">Figure 18.</span> Max-min fairness: the space left over is shared among the columns that ask for it.</figcaption></figure>

<p>Marvel at what we have just done, without assuming homogeneous data, we have managed to distribute pixels <em>fairly</em> among all the columns, truncating the least amount of data, and ensuring that a cell will never be lost from its context. If you are not crying with joy right now, I don’t know what could make you cry, honestly.</p>

<h3 id="adjusting-to-the-data">Adjusting to the data</h3>

<p>As we have already seen, in the algorithm, the width of the columns defines the height of each row, except when the user chooses <strong>Fit</strong> for the width. Remember that, in that case, the user wants the width or the height of the cells to adjust in such a way that the data is never truncated.</p>

<p>And it is in this particular case only that we invert the algorithm: each column calculates its width from the height mode the user chose.</p>

<p>For example, if the user says they want their cells to have height 4, then the columns widen in such a way that:</p>

<ul>
  <li>No cell exceeds 4 lines</li>
  <li>No value is truncated</li>
</ul>

<p>Now, if you have a good memory, you will remember that there is also <a href="#user-intention">a <strong>fit</strong> mode for the height</a> of the cells. When the width and the height are both set to <strong>Fit</strong>, the algorithm has carte blanche to decide both the height and the width of each cell. And in that case, the only rule <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> follows is that the width/height ratio be at most 1: the cell ends up, at most, as wide as it is tall, that is, approximately square.</p>

<h2 id="final-reflections">Final reflections</h2>

<p>Dear reader, the algorithm is ready, with that, we have been able to create an automatic column-width calculation algorithm, which lets you open CSV files and see them properly right away, and which respects the user’s intentions, even the intention of handling the sizes of their table by hand.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> was born from a frustration with existing Software, but it has ended up becoming a tool for intellectual exploration. I try to combine good taste (which I believe I have), with the intellectual challenge required to make a piece of Software that, to paraphrase Mister Jobs, <em>just works</em>.</p>

<p>And the thing is that in a few months, I have been able to bring Tabula Rasa to a state in which it already fulfills its initial goal, it is my everyday Software when I have to work with CSVs, and of course, this achievement is due to my hard work, but also to the fact that I have used the <em>Agent</em> a lot to write the Software. And the prevailing discourse on the Internet is that this kind of Software, written mainly with Agents, is <em>slop</em>. I hope that after reading this article, you agree with me that quality Software can still be made in the year 2026. I truly believe that Tabula Rasa’s great <em>ace up its sleeve</em> is that I devote a large number of hours to thinking and writing about the process, and I hope this inspires you, dear reader, to make thoughtful things, <em>marinated</em> in your mind, that we all benefit from, and, above all, that all is not lost!</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:proverb">
      <p>The Spanish original uses a different saying, <em>Aunque la mona se vista de seda…</em> (“Even if the monkey dresses in silk…”), which every Spanish speaker finishes with “…mona se queda” (“…a monkey she remains”). Translated literally, it would have left you with a truncated sentence you couldn’t finish, which would have ruined the example, so I asked Claude to help me find an English saying that you could finish on your own. <a href="#fnref:proverb" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Benjamín Opazo</name></author><category term="Tabula Rasa" /><summary type="html"><![CDATA[A discussion of Tabula Rasa's algorithms for adjusting columns.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-columns/header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-columns/header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="es"><title type="html">Una tabla a la medida de los datos</title><link href="https://blog.benjaopazoc.cl/2026/09/una-tabla-a-la-medida-de-los-datos/" rel="alternate" type="text/html" title="Una tabla a la medida de los datos" /><published>2026-09-30T21:17:00+00:00</published><updated>2026-09-30T21:17:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/09/una-tabla-a-la-medida-de-los-datos</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/09/una-tabla-a-la-medida-de-los-datos/"><![CDATA[<p>Querido lector, en este artículo vamos a explorar el algoritmo de <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> que ajusta automáticamente el ancho de las columnas. Usted quizás se preguntará <em>por qué</em> un Software necesitaría un <strong>algoritmo</strong> (y un post largo y denso como este) para ajustar el ancho de las columnas, y es que, si este problema se toma en serio, verá que la solución no es trivial. Antes de explorar el algoritmo, me gustaría contarle el desafío que enfrenta Tabula Rasa cada vez que abre un archivo CSV. Si lo desea, puede saltarse directamente a la sección del <a href="#el-algoritmo-de-las-columnas">algoritmo</a>, o alternativamente, puede leer esta entretenida introducción. Le recomiendo leer el artículo completo, pues al final, usted verá una visualización como la siguiente:</p>

<figure class="article__figure article__figure--media" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses.png" aria-label="Una tabla de cuatro columnas, que termina antes del borde derecho de la pantalla; el espacio que sobra está marcado con un recuadro punteado. Bajo la pantalla, la cota V y la suma de los anchos de las columnas, que llega hasta W_T y sigue punteada hasta V. Cada columna tiene su propio color: ocre, azul, verde y rojo. Aparecen cinco vasos vacíos: uno sobre cada columna, tan alto como el ancho que necesitaría la columna para no truncar nada, y un quinto a la derecha de la pantalla, rotulado V − W_T. Una línea del color de cada columna mide su ancho sobre la pantalla, gira hasta quedar vertical y se ubica junto a su vaso; el tramo punteado entre W_T y V hace lo mismo junto al quinto vaso, y la suma queda terminando en W_T. Los vasos se llenan hasta esas líneas: el nivel del agua es el ancho de la columna. El azul y el verde, ambos limitados a W_k, parten al mismo nivel; el ocre y el rojo ya están llenos y reciben una tapa. Luego el quinto vaso se vacía mientras el azul y el verde se llenan al mismo ritmo, y sus columnas se ensanchan con ellos mientras el espacio sobrante se achica. El verde se llena primero y recibe su tapa; el azul sigue subiendo hasta que el quinto vaso queda vacío, la tabla ocupa toda la pantalla y la suma alcanza V. Las celdas truncadas recuperan su texto, salvo la más larga de la columna azul." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 1.</span> Así reparte Tabula Rasa la pantalla entre las columnas que piden más espacio.</figcaption></figure>
<figure class="article__figure article__figure--media" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.png" aria-label="Una tabla de cuatro columnas, que termina antes del borde derecho de la pantalla; el espacio que sobra está marcado con un recuadro punteado. Bajo la pantalla, la cota V y la suma de los anchos de las columnas, que llega hasta W_T y sigue punteada hasta V. Cada columna tiene su propio color: ocre, azul, verde y rojo. Aparecen cinco vasos vacíos: uno sobre cada columna, tan alto como el ancho que necesitaría la columna para no truncar nada, y un quinto a la derecha de la pantalla, rotulado V − W_T. Una línea del color de cada columna mide su ancho sobre la pantalla, gira hasta quedar vertical y se ubica junto a su vaso; el tramo punteado entre W_T y V hace lo mismo junto al quinto vaso, y la suma queda terminando en W_T. Los vasos se llenan hasta esas líneas: el nivel del agua es el ancho de la columna. El azul y el verde, ambos limitados a W_k, parten al mismo nivel; el ocre y el rojo ya están llenos y reciben una tapa. Luego el quinto vaso se vacía mientras el azul y el verde se llenan al mismo ritmo, y sus columnas se ensanchan con ellos mientras el espacio sobrante se achica. El verde se llena primero y recibe su tapa; el azul sigue subiendo hasta que el quinto vaso queda vacío, la tabla ocupa toda la pantalla y la suma alcanza V. Las celdas truncadas recuperan su texto, salvo la más larga de la columna azul." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 1.</span> Así reparte Tabula Rasa la pantalla entre las columnas que piden más espacio.</figcaption></figure>

<p>Y llorará de felicidad.</p>

<h2 id="entendiendo-el-problema-de-las-columnas">Entendiendo el problema de las Columnas</h2>

<p>Como usted quizás <a href="/2026/08/el-origen-de-tabula-rasa/">ya sabe</a>, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> nace de mi frustración con la falta de buenos visualizadores de datos tabulares, en particular de archivos CSV. Más aún, y al parecer esto era mucho pedir, no había logrado encontrar un Software que se ajustase a mis necesidades, ni a las de las personas que viven <em>sumergidas en los datos</em>. Uno de los problemas más graves de usabilidad de los visualizadores de datos tabulares (léase Excel, Google Drive, incluso aplicaciones como PhpMyAdmin), es la poca atención que se le pone a la distribución de los datos en la tabla, o más bien, al ancho que se le asigna automáticamente a las columnas.</p>

<p>Y es que en general, las aplicaciones suelen caer en uno de estos dos pecados:</p>

<ul>
  <li>Ajustan el ancho de la columna al contenido, o</li>
  <li>Aplican un tamaño estándar a las columnas</li>
</ul>

<p>El problema es que los datos rara vez son <em>homogéneos</em> en una tabla, por lo tanto, mostrar los datos aplicando <strong>criterios únicos</strong> termina generando tablas indescifrables. Las columnas terminan más anchas de lo necesario, o más angostas de lo necesario.</p>

<span class="article__fig-anchor" id="fig-lo-sparse"></span><figure class="article__figure" data-fig-label="lo-sparse"><img src="/assets/img/tabula-rasa-columns/lo_sparse.png" alt="LibreOffice Calc con un archivo de 15 filas y cinco columnas: un número correlativo, un código de producto, una fecha y hora, una dirección IP y una URL, después de ajustar cada columna al ancho de su contenido. En tres de las columnas hay un único dato mucho más largo que el resto: un código de producto en la fila 7, una dirección IPv6 en la fila 4 y una URL con una larga cola de parámetros en la fila 10. Ese único dato define el ancho de toda su columna, así que las demás celdas quedan casi vacías: la columna de URLs ocupa más de la mitad de la pantalla y aun así no alcanza a mostrar la URL larga completa." loading="lazy" data-zoomable="" /><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 2.</span> Columnas ajustadas a su contenido: un solo dato largo ensancha toda la columna. <a href="/assets/files/tabula-rasa-columns/autofit.csv">Datos ficticios</a>.</figcaption></figure>

<p>Estas aplicaciones, por lo tanto, terminan confiando en que el usuario hará su <em>tarea</em> y formateará su tabla manualmente. Aplicará anchos de columna específicos a cada dato, elegirá el tipo de letra, le pondrá colores, etc. El problema es que si el usuario quiere mantener ese formato en la tabla, debe convertir sus archivos CSVs a un formato propietario como Excel o Numbers.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> invierte esa responsabilidad y busca ordenar <strong>automáticamente</strong> los datos de la tabla, de forma que un usuario al abrir un archivo se encuentra con los datos tal como los querría: listos para ser analizados.</p>

<p>Para lograr ese objetivo, hay ciertas reglas, o más bien heurísticas que he ido desarrollando y que permiten mejorar la experiencia del usuario en el contexto de visualizadores de datos tabulares, algunas reglas tienen relación con cómo se muestran los datos, otras reglas están más asociadas a como modelamos las interacciones en la aplicación misma. Hoy nos centraremos en cómo mostraremos los datos:</p>

<ul>
  <li>Los datos sólo tienen valor en su contexto.</li>
  <li>El contexto de un dato incluye el título de la columna, y los datos de las filas y columnas colindantes.</li>
  <li>Un dato mal truncado es inútil (ya he hablado de eso en <a href="/2026/09/defectos-que-desaparecen/#truncaciones">este post</a>)</li>
</ul>

<p>La dificultad más importante a la que se enfrenta <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, es que un archivo CSV está en texto plano, no tiene metadatos, tampoco tiene estilos embebidos en el archivo por ejemplo. Por lo tanto, la única forma que Tabula Rasa tiene de enriquecer <strong>cómo</strong> muestra los datos, es <strong>con los mismos datos</strong>.</p>

<p>Ahora bien, cuando usted, querido lector, se enfrenta al mismo desafío de darle formato a sus CSV usando su visualizador de datos tabulares de antaño, está en la misma situación de Tabula Rasa, pues solo tiene los datos desordenados frente a sus ojos, y usa alguna <em>heurística interna</em> para darle formato a sus datos.</p>

<p>Por lo tanto, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> no tiene excusas, debe ordenar sus datos, y debe hacerlo bien, aun cuando lo único que tiene a la mano son solamente los datos y nada más. ¡Y vaya que lo logra! Bueno… probablemente las <em>heurísticas internas</em> de cada usuario son diferentes, de ahí que el Software va a intentar ordenar los datos de la mejor manera posible, pero el usuario siempre podrá ordenarlos a su gusto posteriormente.</p>

<h2 id="el-algoritmo-de-las-columnas">El algoritmo de las columnas</h2>

<p>El objetivo del algoritmo de las columnas es hacer <em>Una tabla a la medida de los datos</em>. Imagínese que Tabula Rasa es el sastre de sus datos: toma las medidas, planifica los <em>cortes</em> de la tela, confecciona las piezas del traje y, finalmente, usted se lo pone. La maravilla de este traje, es que si no es de su gusto ¡no hay problema! usted puede modificarlo.</p>

<p>A continuación veremos las diferentes partes del algoritmo, y cómo se combinan para poder mostrar su tabla así</p>

<span class="article__fig-anchor" id="fig-tr-wall"></span><figure class="article__figure article__figure--media" data-fig-label="tr-wall">
  <video src="/assets/video/tabula-rasa-defaults/es_tr_wall.mp4" aria-label="Tabula Rasa recorriendo hacia la derecha las dieciocho columnas del archivo de una encuesta. Cada columna tomó el ancho que su contenido necesita — angosta para id y edad, ancha para las respuestas de texto libre. Las cifras van alineadas a la derecha con separadores de miles, desde 73 hasta 2,413,800,000, y ninguna respuesta pasa de unas tres líneas antes de terminar en puntos suspensivos. Los números de fila quedan fijos en el borde izquierdo y los encabezados de columna siguen legibles a lo largo de todo el recorrido, así que ninguna fila queda nunca huérfana de su identidad" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 3.</span> Una encuesta abierta con Tabula Rasa. <a href="/assets/files/tabula-rasa-defaults/es_survey.csv">Datos ficticios</a>.</figcaption></figure>

<p>en vez de así</p>

<span class="article__fig-anchor" id="fig-lo-wall"></span><figure class="article__figure article__figure--media" data-fig-label="lo-wall">
  <video src="/assets/video/tabula-rasa-defaults/es_lo_wall.mp4" aria-label="LibreOffice Calc recorriendo hacia la derecha el mismo archivo de la encuesta. Todas las columnas tienen el mismo ancho por defecto sin importar lo que contengan, así que las dos respuestas de mil palabras fuerzan sus filas hasta llenar la ventana mientras las filas de una línea quedan apretadas entre ellas, y el texto de cada celda larga queda cortado en seco en el borde de la columna. Pasada la última columna con datos, la planilla sigue hacia columnas vacías rotuladas con letras" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 4.</span> La misma encuesta en LibreOffice: una muralla de texto. <a href="/assets/files/tabula-rasa-defaults/es_survey.csv">Datos ficticios</a>.</figcaption></figure>

<p>Para eso, primero entenderemos las decisiones de diseño de <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, y cómo estas afectan al algoritmo, luego intentaremos formalizar las intenciones de los usuarios, para poder transformar esas intenciones en anchos y altos de columnas y filas.</p>

<p>A <em>vuelo de pájaro</em>, el algoritmo de Tabula Rasa hace lo siguiente:</p>

<ul>
  <li>Calcula el presupuesto de ancho de cada columna</li>
  <li>Asigna ese presupuesto a cada <em>columna</em> de forma inteligente</li>
  <li>Define la altura de cada <em>fila</em> dados los anchos calculados</li>
</ul>

<p>Cada uno de esos pasos tiene detalles que los hacen muy interesantes… y hacen este post un poco extenso. Honestamente, y aunque mi recomendación quizás esté un poco sesgada, ¡creo que de verdad vale la pena este viaje!</p>

<h3 id="el-diseño-de-tabula-rasa">El diseño de Tabula Rasa</h3>

<p>El diseño de <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> es el punto de partida del algoritmo, pues nos permite calcular fácilmente cuánto espacio necesitará nuestra tabla para mostrar todos sus datos.</p>

<p>Para ir construyendo el algoritmo, tenemos que partir de la unidad básica de una tabla: la celda. Una vez que hayamos modelado correctamente una celda, notará que podremos crear una <em>capa de abstracción</em> y en general empezaremos a pensar solo en filas y columnas.</p>

<p>Hay una pieza particular del diseño que no fue elegida al azar. Un usuario de <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> perspicaz habrá notado que todas las tipografías de Tabula Rasa son <a href="https://es.wikipedia.org/wiki/Tipo_de_letra_monoespaciado">monospace</a>, y eso tiene una gran utilidad, pues el cálculo del <em>presupuesto de espacio de una celda</em> (cuántos pixeles necesita una celda para mostrar sus datos sin truncarlos) es simplemente</p>

\[b = N \cdot w
\label{eq:presupuesto}\]

<p>donde \(N\) corresponde a la cantidad de caracteres de la celda y \(w\) al ancho en pixeles de cada carácter.</p>

<span class="article__fig-anchor" id="fig-budget-row"></span><figure class="article__figure article__figure--media" data-fig-label="budget-row" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-row.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-row.png" aria-label="Una fila de 5 cajas, cada una de ancho w = 8 px, que juntas miden b = 40 px. Primero la fila suma cajas una a una hasta N = 10 y b crece a 80 px; luego cada caja se ensancha hasta w = 12 px y b llega a 120 px. Finalmente ambas vuelven a N = 5 y w = 8 px, y b a 40 px." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 5.</span> Visualización del presupuesto.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-row" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-row-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-row-light.png" aria-label="Una fila de 5 cajas, cada una de ancho w = 8 px, que juntas miden b = 40 px. Primero la fila suma cajas una a una hasta N = 10 y b crece a 80 px; luego cada caja se ensancha hasta w = 12 px y b llega a 120 px. Finalmente ambas vuelven a N = 5 y w = 8 px, y b a 40 px." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 5.</span> Visualización del presupuesto.</figcaption></figure>

<p>Note que la visualización anterior es unidimensional, pero probablemente nuestro modelo se beneficiaría si consideramos que las celdas pueden tener altura. Si tenemos una celda que tiene \(N\) caracteres, y esta celda tiene un ancho \(\hat{W}\), entonces su altura \(H\) estará dada por:</p>

\[H = \ceil{N / \hat{W}}
\label{eq:altura}\]

<p>donde \(\ceil{\,\cdot\,}\) aproxima un número al entero superior (e.g.: 4.3 -&gt; 5), por lo tanto \(H\) siempre será un número entero. Ahora bien, debemos ser cuidadosos con la ecuación anterior, en particular con \(\hat{W}\), pues lo que representa es el <strong>ancho en caracteres de una celda</strong>, por lo tanto el equivalente en pixeles sería \(W = \hat{W} \cdot w\). ¡Es por eso que podemos dividir \(N\) por \(\hat{W}\)!</p>

<blockquote class="note">
  <p>Si usted se siente confundido con las diferentes variables que hemos introducido, no se preocupe, hasta ahora hemos sido cuidadosos en diferenciar cuando las variables están medidas en <em>pixeles</em> y cuando están medidas en <em>caracteres</em>. Pero fíjese que estamos construyendo la abstracción para que eso nos deje de interesar. De aquí en adelante, a excepción de un caso de borde, a lo que le pondremos atención es a los <strong>pixeles</strong>.</p>
</blockquote>

<p>Si reacomodamos las ecuaciones \(\ref{eq:presupuesto}\) y \(\ref{eq:altura}\), podremos ver que el presupuesto \(b\) tiene un poco la forma de un <em>área</em>:</p>

\[b \approx H \cdot \hat{W} \cdot w\]

<p>Pero \(b\) no es exactamente un área. Es un solo número que codifica toda una familia de rectángulos, y de esa familia nos indica cuál es el <em>rectángulo más ancho donde caben todos los caracteres sin truncarse:</em></p>

<span class="article__fig-anchor" id="fig-budget-area"></span><figure class="article__figure article__figure--media" data-fig-label="budget-area" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-area.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-area.png" aria-label="Una celda de 16 cajas repartidas en líneas de ancho Ŵ = 6, lo que da H = 3 líneas; la última línea tiene dos espacios vacíos, marcados con borde punteado. El área encerrada es b ≈ 144 px, con cada caja de ancho w = 8 px. Al angostar la celda a Ŵ = 4, las cajas fluyen a H = 4 líneas sin espacios vacíos y b ≈ 128 px; al ensancharla a Ŵ = 8 quedan H = 2 líneas y b ≈ 128 px; al volver a Ŵ = 6 reaparecen los espacios vacíos y b ≈ 144 px. Luego las cajas se ensanchan a w = 12 px y el área crece a b ≈ 216 px, para volver a w = 8 px. Al final aparece N = 16, la cantidad de cajas." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 6.</span> Visualización del presupuesto en 2 dimensiones.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-area" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-area-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-area-light.png" aria-label="Una celda de 16 cajas repartidas en líneas de ancho Ŵ = 6, lo que da H = 3 líneas; la última línea tiene dos espacios vacíos, marcados con borde punteado. El área encerrada es b ≈ 144 px, con cada caja de ancho w = 8 px. Al angostar la celda a Ŵ = 4, las cajas fluyen a H = 4 líneas sin espacios vacíos y b ≈ 128 px; al ensancharla a Ŵ = 8 quedan H = 2 líneas y b ≈ 128 px; al volver a Ŵ = 6 reaparecen los espacios vacíos y b ≈ 144 px. Luego las cajas se ensanchan a w = 12 px y el área crece a b ≈ 216 px, para volver a w = 8 px. Al final aparece N = 16, la cantidad de cajas." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 6.</span> Visualización del presupuesto en 2 dimensiones.</figcaption></figure>

<p>Note, además, que el ancho y la altura de cada celda se pueden calcular con ecuaciones muy simples y directas, lo que hace que el algoritmo sea bastante eficiente.</p>

<p>Por otra parte, un lector perspicaz habrá notado que en general solo hablo del <em>algoritmo del ancho de columnas</em>, y eso también es por diseño: el ancho de las columnas es el que manda, y la altura se calcula como consecuencia del ancho, con excepción de <a href="#ajustándose-a-los-datos">un caso en particular</a> que ya exploraremos. De esta forma, reducimos este problema multidimensional y quizás recursivo, en uno bastante abordable. El siguiente diagrama permite ejemplificar el <em>ethos</em> detrás del algoritmo.</p>

<span class="article__fig-anchor" id="fig-causal-chain"></span><figure class="article__figure article__figure--media" data-fig-label="causal-chain" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/es_manim_causal-chain.mp4" poster="/assets/video/tabula-rasa-columns/es_manim_causal-chain.png" aria-label="Arriba, una cadena de cuatro recuadros unidos por flechas: ancho, ajuste, líneas y alto de fila. Abajo, una tabla con fila de encabezado, números de fila y tres columnas; el texto de las celdas se representa con barras. La columna del medio se angosta y se enciende ancho: su texto sigue en una sola línea y lo que ya no cabe sobresale, atenuado, más allá del borde. Se enciende ajuste. Se enciende líneas: el texto que sobresalía se dobla hacia abajo en nuevas líneas, apretadas dentro de la fila: una celda corta no cambia, otra baja un trozo pequeño, otra uno mayor, y la más larga queda en tres líneas. Se enciende alto de fila: cada fila crece hasta el alto de su celda más alta, que se marca con un recuadro; la fila 1 ya era alta por el texto de la primera columna. Luego se desactiva el ajuste: ancho queda apagado, ajuste se enciende, las líneas vuelven a ponerse en una sola, sobresaliendo del borde, y las filas se encogen. Finalmente la tabla vuelve a su estado inicial." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 7.</span> Ethos del algoritmo de Tabula Rasa.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="causal-chain" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/es_manim_causal-chain-light.mp4" poster="/assets/video/tabula-rasa-columns/es_manim_causal-chain-light.png" aria-label="Arriba, una cadena de cuatro recuadros unidos por flechas: ancho, ajuste, líneas y alto de fila. Abajo, una tabla con fila de encabezado, números de fila y tres columnas; el texto de las celdas se representa con barras. La columna del medio se angosta y se enciende ancho: su texto sigue en una sola línea y lo que ya no cabe sobresale, atenuado, más allá del borde. Se enciende ajuste. Se enciende líneas: el texto que sobresalía se dobla hacia abajo en nuevas líneas, apretadas dentro de la fila: una celda corta no cambia, otra baja un trozo pequeño, otra uno mayor, y la más larga queda en tres líneas. Se enciende alto de fila: cada fila crece hasta el alto de su celda más alta, que se marca con un recuadro; la fila 1 ya era alta por el texto de la primera columna. Luego se desactiva el ajuste: ancho queda apagado, ajuste se enciende, las líneas vuelven a ponerse en una sola, sobresaliendo del borde, y las filas se encogen. Finalmente la tabla vuelve a su estado inicial." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 7.</span> Ethos del algoritmo de Tabula Rasa.</figcaption></figure>

<p>Note, querido lector, que hay una variable quizás un poco oculta, pero que es relevante: el ajuste de texto, es decir, si queremos que el texto ocupe más de una línea o no. Aun así, un usuario en su locura puede desactivarlo si es que así lo quiere.</p>

<h3 id="la-intención-de-usuario">La intención de usuario</h3>

<p>Recuerde que una de las heurísticas del diseño de <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> es que <em>los botones de la aplicación deben traducir la intención del usuario</em>, por lo mismo, si vamos a diseñar los botones, debemos ser cuidadosos en interpretar fielmente la intención del usuario al hacer click en un botón o en un menú específico. Para el ancho de columna, el usuario tiene 4 opciones:</p>

<table>
  <thead>
    <tr>
      <th>Intención</th>
      <th>Interpretación</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Min</td>
      <td>Achicar la columna al mínimo que permite Tabula Rasa.</td>
    </tr>
    <tr>
      <td>Fit (ajustar al texto)</td>
      <td>Ajustar el ancho de la columna a la celda con más texto.</td>
    </tr>
    <tr>
      <td>Auto</td>
      <td>Tabula Rasa se encarga del ancho. Es el valor por defecto, y la parte interesante del algoritmo.</td>
    </tr>
    <tr>
      <td>Manual</td>
      <td>El usuario quiere ajustar la columna a su gusto. Es muy importante que tenga esa libertad.</td>
    </tr>
  </tbody>
</table>

<p>Como puede ver, los casos <strong>Min</strong> y <strong>Manual</strong> son triviales y no nos interesan. <strong>Auto</strong> es la razón por la que estamos aquí, y <strong>Fit</strong> es, en el fondo, un caso particular de <strong>Auto</strong>.</p>

<p>Por otra parte, en <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, el usuario tiene las siguientes opciones para la altura:</p>

<table>
  <thead>
    <tr>
      <th>Intención</th>
      <th>Interpretación</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Auto</td>
      <td>Tabula Rasa se encarga de la altura, limitando la altura máxima a \(H_{\max} = 3\).</td>
    </tr>
    <tr>
      <td>1, 2, 3, …</td>
      <td>El usuario elige \(H_{\max}\), es decir, cuántas líneas como máximo puede usar cada fila.</td>
    </tr>
    <tr>
      <td>Fit (ajustar al texto)</td>
      <td>Cada fila crece hasta mostrar el texto completo de su celda más larga, sin importar cuán alta quede.</td>
    </tr>
  </tbody>
</table>

<p>Recuerde la figura <a class="figref" href="#fig-causal-chain">7</a>, ahí vimos que el algoritmo calcula el ancho para cada columna, y a cada celda le da la altura que necesita para mostrar el texto, con un máximo dado por \(H_{\max}\) (que en el caso de <strong>Auto</strong> es \(3\)). Si la altura está en modo <strong>Fit</strong>, entonces la altura crece hasta mostrar todo el texto.</p>

<p>Podríamos decir, entonces, que el algoritmo de <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> transforma la intención del usuario (dada por las dos tablas anteriores) en el ancho y el alto necesarios para mostrar la tabla.</p>

<h3 id="tomando-las-medidas-de-sus-datos">Tomando las medidas de sus datos</h3>

<p>Si bien el diseño nos permite calcular el presupuesto que <em>pide</em> cada celda individual para poder mostrar todos sus datos, si los datos son <em>heterogéneos</em>, ese presupuesto puede ser muy ineficiente aplicado a la columna entera.</p>

<p>Por eso, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> analiza los datos para encontrar el balance entre cuántos datos mostrar, dada la <em>forma</em> en la que vienen sus datos. Y quizás, querido lector, usted pensará que tomar las medidas es la parte trivial del algoritmo, pero no tendría su propia sección si fuera ese el caso: hay ciertos <em>enormes detallitos</em> que no queremos pasar por alto.</p>

<p>El pecado más grande que cometen los visualizadores de datos tabulares es asumir que los datos son <em>homogéneos</em> cuando raramente lo son. Es bastante común encontrarse con un dato en la fila 1000 que es mucho más grande que sus compañeros.</p>

<p>Imagínese la columna de respuestas de una encuesta donde a la gente no le interesa escribir respuestas largas, un simple <em>sí</em> o <em>no</em> basta. Pero de vez en cuando tiene un usuario (probablemente usted) que <strong>realmente ama <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code></strong> y quiere contarle su experiencia con lujo de detalle. En ese caso, usted no quiere gastar espacio precioso ensanchando todas las filas de la columna de respuestas sólo para hacerle espacio a esa respuesta extensa. ¡Su tabla se vería prácticamente vacía! Es más conveniente truncar la celda que es anormalmente larga, y si le interesa leerla puede pasar el mouse encima de la respuesta extensa y un simpático <em>hover</em> aparecerá con el texto completo.</p>

<span class="article__fig-anchor" id="fig-text-truncate"></span><figure class="article__figure article__figure--media" data-fig-label="text-truncate">
  <video src="/assets/video/tabula-rasa-defaults/es_tr_text-truncate.mp4" aria-label="Una columna de respuestas largas de la encuesta en Tabula Rasa, cada una cortada a tres líneas que terminan en puntos suspensivos para que todas las filas conserven la misma altura discreta. El puntero se posa sobre una celda: esta se ilumina en verde azulado con un punto cian pequeño en su esquina, y se abre un tooltip sobre las filas de abajo con esa respuesta completa. Después se ensancha la columna y las mismas respuestas se reacomodan — siguen siendo tres líneas cada una, pero se ve más de cada frase." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 8.</span> Truncaciones y Tooltip en Tabula Rasa. <a href="/assets/files/tabula-rasa-defaults/es_survey.csv">Datos ficticios</a>.</figcaption></figure>

<p>Es por lo anterior que <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> mide dos anchos candidatos por columna al cargar un archivo: \(\hat{W}_{\max}\), el ancho que necesitaría la columna para mostrar su celda más larga en una sola línea, y \(\hat{W}_{95}\), el ancho en el que caben completas el 95% de las celdas (el \(p_{95}\)). De esa forma, al momento de asignar el presupuesto \(b\), podemos truncar los <em>outliers</em> de la muestra eligiendo \(\hat{W}_{\max}\) o \(\hat{W}_{95}\) según alguna heurística que elijamos. ¡Fiuf! ¡Nos hemos salvado de asumir que los datos son homogéneos!</p>

<span class="article__fig-anchor" id="fig-tail-p95"></span><figure class="article__figure article__figure--media" data-fig-label="tail-p95" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-p95.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-p95.png" aria-label="Una tabla de 7 filas, cuyo texto se representa con barras. En la segunda columna casi todas las respuestas son cortas, pero la de la fila 3 es muy larga y la columna mide lo que ella pide; por un momento se marca con recuadros punteados el espacio que las demás celdas no usan, que es casi toda la columna. Sobre la columna se miden Ŵmax, que solo alcanza la respuesta larga, y Ŵ95, que cubre todas las demás. Se elige Ŵ95: la columna se angosta, el espacio vacío casi desaparece, y solo la respuesta larga queda truncada, sobresaliendo atenuada del borde." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 9.</span> Elegir el p95: la columna se angosta y solo el dato más largo queda truncado.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-p95" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-p95-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-p95-light.png" aria-label="Una tabla de 7 filas, cuyo texto se representa con barras. En la segunda columna casi todas las respuestas son cortas, pero la de la fila 3 es muy larga y la columna mide lo que ella pide; por un momento se marca con recuadros punteados el espacio que las demás celdas no usan, que es casi toda la columna. Sobre la columna se miden Ŵmax, que solo alcanza la respuesta larga, y Ŵ95, que cubre todas las demás. Se elige Ŵ95: la columna se angosta, el espacio vacío casi desaparece, y solo la respuesta larga queda truncada, sobresaliendo atenuada del borde." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 9.</span> Elegir el p95: la columna se angosta y solo el dato más largo queda truncado.</figcaption></figure>

<p>Pero querido lector, el algoritmo no se detiene ahí, pues hay datos que son mucho más <em>caros</em> de truncar que otros. Como vimos en <a href="/2026/09/defectos-que-desaparecen/#truncaciones">este post</a>, truncar números les quita valor inmediatamente (si usted ve <code class="language-plaintext highlighter-rouge">8...</code>, no sabe si es <code class="language-plaintext highlighter-rouge">82</code>, <code class="language-plaintext highlighter-rouge">8M</code> u <code class="language-plaintext highlighter-rouge">8.02</code>), pero truncar texto es menos grave (si usted ve “Aunque la mona se vista…”, usted sabe cómo termina esa frase). En consecuencia, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> nunca va a truncar un número, pero se da la licencia de truncar un texto (aplicando la regla del \(p_{95}\) cuando es necesario).</p>

<p>Entonces conviene preguntarse, ¿qué significa “cuando es necesario”? Note que aplicar la regla del \(p_{95}\) así, a rajatabla, nos podría jugar en contra. Hay <em>cierta</em> cantidad de heterogeneidad en los datos que es <em>aceptable</em>, quizás elegir \(\hat{W}_{\max}\) en ciertos casos solo significa ver un par de pixeles vacíos por fila en vez de 100.</p>

<span class="article__fig-anchor" id="fig-tail-blind"></span><figure class="article__figure article__figure--media" data-fig-label="tail-blind" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-blind.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-blind.png" aria-label="Otra tabla de 7 filas, con la segunda columna medida: Ŵmax y Ŵ95 quedan muy cerca, porque la respuesta más larga, en la fila 5, es apenas más larga que el resto. Se elige Ŵ95 de todas formas: la columna se angosta muy poco y la respuesta de la fila 5 queda truncada. Bajo la tabla aparece la diferencia Ŵmax − Ŵ95, una franja angosta: es todo el espacio que se ahorró." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 10.</span> El p95 a rajatabla: se trunca un dato perfectamente legible para ahorrar muy poco.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-blind" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-blind-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-blind-light.png" aria-label="Otra tabla de 7 filas, con la segunda columna medida: Ŵmax y Ŵ95 quedan muy cerca, porque la respuesta más larga, en la fila 5, es apenas más larga que el resto. Se elige Ŵ95 de todas formas: la columna se angosta muy poco y la respuesta de la fila 5 queda truncada. Bajo la tabla aparece la diferencia Ŵmax − Ŵ95, una franja angosta: es todo el espacio que se ahorró." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 10.</span> El p95 a rajatabla: se trunca un dato perfectamente legible para ahorrar muy poco.</figcaption></figure>

<p>Es por lo anterior, que <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> también calcula lo siguiente:</p>

\[\hat{W}_{\max} - \hat{W}_{95} &gt; C
\label{eq:dispersion}\]

<p>Donde \(C\) corresponde al umbral que nos permite decidir qué tan <em>caro</em> es elegir \(\hat{W}_{\max}\) por sobre \(\hat{W}_{95}\).</p>

<p>Por ejemplo, si \(\hat{W}_{\max} - \hat{W}_{95} &lt; C\) entonces la tabla elegiría \(\hat{W}_{\max}\):</p>

<span class="article__fig-anchor" id="fig-tail-gap-keep"></span><figure class="article__figure article__figure--media" data-fig-label="tail-gap-keep" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-keep.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-keep.png" aria-label="La tabla de la figura anterior, cuya respuesta más larga es apenas más larga que el resto. Sobre la columna se miden Ŵmax y Ŵ95. La distancia entre ambas medidas se marca bajo la tabla y baja hacia la izquierda, rotulada Ŵmax − Ŵ95. La tabla se atenúa y, bajo esa medida, partiendo de la misma guía, aparece una regla de largo C, con una guía vertical en su extremo. La diferencia queda más corta que C. Junto a la comparación aparece Ŵmax en color de acento, que sube hasta su medida sobre la tabla mientras la tabla vuelve; Ŵ95 desaparece y la columna conserva su ancho." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 11.</span> La diferencia es menor que C: la columna conserva su ancho máximo.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-gap-keep" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-keep-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-keep-light.png" aria-label="La tabla de la figura anterior, cuya respuesta más larga es apenas más larga que el resto. Sobre la columna se miden Ŵmax y Ŵ95. La distancia entre ambas medidas se marca bajo la tabla y baja hacia la izquierda, rotulada Ŵmax − Ŵ95. La tabla se atenúa y, bajo esa medida, partiendo de la misma guía, aparece una regla de largo C, con una guía vertical en su extremo. La diferencia queda más corta que C. Junto a la comparación aparece Ŵmax en color de acento, que sube hasta su medida sobre la tabla mientras la tabla vuelve; Ŵ95 desaparece y la columna conserva su ancho." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 11.</span> La diferencia es menor que C: la columna conserva su ancho máximo.</figcaption></figure>

<p>En caso contrario, si \(\hat{W}_{\max} - \hat{W}_{95} &gt; C\) entonces la tabla elige \(\hat{W}_{95}\)</p>

<span class="article__fig-anchor" id="fig-tail-gap-cut"></span><figure class="article__figure article__figure--media" data-fig-label="tail-gap-cut" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-cut.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-cut.png" aria-label="La tabla cuya respuesta de la fila 3 es muy larga. Sobre la columna se miden Ŵmax y Ŵ95. La distancia entre ambas medidas se marca bajo la tabla y baja hacia la izquierda, rotulada Ŵmax − Ŵ95. La tabla se atenúa y, bajo esa medida, partiendo de la misma guía, aparece una regla de largo C, con una guía vertical en su extremo. La diferencia sobrepasa C. Junto a la comparación aparece Ŵ95 en color de acento, que sube hasta su medida sobre la tabla mientras la tabla vuelve; Ŵmax desaparece y la columna se angosta, dejando truncada solo la respuesta larga." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 12.</span> La diferencia supera C: la columna se angosta al p95.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="tail-gap-cut" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_tail-gap-cut-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_tail-gap-cut-light.png" aria-label="La tabla cuya respuesta de la fila 3 es muy larga. Sobre la columna se miden Ŵmax y Ŵ95. La distancia entre ambas medidas se marca bajo la tabla y baja hacia la izquierda, rotulada Ŵmax − Ŵ95. La tabla se atenúa y, bajo esa medida, partiendo de la misma guía, aparece una regla de largo C, con una guía vertical en su extremo. La diferencia sobrepasa C. Junto a la comparación aparece Ŵ95 en color de acento, que sube hasta su medida sobre la tabla mientras la tabla vuelve; Ŵmax desaparece y la columna se angosta, dejando truncada solo la respuesta larga." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 12.</span> La diferencia supera C: la columna se angosta al p95.</figcaption></figure>

<p>La variable \(C\) tiene algunos detalles que la hacen interesante:</p>

<ul>
  <li>Es un umbral fijo, por lo tanto no va a variar respecto del ancho del texto de cada columna o cada celda.</li>
  <li>Su unidad de medida es en caracteres, y como la tipografía es monospace, \(\hat{W}\) también está en caracteres.</li>
</ul>

<p>El segundo punto es relevante porque por eso podemos comparar sin ningún miedo \(\hat{W}\) con \(C\), más aún, y volviendo a aprovecharnos de la tipografía monospace, si multiplicamos por la constante de ancho de carácter \(w\), \(C \cdot w\) es exactamente la cantidad de pixeles de <em>presupuesto extra</em> que estamos dispuestos a darle a una columna con datos levemente heterogéneos, que es exactamente lo que buscamos: poder <em>perillar</em> qué tanta heterogeneidad estamos dispuestos a aceptar en nuestra columna sin truncar.</p>

<blockquote class="note">
  <p>Recuerde querido lector, que lo que nos interesa no es la cantidad de caracteres que caben en una celda, sino más bien cuántos pixeles de presupuesto le vamos a dar. Los caracteres son simplemente la unidad de medida base que nos entregan los datos, el medio para llegar a decirle a la aplicación “Ok, asigna 88 pixeles de ancho a esta columna”.</p>
</blockquote>

<p>Hay un último detalle de la variable \(C\), que creo que es el más interesante de todos, y es una decisión de diseño que espero le haga sentido. Note que en la ecuación \ref{eq:dispersion} la comparación se hace a través de una resta en vez de algún enfoque un poco más ingenuo como sería el hacer la comparación a través de una proporción, algo así como:</p>

\[\frac{\hat{W}_{\max}}{\hat{W}_{95}} &gt; C
\label{eq:dispersion_wrong}\]

<p>Sin embargo, si usted estuviese tentado de usar esa fórmula, no estaría considerando los extremos. ¿Qué pasaría si la columna es en general muy corta? ¿Qué pasaría si la columna es en general muy larga? Antes de responder esas preguntas, conviene cuestionarse cuál es el verdadero objetivo de tomar acción frente a la heterogeneidad de los datos, pues recuerde que lo que queremos es mostrar en su pantalla la mayor cantidad de datos sin perder su contexto.</p>

<p>La pantalla tiene un presupuesto <strong>fijo</strong> de pixeles: su pantalla no va a crecer porque tiene más datos, por lo tanto, no tiene sentido que la variable \(C\) sea proporcional, pues el <em>costo</em> de cada pixel extra en una columna es el mismo, independiente del contenido, forma o tamaño de sus datos. Y por lo mismo, tiene más sentido usar la ecuación \(\ref{eq:dispersion}\) y no la ecuación \(\ref{eq:dispersion_wrong}\).</p>

<p>Una idea que se me ocurrió mientras escribía este post, es que quizás \(C\) debería ser proporcional al tamaño de la pantalla… pero eso es un problema para el Benja del futuro, además, creo que ya hemos complicado lo suficiente el cómo medimos el ancho de las celdas, y ya verá que con este tremendo esfuerzo que hemos hecho, es más que suficiente para adecuarnos al 80% de nuestros usuarios.</p>

<p>Quizás parezca sobreingeniería para algo que solo mide, pero lo complicado es el <em>por qué</em>; el código es bastante simple:</p>

<div class="language-rust highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">const</span> <span class="n">TAIL_GAP_CH</span><span class="p">:</span> <span class="nb">f32</span> <span class="o">=</span> <span class="mf">10.0</span><span class="p">;</span>

<span class="k">fn</span> <span class="nf">data_and_max_ch</span><span class="p">(</span>
    <span class="n">len</span><span class="p">:</span> <span class="nn">engine</span><span class="p">::</span><span class="n">ColLen</span><span class="p">,</span>
    <span class="n">num</span><span class="p">:</span> <span class="nb">Option</span><span class="o">&lt;</span><span class="nn">numfmt</span><span class="p">::</span><span class="n">NumShape</span><span class="o">&gt;</span><span class="p">,</span>
<span class="p">)</span> <span class="k">-&gt;</span> <span class="p">(</span><span class="nb">f32</span><span class="p">,</span> <span class="nb">f32</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">let</span> <span class="n">data_ch</span> <span class="o">=</span> <span class="k">match</span> <span class="n">num</span> <span class="p">{</span>
        <span class="nf">Some</span><span class="p">(</span><span class="n">shape</span><span class="p">)</span> <span class="k">=&gt;</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">width_ch</span><span class="p">(</span><span class="n">shape</span><span class="p">,</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">natural</span><span class="p">(</span><span class="n">shape</span><span class="p">)),</span>
        <span class="nb">None</span> <span class="k">if</span> <span class="p">(</span><span class="n">len</span><span class="py">.max</span> <span class="k">as</span> <span class="nb">f32</span> <span class="o">-</span> <span class="n">len</span><span class="py">.p95</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="n">TAIL_GAP_CH</span> <span class="k">=&gt;</span> <span class="n">len</span><span class="py">.max</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">,</span>
        <span class="nb">None</span> <span class="k">=&gt;</span> <span class="n">len</span><span class="py">.p95</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">,</span>
    <span class="p">};</span>
    <span class="k">let</span> <span class="n">max_ch</span> <span class="o">=</span> <span class="k">match</span> <span class="n">num</span> <span class="p">{</span>
        <span class="nf">Some</span><span class="p">(</span><span class="n">shape</span><span class="p">)</span> <span class="k">=&gt;</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">width_ch</span><span class="p">(</span><span class="n">shape</span><span class="p">,</span> <span class="nn">numfmt</span><span class="p">::</span><span class="nf">natural</span><span class="p">(</span><span class="n">shape</span><span class="p">)),</span>
        <span class="nb">None</span> <span class="k">=&gt;</span> <span class="n">len</span><span class="py">.max</span> <span class="k">as</span> <span class="nb">f32</span><span class="p">,</span>
    <span class="p">};</span>
    <span class="p">(</span><span class="n">data_ch</span><span class="p">,</span> <span class="n">max_ch</span><span class="p">)</span>
<span class="p">}</span>
</code></pre></div></div>

<p>donde <code class="language-plaintext highlighter-rouge">len</code> tiene las estadísticas de una columna (entre ellas, <code class="language-plaintext highlighter-rouge">max</code> y <code class="language-plaintext highlighter-rouge">p95</code>), si <code class="language-plaintext highlighter-rouge">num</code> es <code class="language-plaintext highlighter-rouge">Some(shape)</code> es un número, si no, es texto. Note que <code class="language-plaintext highlighter-rouge">data_ch</code> es el presupuesto que le entregamos a la columna, y <code class="language-plaintext highlighter-rouge">max_ch</code> es cuánto ancho necesitaríamos sin truncar nada. Si la columna es numérica, entonces <code class="language-plaintext highlighter-rouge">data_ch == max_ch</code> y nunca se trunca, en caso contrario, depende de la heterogeneidad el valor que tome <code class="language-plaintext highlighter-rouge">data_ch</code> (en este caso la constante \(C\) es la variable <code class="language-plaintext highlighter-rouge">TAIL_GAP_CH</code>).</p>

<p>El presupuesto de la columna \(i\) es entonces \(b_i = \hat{W}_i \cdot w\), donde \(\hat{W}_i\) es \(\hat{W}_{\max}\) o \(\hat{W}_{95}\) según la ecuación \eqref{eq:dispersion}.</p>

<h3 id="cortando-el-traje-a-la-medida-de-los-datos">Cortando el traje a la medida de los datos</h3>

<p>¡Uff! ¿Usted pensaba que medir era simple? Bueno, cortar el traje a la medida es un poco más complejo, pero no por eso más complicado. La complejidad aparece porque el algoritmo tiene muchas <em>partes móviles</em>, y cada una de esas partes tiene una razón de ser. Sin embargo, cada parte es muy simple, y en su conjunto, permiten resolver el objetivo de esta sección: asignarle a cada columna el ancho que maximiza la cantidad de información <strong>contextualizada</strong> en la pantalla.</p>

<p>A esta altura, ya sabemos cuántos pixeles pide cada celda para no ser truncada gracias al presupuesto \(b\), y también sabemos cuánto presupuesto realmente estamos dispuestos a darle a cada celda dada su <em>homogeneidad</em> o <em>heterogeneidad</em>, pero hay un presupuesto que no hemos considerado todavía, ¡y es el tamaño de su pantalla! No podemos andar regalándole los pixeles que quiere cada celda, fila o columna a tontas y a locas, pues rápidamente nos quedaremos sin espacio en pantalla para mostrar todos esos datos.</p>

<p>Es por eso que para poder <em>cortar el traje a la medida de los datos</em>, necesitamos primero considerar el tamaño de la pantalla del usuario, para luego repartir toda esta montaña de presupuestos que hemos calculado a la montaña de datos que nuestro querido usuario quiere ver.</p>

<h4 id="dividiendo-la-pantalla">Dividiendo la pantalla</h4>

<p>En general, el algoritmo busca dividir la pantalla de forma <em>justa</em>. En la sección anterior, resolvimos el problema de la heterogeneidad de los datos al calcularles diferentes <em>presupuestos</em> a cada columna. En esta sección, la pregunta es, dados los presupuestos calculados en cada columna, <strong>¿cómo repartimos la pantalla de forma justa?</strong></p>

<p>Como diría cualquier profesional competente: la respuesta es depende. El procedimiento de esta <em>repartija</em> de presupuestos tiene 4 ideas centrales:</p>

<ul>
  <li>Definir un ancho máximo tentativo de columna, \(W_t\), que luego ajustaremos para obtener el ancho máximo real, \(W_k\).</li>
  <li>Evitar que las columnas con mucho presupuesto <em>acaparen</em> toda la pantalla.</li>
  <li>Evitar los truncamientos, priorizando a las columnas que piden menos presupuesto.</li>
  <li>Optimizar casos de borde cuando el presupuesto es más pequeño que la cantidad de pantalla disponible.</li>
</ul>

<p>Fíjese que la primera condición tiene una consecuencia importante: al definir el ancho máximo de columnas (ya sea el tentativo \(W_t\) o el real \(W_k\) que luego definiremos bien), implícitamente estamos definiendo la mínima cantidad de columnas visibles en todo momento, que llamaremos \(k\). Además, \(k\) depende del tamaño de la pantalla, que llamaremos \(V\).</p>

<p>Por lo tanto, \(k\) sigue la ecuación</p>

\[k = V / W_t
\label{eq:k_notround}\]

<span class="article__fig-anchor" id="fig-viewport-k"></span><figure class="article__figure article__figure--media" data-fig-label="viewport-k" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/es_manim_viewport-k.mp4" poster="/assets/video/tabula-rasa-columns/es_manim_viewport-k.png" aria-label="Una tabla, con su texto representado por barras, atraviesa una pantalla de ancho V y se sale por ambos lados, donde se ve atenuada y se desvanece. Todas sus columnas miden W_t, y ni su ancho ni su posición cambian en ningún momento. Dentro de la pantalla las columnas aparecen encendidas, y bajo ella se lee k = V / W_t = 3,0. La pantalla se achica desde su borde derecho: caben menos columnas, la tercera queda cortada por el borde, y k baja a 2,2. Luego la pantalla se agranda: caben más, y k sube a 4,2, con la última columna otra vez a medias. Finalmente la pantalla vuelve a su tamaño inicial y k a 3,0." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 13.</span> Las columnas no cambian, la pantalla sí: k crece y decrece con ella.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="viewport-k" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/es_manim_viewport-k-light.mp4" poster="/assets/video/tabula-rasa-columns/es_manim_viewport-k-light.png" aria-label="Una tabla, con su texto representado por barras, atraviesa una pantalla de ancho V y se sale por ambos lados, donde se ve atenuada y se desvanece. Todas sus columnas miden W_t, y ni su ancho ni su posición cambian en ningún momento. Dentro de la pantalla las columnas aparecen encendidas, y bajo ella se lee k = V / W_t = 3,0. La pantalla se achica desde su borde derecho: caben menos columnas, la tercera queda cortada por el borde, y k baja a 2,2. Luego la pantalla se agranda: caben más, y k sube a 4,2, con la última columna otra vez a medias. Finalmente la pantalla vuelve a su tamaño inicial y k a 3,0." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 13.</span> Las columnas no cambian, la pantalla sí: k crece y decrece con ella.</figcaption></figure>

<p>¡Una pantalla más grande puede tener más columnas visibles en todo momento! Note además, que en nuestro objetivo de no <em>perder contexto</em>, nos gustaría que las columnas no aparezcan cortadas en pantalla, sino que más bien, aparezcan enteras. Por lo tanto, podríamos arreglar la ecuación \ref{eq:k_notround} y obtenemos lo siguiente</p>

\[k = \operatorname{round}\left( V / W_t \right)
\label{eq:k}\]

<p>Deténgase un minuto a contemplar lo simple y compacta que es esta ecuación. Toda esa gran cantidad de párrafos que justifican una u otra decisión de diseño se pueden resumir en una simple división redondeada.</p>

<p>El valor \(W_t = 67 \cdot w\) lo elegí <em>al ojo</em>. En mi experiencia, con la pantalla que utilizo para desarrollar la aplicación (un notebook de 14’’, con unos 1440 px de ancho útil), se obtienen 3 columnas, un valor que me acomoda.</p>

<p>Finalmente, y una vez calculado \(k\), podemos calcular el valor <em>real</em> de \(W\), es decir, el valor que nos asegura que veremos a lo menos \(k\) columnas en pantalla:</p>

\[W_k = V / k
\label{eq:ancho-maximo}\]

<span class="article__fig-anchor" id="fig-ksteps"></span><figure class="article__figure article__figure--media" data-fig-label="ksteps" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_ksteps.mp4" poster="/assets/video/tabula-rasa-columns/manim_ksteps.png" aria-label="La misma tabla que atraviesa la pantalla de ancho V y se sale por ambos lados, atenuada. Ahora k es un número entero, y bajo la pantalla se lee W_k = V / 2. Al comienzo caben exactamente 2 columnas. Luego k cambia a 3, a 4 y a 5: en cada paso la lectura cambia primero, y después las columnas se angostan hasta que exactamente k columnas enteras llenan la pantalla, con la cota W_k sobre la primera columna ajustándose con ellas. Finalmente k vuelve a 2 y las columnas se ensanchan otra vez." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 14.</span> Con k entero, las columnas se ajustan para llenar la pantalla exactamente.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="ksteps" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_ksteps-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_ksteps-light.png" aria-label="La misma tabla que atraviesa la pantalla de ancho V y se sale por ambos lados, atenuada. Ahora k es un número entero, y bajo la pantalla se lee W_k = V / 2. Al comienzo caben exactamente 2 columnas. Luego k cambia a 3, a 4 y a 5: en cada paso la lectura cambia primero, y después las columnas se angostan hasta que exactamente k columnas enteras llenan la pantalla, con la cota W_k sobre la primera columna ajustándose con ellas. Finalmente k vuelve a 2 y las columnas se ensanchan otra vez." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 14.</span> Con k entero, las columnas se ajustan para llenar la pantalla exactamente.</figcaption></figure>

<p>Así, \(W_k\) divide la pantalla exactamente en \(k\) columnas iguales, y como ninguna columna que compite por espacio puede superar \(W_k\), usted siempre verá al menos \(k\) columnas. ¿Y si las columnas no caben todas? No hay problema: la tabla se desplaza horizontalmente. \(W_k\) no busca que todo quepa en pantalla, sino que usted siempre tenga al menos \(k\) columnas a la vista, con su contexto. La siguiente tabla muestra el resultado en pantallas de distintos tamaños, con \(w \approx 7.2\) px (es decir, \(W_t \approx 482\) px):</p>

<table>
  <thead>
    <tr>
      <th>Pantalla</th>
      <th style="text-align: right">\(V\) (px)</th>
      <th style="text-align: right">\(V / W_t\)</th>
      <th style="text-align: right">\(k\)</th>
      <th style="text-align: right">\(W_k\) (px)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Notebook</td>
      <td style="text-align: right">1440</td>
      <td style="text-align: right">2.99</td>
      <td style="text-align: right">3</td>
      <td style="text-align: right">480</td>
    </tr>
    <tr>
      <td>Monitor 24″ 1080p</td>
      <td style="text-align: right">1920</td>
      <td style="text-align: right">3.98</td>
      <td style="text-align: right">4</td>
      <td style="text-align: right">480</td>
    </tr>
    <tr>
      <td>Monitor 27″ 1440p</td>
      <td style="text-align: right">2560</td>
      <td style="text-align: right">5.31</td>
      <td style="text-align: right">5</td>
      <td style="text-align: right">512</td>
    </tr>
    <tr>
      <td>Ultrawide 34″</td>
      <td style="text-align: right">3440</td>
      <td style="text-align: right">7.13</td>
      <td style="text-align: right">7</td>
      <td style="text-align: right">491</td>
    </tr>
  </tbody>
</table>

<p>Note que \(W_k\) casi no cambia entre pantallas: lo que crece con la pantalla es la cantidad mínima de columnas que usted verá.</p>

<span class="article__fig-anchor" id="fig-screen-fit"></span><figure class="article__figure article__figure--media" data-fig-label="screen-fit" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_screen-fit.mp4" poster="/assets/video/tabula-rasa-columns/manim_screen-fit.png" aria-label="La misma tabla que atraviesa una pantalla de ancho V. Sobre la primera columna hay dos cotas: W_t, gris, que nunca cambia, y W_k, que sigue el ancho real de las columnas. Bajo la pantalla se lee k = round(V / W_t) y W_k = V / k. La pantalla cambia de tamaño varias veces. En cada cambio, primero la pantalla se mueve con las columnas quietas, y k se recalcula: las columnas que k cuenta se encienden, aunque la última sobresalga del borde, y la que no cuenta se apaga aunque esté en parte dentro de la pantalla. Luego las columnas se ensanchan o se angostan hasta que exactamente k columnas llenan la pantalla. W_k queda siempre cerca de W_t: k pasa de 3 a 2, a 4, a 6, y vuelve a 3." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 15.</span> Al cambiar el tamaño de la pantalla, k se recalcula y las columnas se ajustan para caber enteras.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="screen-fit" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_screen-fit-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_screen-fit-light.png" aria-label="La misma tabla que atraviesa una pantalla de ancho V. Sobre la primera columna hay dos cotas: W_t, gris, que nunca cambia, y W_k, que sigue el ancho real de las columnas. Bajo la pantalla se lee k = round(V / W_t) y W_k = V / k. La pantalla cambia de tamaño varias veces. En cada cambio, primero la pantalla se mueve con las columnas quietas, y k se recalcula: las columnas que k cuenta se encienden, aunque la última sobresalga del borde, y la que no cuenta se apaga aunque esté en parte dentro de la pantalla. Luego las columnas se ensanchan o se angostan hasta que exactamente k columnas llenan la pantalla. W_k queda siempre cerca de W_t: k pasa de 3 a 2, a 4, a 6, y vuelve a 3." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 15.</span> Al cambiar el tamaño de la pantalla, k se recalcula y las columnas se ajustan para caber enteras.</figcaption></figure>

<h4 id="repartiendo-el-presupuesto">Repartiendo el presupuesto</h4>

<p>Querido lector, usted se preguntará por qué habremos calculado el presupuesto con la ecuación \ref{eq:presupuesto} si después vamos a dividir la pantalla en \(k\) columnas de ancho \(W_k\) y al parecer <em>ignorar</em> esos presupuestos que tanto nos esforzamos en calcular. La razón es que, a veces nos conviene utilizar un valor, y otras veces el otro valor, y eso dependerá de si el presupuesto de la columna \(i\), que llamaremos \(b_i\), es mayor a \(W_k\) o si es menor.</p>

<p>Partamos con la situación más simple, si \(b_i &lt; W_k\), entonces podemos darle a la columna \(i\) el presupuesto que pide, pues recuerde que \(W_k\) es lo máximo que estamos dispuestos a darle, y el presupuesto pide menos del máximo.</p>

<p>Por otra parte, si \(b_i &gt; W_k\), el espacio que le daremos a la columna i-ésima será \(W_k\) que es el máximo que podemos darle a una columna según la sección anterior.</p>

<p>Es decir, podríamos resumir la idea anterior como que el ancho de la columna i-ésima, que llamaremos \(W_i\) está dado por:</p>

\[W_i = \min(b_i, W_k)\]

<p>La siguiente visualización muestra una tabla que tiene algunas columnas con presupuestos más grandes que \(W_k\) y algunas columnas con presupuestos más pequeños.</p>

<span class="article__fig-anchor" id="fig-budget-cap"></span><figure class="article__figure article__figure--media" data-fig-label="budget-cap" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-cap.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-cap.png" aria-label="Una tabla de cuatro columnas en una pantalla de ancho V; sobre la pantalla se mide W_k. Cada columna parte con el ancho que pide, b_i, medido sobre ella; la tabla entera es visible y sobresale por la derecha de la pantalla. Una copia de W_k baja sobre la segunda columna, que pide más: la parte que excede W_k se vela, y la columna se angosta hasta W_k, con sus textos cortados en puntos suspensivos y las columnas siguientes corriéndose a la izquierda. Lo mismo ocurre con la cuarta columna. Bajo la pantalla aparece la cota V; luego la medida de cada columna cae, una a una, sobre una misma línea, donde quedan una tras otra formando la suma de min(b_i, W_k), más larga que V: la tabla aún no cabe en la pantalla." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 16.</span> Ninguna columna recibe más que Wₖ, aunque su presupuesto pida más.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-cap" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-cap-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-cap-light.png" aria-label="Una tabla de cuatro columnas en una pantalla de ancho V; sobre la pantalla se mide W_k. Cada columna parte con el ancho que pide, b_i, medido sobre ella; la tabla entera es visible y sobresale por la derecha de la pantalla. Una copia de W_k baja sobre la segunda columna, que pide más: la parte que excede W_k se vela, y la columna se angosta hasta W_k, con sus textos cortados en puntos suspensivos y las columnas siguientes corriéndose a la izquierda. Lo mismo ocurre con la cuarta columna. Bajo la pantalla aparece la cota V; luego la medida de cada columna cae, una a una, sobre una misma línea, donde quedan una tras otra formando la suma de min(b_i, W_k), más larga que V: la tabla aún no cabe en la pantalla." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 16.</span> Ninguna columna recibe más que Wₖ, aunque su presupuesto pida más.</figcaption></figure>

<p>Fíjese que la visualización introduce un nuevo concepto: El ancho total de la <strong>tabla</strong>, con una expresión que quizás da un poco de miedo al verla por primera vez:</p>

\[W_T = \sum_i \min(b_i, W_k) = \sum_i W_i\]

<p>O en otras palabras, el ancho total \(W_T\) corresponde a la suma de los anchos de todas las columnas de la tabla. Simple ¿o no? La expresión parece mucho más fea de lo que es. Y resulta que es en el paso siguiente que viene la última genialidad del algoritmo: las columnas negocian entre sí el espacio que van a utilizar en pantalla, y estas negociaciones se basan en las dos variables que tiene para <em>perillar</em> cada columna: \(b_i\) y \(W_k\).</p>

<p>Si es que no hay suficiente espacio en pantalla, y todas las columnas tienen un presupuesto \(b_i &gt; W_k\), entonces no hay mucho que negociar, todos los anchos calculados terminarán siendo iguales a \(W_k\). El truco está en cuando el presupuesto total \(W_T &lt; V\), en ese caso aún nos queda espacio en la pantalla disponible después de repartir todo el presupuesto:</p>

<span class="article__fig-anchor" id="fig-budget-leftover"></span><figure class="article__figure article__figure--media" data-fig-label="budget-leftover" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-leftover.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-leftover.png" aria-label="Otra tabla, de cuatro columnas ya limitadas a W_k, en la misma pantalla. Bajo ella, la cota V y la suma de min(b_i, W_k), que esta vez es más corta: la tabla termina antes del borde derecho de la pantalla. El espacio que sobra se marca con un recuadro punteado que destella una vez. Luego destellan los puntos suspensivos de las celdas que siguen truncadas: sobra pantalla, y aun así hay datos cortados." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 17.</span> Sobra pantalla, y aun así hay datos truncados.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-leftover" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-leftover-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-leftover-light.png" aria-label="Otra tabla, de cuatro columnas ya limitadas a W_k, en la misma pantalla. Bajo ella, la cota V y la suma de min(b_i, W_k), que esta vez es más corta: la tabla termina antes del borde derecho de la pantalla. El espacio que sobra se marca con un recuadro punteado que destella una vez. Luego destellan los puntos suspensivos de las celdas que siguen truncadas: sobra pantalla, y aun así hay datos cortados." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 17.</span> Sobra pantalla, y aun así hay datos truncados.</figcaption></figure>

<p>Considere que en este caso, nuestros molestosos \(W_k\) limitaron a las columnas a ese ancho, incluso cuando algunas columnas estaban pidiendo más con su presupuesto \(b_i\), quedando truncadas ¡y había espacio disponible en la pantalla para entregar! En este caso, repartimos lo que sobra con un criterio de <a href="https://en.wikipedia.org/wiki/Max-min_fairness">equidad max-min</a> (<em>max-min fairness</em>).</p>

<p>Imagine que cada columna es un <em>vaso</em> de alto \(b_i\), y donde la cantidad de agua de cada vaso es el ancho que le dimos en la tabla. Quizás a algunas columnas les asignamos todo el presupuesto que pedían, en ese caso el vaso está lleno, pero hay otras columnas que pedían más de lo que podíamos darles, y solo les asignamos \(W_k\), en ese caso, un vaso alto está <em>medio vacío</em>. Como vimos anteriormente, aún nos queda agua (que sería la cantidad de pantalla disponible) y vamos a intentar repartirla de forma equitativa.</p>

<p>El algoritmo de <strong>equidad max-min</strong>  lo que hace es verter el <em>agua</em> (ancho de pantalla) que nos queda en cada vaso <strong>que no está lleno</strong> de forma equitativa. Si un vaso se llena, entonces dejamos de darle agua (porque ya alcanzó el presupuesto que pedía), y el resto del agua se la damos a las columnas que aún no terminan de llenarse.</p>

<p>De esta forma, hacemos todo lo posible por minimizar la cantidad de columnas que se verán truncadas, sin dejar de lado las columnas que piden más, y sin permitir que ninguna columna acapare ancho precioso.</p>

<span class="article__fig-anchor" id="fig-budget-glasses"></span><figure class="article__figure article__figure--media" data-fig-label="budget-glasses" data-theme-art="dark">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses.png" aria-label="La misma tabla, que termina antes del borde derecho de la pantalla; el espacio que sobra está marcado con un recuadro punteado. Bajo la pantalla, la cota V y la suma de los anchos de las columnas, que llega hasta W_T y sigue punteada hasta V. Cada columna tiene su propio color: ocre, azul, verde y rojo. Aparecen cinco vasos vacíos: uno sobre cada columna, tan alto como el ancho que necesitaría la columna para no truncar nada, y un quinto a la derecha de la pantalla, rotulado V − W_T. Una línea del color de cada columna mide su ancho sobre la pantalla, gira hasta quedar vertical y se ubica junto a su vaso; el tramo punteado entre W_T y V hace lo mismo junto al quinto vaso, y la suma queda terminando en W_T. Los vasos se llenan hasta esas líneas: el nivel del agua es el ancho de la columna. El azul y el verde, ambos limitados a W_k, parten al mismo nivel; el ocre y el rojo ya están llenos y reciben una tapa. Luego el quinto vaso se vacía mientras el azul y el verde se llenan al mismo ritmo, y sus columnas se ensanchan con ellos mientras el espacio sobrante se achica. El verde se llena primero y recibe su tapa; el azul sigue subiendo hasta que el quinto vaso queda vacío, la tabla ocupa toda la pantalla y la suma alcanza V. Las celdas truncadas recuperan su texto, salvo la más larga de la columna azul." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 18.</span> Equidad max-min: el espacio que sobra se reparte entre las columnas que lo piden.</figcaption></figure>
<figure class="article__figure article__figure--media" data-fig-label="budget-glasses" data-theme-art="light">
  <video src="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.mp4" poster="/assets/video/tabula-rasa-columns/manim_budget-glasses-light.png" aria-label="La misma tabla, que termina antes del borde derecho de la pantalla; el espacio que sobra está marcado con un recuadro punteado. Bajo la pantalla, la cota V y la suma de los anchos de las columnas, que llega hasta W_T y sigue punteada hasta V. Cada columna tiene su propio color: ocre, azul, verde y rojo. Aparecen cinco vasos vacíos: uno sobre cada columna, tan alto como el ancho que necesitaría la columna para no truncar nada, y un quinto a la derecha de la pantalla, rotulado V − W_T. Una línea del color de cada columna mide su ancho sobre la pantalla, gira hasta quedar vertical y se ubica junto a su vaso; el tramo punteado entre W_T y V hace lo mismo junto al quinto vaso, y la suma queda terminando en W_T. Los vasos se llenan hasta esas líneas: el nivel del agua es el ancho de la columna. El azul y el verde, ambos limitados a W_k, parten al mismo nivel; el ocre y el rojo ya están llenos y reciben una tapa. Luego el quinto vaso se vacía mientras el azul y el verde se llenan al mismo ritmo, y sus columnas se ensanchan con ellos mientras el espacio sobrante se achica. El verde se llena primero y recibe su tapa; el azul sigue subiendo hasta que el quinto vaso queda vacío, la tabla ocupa toda la pantalla y la suma alcanza V. Las celdas truncadas recuperan su texto, salvo la más larga de la columna azul." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es"><span class="article__fig-num">Figura 18.</span> Equidad max-min: el espacio que sobra se reparte entre las columnas que lo piden.</figcaption></figure>

<p>Maravíllese con lo que acabamos de hacer, sin asumir datos homogéneos, hemos podido repartir de forma <em>justa</em> pixeles entre todas las columnas, truncando la menor cantidad de datos, y asegurando que nunca una celda se perderá en su contexto. Si usted no está llorando de felicidad en este momento, no sé qué es lo que podría hacerle llorar honestamente.</p>

<h3 id="ajustándose-a-los-datos">Ajustándose a los datos</h3>

<p>Como ya hemos visto, en el algoritmo, el ancho de las columnas define la altura de cada fila, excepto cuando el usuario elige <strong>Fit</strong> para el ancho. Recuerde que, en ese caso, el usuario quiere que el ancho o la altura de las celdas se ajusten de forma tal que los datos jamás se trunquen.</p>

<p>Y es en este caso particular solamente, que invertimos el algoritmo: cada columna calcula su ancho a partir del modo de altura que eligió el usuario.</p>

<p>Por ejemplo, si el usuario dice que quiere que sus celdas tengan altura 4, entonces las columnas se ensanchan de forma tal que:</p>

<ul>
  <li>Ninguna celda supere las 4 líneas</li>
  <li>No se trunque ningún dato</li>
</ul>

<p>Ahora bien, si usted tiene buena memoria, recordará que también hay <a href="#la-intención-de-usuario">un modo <strong>fit</strong> para la altura</a> de las celdas. Cuando el ancho y la altura están ambos en <strong>Fit</strong>, el algoritmo tiene carta blanca para decidir tanto la altura como el ancho de cada celda. Y en ese caso, la única regla que sigue <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> es que la proporción ancho/alto sea a lo más 1: la celda queda, como mucho, tan ancha como alta, es decir, aproximadamente cuadrada.</p>

<h2 id="reflexiones-finales">Reflexiones finales</h2>

<p>Querido lector, el algoritmo está listo, con eso, hemos podido crear un algoritmo automático de cálculo de ancho de columna, que permite abrir archivos CSV y verlos bien al instante, y que respeta las intenciones del usuario, incluso la de manejar los tamaños de su tabla a mano.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> nace de una frustración con el Software existente, pero se ha terminado convirtiendo en una herramienta de exploración intelectual. Intento combinar el buen gusto (que creo tener), con el desafío intelectual que requiere hacer un Software que, parafraseando al Señor Jobs, <em>it just works</em>.</p>

<p>Y es que en pocos meses, he podido llevar a Tabula Rasa a un estado en que ya cumple con su objetivo inicial, es mi Software de uso diario cuando tengo que trabajar con CSVs, y claro, este logro se debe a mi trabajo duro, pero también a que he usado mucho el <em>Agente</em> para escribir el Software. Y el discurso prevalente en Internet, es que este tipo de Software, escrito principalmente con Agentes es <em>slop</em>. Espero que al leer este artículo, esté de acuerdo conmigo que aún se puede hacer Software de calidad en el año 2026. Realmente creo que el gran <em>as bajo la manga</em> de Tabula Rasa es que dedico una gran cantidad de horas a pensar y escribir sobre el proceso, y espero que esto lo inspire a usted, querido lector, a hacer cosas pensadas, <em>maceradas</em> en su mente, de las que todos nos beneficiamos, y, sobre todo, ¡que no está todo perdido!</p>]]></content><author><name>Benjamín Opazo</name></author><category term="Tabula Rasa" /><summary type="html"><![CDATA[Discusión sobre los algoritmos de Tabula Rasa para ajustar columnas.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-columns/header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-columns/header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="es"><title type="html">Las Redes Sociales son ridículamente entretenidas</title><link href="https://blog.benjaopazoc.cl/2026/09/dejando-las-redes-sociales/" rel="alternate" type="text/html" title="Las Redes Sociales son ridículamente entretenidas" /><published>2026-09-16T19:30:00+00:00</published><updated>2026-09-16T19:30:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/09/dejando-las-redes-sociales</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/09/dejando-las-redes-sociales/"><![CDATA[<p>Hace unos meses decidí <em>soltar</em> a las Redes Sociales… bueno no todas… bueno sólo Instagram y parte de Reddit. La idea venía cultivándose hace un buen tiempo, pero hubo un momento que me hizo abalanzarme a la decisión. Déjeme contársela, querido lector.</p>

<p>Era un lento domingo por la mañana, había alguna guerra en el Medio Oriente comenzando, no recuerdo cuál. Una guerra que honestamente no me afecta directamente, excepto por la tristeza y la rabia que me genera. Me levanté de la cama, tomé un exquisito desayuno con mi <em>polola</em><sup id="fnref:polola"><a href="#fn:polola" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>, y luego de eso fui al baño. Durante mi <em>estancia</em> en el baño hice lo que cualquier adicto a las RRSS hace: ponerse a ver <em>Reels</em>. Y empezó el scroll infinito:</p>

<ol>
  <li>Un humorista haciendo <em>Stand up Comedy</em>. Chistoso, me sacó una sonrisa.</li>
  <li>Unos gatitos siendo gatitos. Tierno, mucha serotonina.</li>
  <li>Un misil cayendo sobre la casa de una pobre persona en Medio Oriente. Literal durante los primeros 500ms se veía caer el misil, gritos y gente corriendo. No había ni tiempo de hacer <em>swipe</em>. Hasta aquí llegó el scroll infinito.</li>
</ol>

<figure class="article__figure figure-row"><img src="/assets/img/social-media-leaving/Humorista.png" alt="Un humorista haciendo stand up comedy" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/GatitosYPerritos.png" alt="Gatitos y perritos siendo tiernos" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/Bomba.png" alt="Un misil cayendo sobre una casa en Medio Oriente" loading="lazy" data-zoomable="" /></figure>

<blockquote>
  <p><strong>“Consume el horror, humano idiota”</strong> era lo que me estaba diciendo <em>el algoritmo</em>.</p>
</blockquote>

<p>En esa prosaica estancia, decidí que era suficiente de RRSS para mí, no quiero que <em>la máquina</em> elija cómo me debo sentir, menos aún en ese delicioso domingo matutino, lleno de sol, comida exquisita, buena compañía, con pajaritos en el patio y mis hermosos animales acompañándome en ese idilio.</p>

<figure class="article__figure figure-row"><img src="/assets/img/social-media-leaving/flor.jpg" alt="Una flor colgante rosada y morada en el patio" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/gp.jpg" alt="Un perro y un gato juntos al sol en el patio" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/p.jpg" alt="Un gato tomando sol sobre una mesa de madera" loading="lazy" data-zoomable="" /></figure>

<p>Querido lector, quizás usted piense que es <strong>mi</strong> <em>algoritmo</em> y no <strong>el</strong> <em>algoritmo</em> el culpable, y por transitividad el culpable soy yo, pero ese no es el caso: Llevo años siendo extremadamente cuidadoso curando mi experiencia en las redes sociales. Quizás en más de una ocasión incomodé a algún amigo en un momento poco apropiado hablándole del <em>algoritmo</em> o de cómo la publicidad está hecha para controlarte y que todos quieren venderte algo.</p>

<p>Y teniendo conciencia de lo anterior es que he luchado contra el famoso (¿o infame?) <em>algoritmo</em> casi de forma obsesiva, he curado mi experiencia en RRSS con mucha dedicación: Al momento de escribir esto, tengo 1278 cuentas bloqueadas en Instagram (principalmente para evitar la publicidad de las <em>grandes marcas</em>), y créame, querido lector, que prácticamente todos los días apretaba en media docena de posts el botón de “no me interesa”. Pero las mujeres irrealmente hermosas, los políticos enfurecidos, las bombas en Medio Oriente, y hasta los simpáticos influencers vendiéndome basura seguían apareciendo. Era mi propia guerra contra el <em>algoritmo</em> y la estaba perdiendo en el hermoso patio de mi casa (y en el WC), me llenaba la mente de genocidios en vez de disfrutar de los pajaritos, desayunos, y domingos idílicos.</p>

<p>Como si fuera poco, la política y la rabia están presentes en todo momento. Todo tiene que darte rabia, todo tiene que ser político, ganar puntos para tu lado (el de los buenos por supuesto), y ver cómo el otro lado queda en ridículo, se equivoca, o dice algo que enfurece. Es un juego que nos mantiene siempre atentos, conectados, buscando con qué escandalizarnos esta semana (y sólo esta semana, ¡la siguiente habrá un nuevo escándalo más importante!), tener una opinión y compartirla, o más bien, vociferarla. Lamentablemente la actualidad es efímera, y no es suficiente con haberme enojado hoy, la semana pasada, y todas las semanas hacia atrás. No, tengo que <em>actualizar</em> el enojo, el escándalo, el horror con lo que ocurre <em>¡ahora ya! ¡en este momento!</em></p>

<p>Y si hablamos de rabia, Reddit se lleva el premio mayor: la política se mete hasta en los Subreddits <a href="https://www.reddit.com/r/pics/comments/1qlw39u/alex_pretti_the_man_murdered_today_by_ice_agents/">que</a> <a href="https://www.reddit.com/r/MadeMeSmile/comments/1ulkrii/great_to_see_heroes_being_honoured/">uno</a> <a href="https://www.reddit.com/r/wholesomememes/comments/1sqs2go/flipped_this_one_around_p/">nunca</a> <a href="https://www.reddit.com/r/dataisbeautiful/comments/1ok0ps1/government_shutdowns_in_the_us_oc/">se</a> <a href="https://www.reddit.com/r/interestingasfuck/comments/1pn8jnh/the_hero_awake_and_recovering_in_the_hospital/">imaginaría</a>.  Pareciera ser que muchas personas piensan que es un imperativo moral el meter la política en todas las conversaciones existentes. Pero yo no estoy de acuerdo con eso, participar de internet, compartir un hobby, o querer ver fotos de gatitos tiernos no equivale a participar de la política y la actualidad.</p>

<p>Pero el problema es que las RRSS son <em>muy entretenidas</em>. Ridículamente entretenidas. Es maravillosa esa sensación cuando ves 4 o 5 <em>shorts</em> seguidos y llegas a llorar de la risa<sup id="fnref:ig"><a href="#fn:ig" class="footnote" rel="footnote" role="doc-noteref">2</a></sup>. Es un poco menos maravillosa esa sensación de cuando haces <em>swipe</em> para ver el sexto short y aparece una casa de alguna persona en Medio Oriente siendo bombardeada. ¡Y pareciera ser que no hay nada que se puede hacer al respecto! Es una experiencia notablemente sórdida, y por lo visto tendremos que resignarnos a esta forma de vivir nuestras vidas: nos reímos con nuestro influencer favorito, luego lloramos al ver la historia de un gatito abandonado, nos enrabiamos con algún político local, vemos guerras y genocidios en tiempo real, y ¡oh! me tengo que bajar en la siguiente estación, guardo el teléfono en mi bolsillo y sigo la vida. No sin antes agradecer a nuestros auspiciadores, ¡la casa de apuestas más entretenida!</p>

<p>El <em>algoritmo</em> es notablemente perverso. Recuerdo haberme sorprendido una vez que abrí una cuenta nueva en Instagram y pude ver cómo funcionaba un algoritmo fresco para un hombre heterosexual:</p>

<figure class="article__figure"><img src="/assets/img/social-media-leaving/insta_feed.jpg" alt="Captura de la pestaña Explorar de Instagram: mujeres, fútbol, tecnología y animé" loading="lazy" data-zoomable="" /><figcaption class="article__caption" lang="es">Mujeres, fútbol, tecnología, animé: elige tu vicio.</figcaption></figure>

<p>En pocas palabras, mi experiencia en RRSS era miserable: rabia manufacturada, sordidez y deshumanización, manipulación de mis emociones e impulsos, pero todo vale la pena porque de vez en cuando un meme me hace reír a carcajadas, o tengo la oportunidad de vivir esa experiencia colectiva de ver nacer un meme, maravillarme con la creatividad de los otros al iterar sobre ese nuevo meme, ¡estar en esa sincronía donde todos estamos <em>hablando de lo mismo!</em> O en Reddit, puedo ver <em>en tiempo real</em> que ha habido algún avance en uno de mis hobbies, puedo enterarme el primer día que mi juego favorito está siendo decompilado, ver un nuevo trailer en el minuto que sale, técnicas novedosas para imprimir en 3D, ¡lo que sea!</p>

<p>Así que (para sorpresa sólo de los lectores más despistados) terminé cerrando Instagram. Y en realidad, inspirado en parte por <a href="http://www.aaronsw.com/weblog/hatethenews">este post de Aaron Swartz</a>, me desconecté de la actualidad. No quise cerrar Reddit porque participo de algunas comunidades que me interesan, pero sí desinstalé la App, y me volví loco curando la experiencia, bloqueando <a href="https://github.com/benja-opazo/ublock-politics">cientos de palabras</a> que pudiesen tener cualquier relación, incluso coyuntural, con la política y la actualidad. El <em>algoritmo</em> de Instagram pareciera ser que es incontrolable, y el de al menos Reddit puedo curarlo con mis bloqueos.</p>

<p>Querido lector, quizás se está espantando porque crea que yo soy una de esas personas que les gusta llamarse <em>apolíticos</em> o <a href="/centrismo/"><em>centristas</em></a>, pero no, todo lo contrario, entiendo que la política es parte integral de nuestras vidas, y todo acto, todo gesto, toda acción es esencialmente política… incluso este post. Pero ahora no quiero seguir permitiendo que lo ajeno a mi vida erosione mi espíritu. Si no me afecta o si no puedo hacer nada al respecto, no debería afectarme.</p>

<p>¡Y claro que es difícil! Esta postura es casi un <em>dejar ir</em> de esta ilusión del <em>imperativo moral</em> de mantenerse informados, de querer tener una opinión de si bombardear un niño en Medio Oriente o en el noreste de Europa es ético o no, bueno o malo, de mi equipo o del otro.</p>

<p>Y es esta acción, la de soltar <em>la actualidad</em>, la que me ha dado más tranquilidad y felicidad en muchos años. Esa bulla de malas emociones, de griteríos eternos, de sordideces en lo cotidiano ya no está: sólo queda la tranquilidad, el perderme en mis pensamientos y reflexiones, disfrutar una taza de café, o incluso, la espera de un ascensor sumido en mis pensamientos, y no dejar que una máquina, <em>el algoritmo</em>, decida si me subo a ese ascensor triste, feliz o enrabiado con la noticia del momento.</p>

<p>No quiero escuchar los murmullos de la <em>máquina</em>, quiero escuchar el verdadero presente, el que está ahí al frente mío, el que muchas veces trae más felicidad que tristeza, esperanza en vez de rabia, humanidad en vez de <em>algoritmos</em>.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:polola">
      <p>En Chile, polola o pololo es la pareja, la novia o el novio. <a href="#fnref:polola" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
    <li id="fn:ig">
      <p>Por ejemplo: <a href="https://www.instagram.com/p/DCe_qxlPKRs/">(1)</a>, <a href="https://www.instagram.com/p/C7ZVekrOmJa/">(2)</a>, <a href="https://www.instagram.com/p/C74dJOkPoXE/">(3)</a>, <a href="https://www.instagram.com/p/CvSrNsEOinv/">(4)</a>, <a href="https://www.instagram.com/p/C2l8vPTOSqw/">(5)</a>, <a href="https://www.instagram.com/p/DCjc5BvyIkK/">(6)</a>, <a href="https://www.instagram.com/p/DTa2DvAkqNl/">(7)</a>, <a href="https://www.instagram.com/p/DOY12dCDOsJ/">(8)</a>, <a href="https://www.instagram.com/p/DTp_wIpkbyZ/">(9)</a>. <a href="#fnref:ig" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Benjamín Opazo</name></author><category term="social media" /><category term="thoughts" /><summary type="html"><![CDATA[Después de aburrirme del algoritmo, decidí dejar ir las redes sociales.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/social-media-leaving/es_header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/social-media-leaving/es_header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="en"><title type="html">Social Media is ridiculously entertaining</title><link href="https://blog.benjaopazoc.cl/2026/09/social-media-is-ridiculously-entertaining/" rel="alternate" type="text/html" title="Social Media is ridiculously entertaining" /><published>2026-09-16T19:30:00+00:00</published><updated>2026-09-16T19:30:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/09/social-media-is-ridiculously-entertaining</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/09/social-media-is-ridiculously-entertaining/"><![CDATA[<p>A few months ago I decided to <em>let go</em> of Social Media… well not all of them… well only Instagram and part of Reddit. The idea had been cultivating itself for a good while, but there was a moment that made me hurl myself at the decision. Let me tell you about it, dear reader.</p>

<p>It was a slow Sunday morning, there was some war in the Middle East starting, I don’t remember which one. A war that honestly doesn’t affect me directly, except for the sadness and the rage it generates in me. I got out of bed, had an exquisite breakfast with my <em>polola</em><sup id="fnref:polola"><a href="#fn:polola" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>, and after that I went to the bathroom. During my <em>stay</em> in the bathroom I did what any social media addict does: start watching <em>Reels</em>. And so began the infinite scroll:</p>

<ol>
  <li>A comedian doing <em>Stand up Comedy</em>. Funny, it got a smile out of me.</li>
  <li>Some kittens being kittens. Cute, lots of serotonin.</li>
  <li>A missile falling on some poor person’s house in the Middle East. Literally, during the first 500ms you could see the missile falling, screams and people running. There wasn’t even time to <em>swipe</em>. This is as far as the infinite scroll got.</li>
</ol>

<figure class="article__figure figure-row"><img src="/assets/img/social-media-leaving/Humorista.png" alt="A comedian doing stand up comedy" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/GatitosYPerritos.png" alt="Kittens and puppies being cute" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/Bomba.png" alt="A missile falling on a house in the Middle East" loading="lazy" data-zoomable="" /></figure>

<blockquote>
  <p><strong>“Consume the horror, idiot human”</strong> was what <em>the algorithm</em> was telling me.</p>
</blockquote>

<p>In that prosaic stay, I decided that was enough social media for me, I don’t want <em>the machine</em> choosing how I should feel, even less so on that delicious Sunday morning, full of sun, exquisite food, good company, with little birds in the backyard and my beautiful animals accompanying me in that idyll.</p>

<figure class="article__figure figure-row"><img src="/assets/img/social-media-leaving/flor.jpg" alt="A hanging pink-and-purple flower in the backyard" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/gp.jpg" alt="A dog and a cat together in the sun in the backyard" loading="lazy" data-zoomable="" /><img src="/assets/img/social-media-leaving/p.jpg" alt="A cat sunbathing on a wooden table" loading="lazy" data-zoomable="" /></figure>

<p>Dear reader, perhaps you think that it is <strong>my</strong> <em>algorithm</em> and not <strong>the</strong> <em>algorithm</em> that is to blame, and by transitivity the one to blame is me, but that is not the case: For years I have been extremely careful curating my experience on social media. Perhaps on more than one occasion I made some friend uncomfortable at a less than appropriate moment by talking to them about the <em>algorithm</em> or about how advertising is made to control you and that everyone wants to sell you something.</p>

<p>And it is because I am aware of all the above that I have fought against the famous (or infamous?) <em>algorithm</em> almost obsessively, I have curated my experience on social media with great dedication: At the time of writing this, I have 1278 accounts blocked on Instagram (mainly to avoid advertising from the <em>big brands</em>), and believe me, dear reader, practically every day on half a dozen posts I would press the “not interested” button. But the unrealistically beautiful women, the furious politicians, the bombs in the Middle East, and even the nice influencers selling me garbage kept appearing. It was my own war against the <em>algorithm</em> and I was losing it in the beautiful backyard of my house (and in the WC), I would fill my mind with genocides instead of enjoying the little birds, breakfasts, and idyllic Sundays.</p>

<p>As if that weren’t enough, politics and rage are present at every moment. Everything has to enrage you, everything has to be political, to score points for your side (the good guys’ side of course), and to see how the other side ends up looking ridiculous, gets it wrong, or says something that infuriates. It is a game that keeps us always alert, connected, looking for something to be scandalized about this week (and only this week, next week there will be a new more important scandal!), to have an opinion and share it, or rather, to bellow it. Unfortunately current affairs are ephemeral, and it is not enough for me to have gotten angry today, last week, and all the weeks going back. No, I have to <em>update</em> the anger, the scandal, the horror with what is happening <em>right now! at this moment!</em></p>

<p>And if we’re talking about rage, Reddit takes the grand prize: politics gets into even the Subreddits <a href="https://www.reddit.com/r/pics/comments/1qlw39u/alex_pretti_the_man_murdered_today_by_ice_agents/">that</a> <a href="https://www.reddit.com/r/MadeMeSmile/comments/1ulkrii/great_to_see_heroes_being_honoured/">one</a> <a href="https://www.reddit.com/r/wholesomememes/comments/1sqs2go/flipped_this_one_around_p/">would</a> <a href="https://www.reddit.com/r/dataisbeautiful/comments/1ok0ps1/government_shutdowns_in_the_us_oc/">never</a> <a href="https://www.reddit.com/r/interestingasfuck/comments/1pn8jnh/the_hero_awake_and_recovering_in_the_hospital/">imagine</a>.  It would seem that many people think it is a moral imperative to get politics into every existing conversation. But I, for one, don’t agree with that, taking part in the internet, sharing a hobby, or wanting to see photos of cute kittens does not amount to taking part in politics and current affairs.</p>

<p>But the problem is that social media is <em>very entertaining</em>. Ridiculously entertaining. It’s wonderful, that feeling when you watch 4 or 5 <em>shorts</em> in a row and you end up crying with laughter<sup id="fnref:ig"><a href="#fn:ig" class="footnote" rel="footnote" role="doc-noteref">2</a></sup>. It’s a little less wonderful, that feeling when you <em>swipe</em> to see the sixth short and some person’s house in the Middle East appears being bombed. And it would seem there’s nothing that can be done about it! It’s a notably sordid experience, and apparently we will have to resign ourselves to this way of living our lives: we laugh with our favorite influencer, then we cry watching the story of an abandoned kitten, we rage at some local politician, we watch wars and genocides in real time, and oh! I have to get off at the next station, I put my phone in my pocket and carry on with life. Not without first thanking our sponsors, the most entertaining betting house!</p>

<p>The <em>algorithm</em> is notably perverse. I remember being surprised once when I opened a new account on Instagram and got to see how a fresh algorithm worked for a heterosexual man:</p>

<figure class="article__figure"><img src="/assets/img/social-media-leaving/insta_feed.jpg" alt="Screenshot of Instagram&#39;s Explore tab: women, football, technology and anime" loading="lazy" data-zoomable="" /><figcaption class="article__caption" lang="en">Women, football, technology, anime: choose your vice.</figcaption></figure>

<p>In short, my experience on social media was miserable: manufactured rage, sordidness and dehumanization, manipulation of my emotions and impulses, but it’s all worth it because every now and then a meme makes me laugh my head off, or I get the chance to live that collective experience of watching a meme be born, to marvel at the creativity of others as they iterate on that new meme, to be in that synchrony where we are all <em>talking about the same thing!</em> Or on Reddit, I can see <em>in real time</em> that there has been some development in one of my hobbies, I can find out on the first day that my favorite game is being decompiled, see a new trailer the minute it comes out, new techniques for 3D printing, anything at all!</p>

<p>So (to the surprise only of the most clueless readers) I ended up closing Instagram. And actually, inspired in part by <a href="http://www.aaronsw.com/weblog/hatethenews">this post by Aaron Swartz</a>, I disconnected from current affairs. I didn’t want to close Reddit because I take part in some communities that interest me, but I did uninstall the App, and I went crazy curating the experience, blocking <a href="https://github.com/benja-opazo/ublock-politics">hundreds of words</a> that might have any relation, even a circumstantial one, to politics and current affairs. Instagram’s <em>algorithm</em> would seem to be uncontrollable, and Reddit’s at least, I can curate with my blocks.</p>

<p>Dear reader, perhaps you are recoiling because you may believe that I am one of those people who like to call themselves <em>apolitical</em> or <a href="/centrism/"><em>centrists</em></a>, but no, quite the opposite, I understand that politics is an integral part of our lives, and every act, every gesture, every action is essentially political… even this post. But now I don’t want to go on letting that which is foreign to my life erode my spirit. If it doesn’t affect me or if I can’t do anything about it, it shouldn’t affect me.</p>

<p>And of course it’s difficult! This stance is almost a <em>letting go</em> of this illusion of the <em>moral imperative</em> of staying informed, of wanting to have an opinion on whether bombing a child in the Middle East or in the northeast of Europe is ethical or not, good or bad, my team’s or the other team’s.</p>

<p>And it is this action, that of letting go of <em>current affairs</em>, that has given me the most tranquility and happiness in many years. That racket of bad emotions, of eternal shouting, of sordidness in the everyday is gone now: all that remains is the tranquility, the losing myself in my thoughts and reflections, enjoying a cup of coffee, or even, the wait for an elevator, sunk in my thoughts, and not letting a machine, <em>the algorithm</em>, decide if I get into that elevator sad, happy or enraged by the news of the moment.</p>

<p>I don’t want to listen to the murmurs of the <em>machine</em>, I want to listen to the true present, the one that is there in front of me, the one that so often brings more happiness than sadness, hope instead of rage, humanity instead of <em>algorithms</em>.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:polola">
      <p>In Chile, polola or pololo is one’s partner, girlfriend or boyfriend. <a href="#fnref:polola" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
    <li id="fn:ig">
      <p>For example: <a href="https://www.instagram.com/p/DCe_qxlPKRs/">(1)</a>, <a href="https://www.instagram.com/p/C7ZVekrOmJa/">(2)</a>, <a href="https://www.instagram.com/p/C74dJOkPoXE/">(3)</a>, <a href="https://www.instagram.com/p/CvSrNsEOinv/">(4)</a>, <a href="https://www.instagram.com/p/C2l8vPTOSqw/">(5)</a>, <a href="https://www.instagram.com/p/DCjc5BvyIkK/">(6)</a>, <a href="https://www.instagram.com/p/DTa2DvAkqNl/">(7)</a>, <a href="https://www.instagram.com/p/DOY12dCDOsJ/">(8)</a>, <a href="https://www.instagram.com/p/DTp_wIpkbyZ/">(9)</a>. <a href="#fnref:ig" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Benjamín Opazo</name></author><category term="social media" /><category term="thoughts" /><summary type="html"><![CDATA[After getting bored of the algorithm, I decided to let go of social media.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/social-media-leaving/en_header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/social-media-leaving/en_header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="en"><title type="html">Defaults that disappear</title><link href="https://blog.benjaopazoc.cl/2026/09/defaults-that-disappear/" rel="alternate" type="text/html" title="Defaults that disappear" /><published>2026-09-04T19:30:00+00:00</published><updated>2026-09-04T19:30:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/09/defaults-that-disappear</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/09/defaults-that-disappear/"><![CDATA[<p>Picture the following: It is 8 AM, you have a fresh mind after a well-slept night, you have all the energy to begin this new project you have in your hands, but first you need to understand the data you are going to be working with. Perhaps they are the responses to a survey, a mixture of numerical data and responses in prose… a long prose.</p>

<p>But fate has another plan for you, and it is that your table <em>explodes</em> with the data it has, and you find yourself with a <strong>wall of text</strong> before your eyes. Your plan to work immediately was ruined. Now, in order to do your job, which is to understand this data, you first have to have a pitched battle with the Software in front of you.</p>

<figure class="article__figure"><img src="/assets/img/tabula-rasa-defaults/en_lo_wall.png" alt="LibreOffice Calc in its light theme with &#39;en_survey.csv&#39; open, scrolled across to the free-text columns q5, q6 and q7. Every column sits at the same default width, so a long answer can only grow downwards: rows 4 and 10 have swollen into blocks some fifteen lines deep while rows 1 to 3 and 5 to 9 stay a single line each, and every one of those lines is cut off flat at the column border, mid-sentence. The neighbouring columns are blank for the whole height of the two tall rows, leaving broad empty gaps down the page." loading="lazy" data-zoomable="" /><figcaption class="article__caption" lang="en">A Wall of Text and your morning is ruined</figcaption></figure>

<p>I think perhaps I exaggerated with pitched battle, because the reality is another, it is a <em>Sisyphean</em> labor. Why? you will be wondering. Well, because you are opening a <code class="language-plaintext highlighter-rouge">csv</code> file, and your favorite Software takes that file and shows it to you without formatting, perhaps to punish you and to take you back to a proprietary format like <code class="language-plaintext highlighter-rouge">xlsx</code> or <code class="language-plaintext highlighter-rouge">numbers</code>. Opening that file without formatting, with walls of text, without persistent headers, and even with ugly lettering, is a <strong>product decision</strong>: you are doing something that the executives at Microsoft, at Apple or at Google do not find to be right.</p>

<p>Then, you naturally begin to use a proprietary format of theirs, you add formatting to your table, you add colors, you freeze the header row, and it is not until 8:30 AM that you can really immerse yourself in your data. Unfortunately the system that generates the report for you delivers it as a <code class="language-plaintext highlighter-rouge">csv</code> every time. So, like a good <em>Sisyphus</em>, you reformat your data every time you generate a new report.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> avoids all of that, and goes further. It opens <code class="language-plaintext highlighter-rouge">csv</code>s and adds friendly formatting to them <strong>by default</strong> so that you can immediately get to work. If you don’t like the formatting, you change it, and the Software will remember the next time you open the file. In this article we are going to look at a couple of examples of how Tabula Rasa accompanies you on your journey through the data.</p>

<h2 id="defaults-that-disappear">Defaults that disappear</h2>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> tries to help you when you work with data, and in particular, it seeks for your data to be <em>there</em>. The value of a datum is found in its context, and Tabula Rasa does what it can to be able to deliver that context to the user: we seek to find a healthy balance between how much data and how much context we want to show the user.</p>

<p>It is because of the above that we seek for the application’s default values to <em>disappear</em>, for the user not to realize why <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> works, but for it to somehow always be easy to use. A difficult problem to solve is that nobody is a “little gold coin”<sup id="fnref:goldcoin"><a href="#fn:goldcoin" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>, but our friend Pareto comes to our aid, the goal is that ~80% of users feel comfortable with the default values, but, and perhaps more fundamentally, that the other ~20% can modify the interface to their taste, flexibly and <strong>intuitively</strong>.</p>

<p>Fundamentally, the problem we face is that the data is very diverse (that is why we are austere and only seek to accommodate the ~80%), and for that same reason, we do not seek to adapt the data to <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, but rather that <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> adapt to the data. And in general we have three knobs to achieve this: Truncations, Column Width and Row Height. With those three knobs we have an enormous freedom to accommodate the data and for it never to lose its context.</p>

<h3 id="truncations">Truncations</h3>

<p>Truncations were the simplest to model.</p>

<p>We could say that in a table two types of data are handled: texts and numbers, and these must be truncated differently. If you see <code class="language-plaintext highlighter-rouge">"832..."</code>, What can you conclude from that number? Practically nothing, you don’t know whether it is <code class="language-plaintext highlighter-rouge">832.3</code>, <code class="language-plaintext highlighter-rouge">832000</code>, <code class="language-plaintext highlighter-rouge">832 trillion</code>, or an infinity etc. But on the other hand if you see <code class="language-plaintext highlighter-rouge">"Tabula Rasa is..."</code> you immediately know that the sentence ends <code class="language-plaintext highlighter-rouge">"...The best data visualization Software that exists."</code>… Ok maybe you don’t think that, but clearly the amount of context that is lost when truncating a text is different from truncating a number, what is more, I argue that a truncated number is <em>useless</em>, whereas a truncated text is not. For that reason, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> never truncates a number, it only approximates it, it shows you <code class="language-plaintext highlighter-rouge">~8320</code> instead of truncating it, and when it can’t show you a coarse approximation, it shows you a <code class="language-plaintext highlighter-rouge">###</code>.</p>

<figure class="article__figure article__figure--media">
  <video src="/assets/video/tabula-rasa-defaults/tr_number-truncate.mp4" aria-label="A two-column file, &#39;datos.csv&#39;, open in Tabula Rasa with a single row, while the divider between the columns is dragged steadily to the left to squeeze the numbers. They give way in stages rather than being cut: &#39;832,001.5&#39; and &#39;8,326,659,876,531.5&#39; first drop their thousands separators to &#39;832001.5&#39; and &#39;8326659876531.5&#39;; then the first is rounded to &#39;832002&#39; and a small orange approximation mark appears in its column header to declare it; and only when no room is left at all does the second collapse to &#39;###&#39;. The width control in the toolbar flips from &#39;auto&#39; to &#39;mixed&#39; as the drag begins. At no point is a number shown with its digits simply chopped off." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en">Different modes of truncating a number</figcaption></figure>

<p>In the previous example one observes how <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> does a <em>graceful degradation</em> of how it shows numbers when space is lacking. First it tries to compact it visually, then it approximates it, and finally, the application hides it. The important thing is that at no point is there ambiguity about what the number represents. In the last case, when the number is hidden, you can always hover the mouse over it and wait for the <em>tooltip</em> to do its thing.</p>

<h3 id="cell-width-and-height">Cell Width and Height</h3>

<p>Dear reader, if you think we are going to get into the whole <em>lattice</em> of algorithms for calculating the cell Width and Height that <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> uses, I have good news and bad news for you. The bad news is that we will not be seeing that today. The good news is that you will be able to read about it in a future post.</p>

<p>In a table, and in my experience, the value of a datum <strong>is in its context</strong>, and for that same reason, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> is going to fight if necessary even with the data itself in order to manage to show it in its context. Hence, I devoted a large amount of energy to the algorithm for calculating cell Width and Height that would allow a large amount of data to be accommodated without losing its context, and consequently for that data to be useful, not a deformed wall of text. Look at the following images, click, and see the difference:</p>

<figure class="article__figure carousel" data-carousel="" aria-roledescription="carousel" aria-label="Video carousel" data-i18n-label-en="Video carousel" data-i18n-label-es="Carrusel de videos">
  <div class="carousel__viewport">
    <ul class="carousel__track" data-carousel-track=""><li class="carousel__slide" role="group" aria-roledescription="slide" aria-label="1 / 3"><video src="/assets/video/tabula-rasa-defaults/en_tr-lo_wall.mp4" aria-label="The same survey file scrolled from end to end twice over: first in Tabula Rasa, where the columns have already taken the width their contents need and every row keeps to about three lines, and then in LibreOffice Calc, where the identical file arrives at one uniform column width and the long answers blow their rows open into empty vertical chasms" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><p class="carousel__slide-caption article__caption" lang="en">Tabula Rasa, then LibreOffice</p></li><li class="carousel__slide" role="group" aria-roledescription="slide" aria-label="2 / 3"><video src="/assets/video/tabula-rasa-defaults/en_tr_wall.mp4" aria-label="Tabula Rasa scrolling right across all eighteen columns of the survey. Each column has taken the width its content needs — narrow for id and age, wide for the free-text answers. Figures are right-aligned with thousands separators, from 73 up to 2,413,800,000, and no answer runs past about three lines before ending in an ellipsis. The row numbers stay pinned at the left edge and the column headers stay legible all the way across, so no row is ever orphaned from its identity" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><p class="carousel__slide-caption article__caption" lang="en">Tabula Rasa</p></li><li class="carousel__slide" role="group" aria-roledescription="slide" aria-label="3 / 3"><video src="/assets/video/tabula-rasa-defaults/en_lo_wall.mp4" aria-label="LibreOffice Calc scrolling right across the same file. Every column is the same default width whatever it holds, so the two thousand-word answers force their rows open to fill the window while the single-line rows stay pressed together, and the text in every long cell is cut flat at the column border. Past the last column of data the sheet runs on into empty lettered columns" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><p class="carousel__slide-caption article__caption" lang="en">LibreOffice</p></li></ul>

    <button type="button" class="carousel__btn carousel__btn--prev" data-carousel-prev="" aria-label="Previous video" data-i18n-label-en="Previous video" data-i18n-label-es="Video anterior">
      <svg viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6" /></svg>
    </button>
    <button type="button" class="carousel__btn carousel__btn--next" data-carousel-next="" aria-label="Next video" data-i18n-label-en="Next video" data-i18n-label-es="Video siguiente">
      <svg viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6" /></svg>
    </button>
  </div><p class="carousel__counter" data-carousel-counter="" aria-hidden="true">
    <span data-carousel-index="">1</span> / 3
  </p><figcaption class="article__caption" lang="en">Comparison between Tabula Rasa and LibreOffice. Fictitious data</figcaption></figure>

<p>In the previous image you can see <a href="/assets/files/tabula-rasa-defaults/en_survey.csv">this</a> <code class="language-plaintext highlighter-rouge">csv</code>, displayed in <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> and LibreOffice, just as it looks when you open the respective applications. Do you need more arguments to switch? Don’t worry, I will give them to you. Note that I generated the table automatically with an LLM, with a couple of completely plausible instructions: that the length of the responses be heterogeneous (some long, some short).</p>

<p>My idea is not to speak ill of LibreOffice, a piece of Open Source Software, which has done quite a bit for the community, but I believe the comparison shows the strength of <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> immediately: <strong>the data can be seen</strong>, the information density is superior, and there are no walls of text.</p>

<p>To achieve the above, the algorithm uses some very useful heuristics</p>

<ol>
  <li>Column widths depend on what they contain</li>
  <li>No Column can be wider than a certain percentage of the screen.</li>
  <li>Columns negotiate their width with the other columns. If there is space available, a column can be wider than <em>normal</em></li>
  <li>The ratio between width and height cannot exceed a certain threshold.</li>
</ol>

<p>With those 4 heuristics, you can observe how efficient the representation of the data in the table is.</p>

<p>With the first heuristic the Software makes sure that a column <em>measures up</em> to showing the data, if column widths depend on what they contain, we never give a column extra space, conversely, if the column has narrow data, then it is going to take up little space. Heuristic 2 ensures something like the opposite of heuristic 1, since if the text is very long, we don’t want it to <em>eat</em> the whole screen. Heuristic 3 adds a very important factor, since it can happen (and it does happen) that the table consists of many thin columns, and one very wide column, and there it makes no sense to limit the width of a large column <strong>if there is still space left</strong>.</p>

<p>Heuristic number 4 we are going to discuss in more detail in the algorithm post, since it does not have to do with the default values, that is, the calculation the application makes when opening a file, but rather it has to do with how the application calculates the height/width ratio when the user clicks on <em>fit to data</em>, but I can tell you in advance that it seeks to avoid a cell consuming a lot of vertical space if the data it has is very long.</p>

<p>Which brings us back to the truncation of data. By default, if the data does not fit in a height of 3 (equivalent to 3 rows of height <em>1</em>), then the text is truncated, as can be observed in the following figure</p>

<figure class="article__figure article__figure--media">
  <video src="/assets/video/tabula-rasa-defaults/en_tr_text-truncate.mp4" aria-label="A column of long survey answers in Tabula Rasa, each cut to three lines ending in an ellipsis so that every row keeps the same modest height. The pointer settles on one cell: it lights up in teal with a small cyan dot at its corner, and a tooltip opens over the rows beneath it carrying that answer in full. Then the column is widened and the same answers re-flow — still three lines each, but with more of every sentence visible." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="en">Truncations and Tooltip in Tabula Rasa. Fictitious data</figcaption></figure>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> has dozens of other defaults that disappear, or behaviors that <em>anticipate</em> your intentionality (<a href="https://blog.master.dev/tooltips-need-a-delay-and-then-they-need-to-skip-it/">tooltips with hysteresis</a>, absorption of <code class="language-plaintext highlighter-rouge">NULL</code> values, or a smart “Word Wrap”). We are not going to explore them all, since I imagine you will end up getting bored, but once more I invite you to visit <a href="https://tabularasa.cl">tabularasa.cl</a>, download the application and marvel at the <strong>defaults that disappear</strong>.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:goldcoin">
      <p>To Be a Little Gold Coin: said of a person or thing that <em>everybody likes</em>, that is agreeable. Like a gold coin, who wouldn’t want to find one? <a href="#fnref:goldcoin" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Benjamín Opazo</name></author><category term="Tabula Rasa" /><summary type="html"><![CDATA[A discussion of Tabula Rasa's ethos regarding the app's default values]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-defaults/header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-defaults/header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="es"><title type="html">Defectos que desaparecen</title><link href="https://blog.benjaopazoc.cl/2026/09/defectos-que-desaparecen/" rel="alternate" type="text/html" title="Defectos que desaparecen" /><published>2026-09-04T19:30:00+00:00</published><updated>2026-09-04T19:30:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/09/defectos-que-desaparecen</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/09/defectos-que-desaparecen/"><![CDATA[<p>Imagínese lo siguiente: Son las 8 AM, tiene la mente fresca después de una noche bien dormida, tiene todas las energías para empezar este nuevo proyecto que tiene entre sus manos, pero primero necesita entender los datos con los que va a estar trabajando. Quizás son las respuestas de una encuesta, una mezcla de datos numéricos y respuestas en prosa… una larga prosa.</p>

<p>Pero el destino tiene otro plan para usted y es que su tabla <em>explota</em> con los datos que tiene, y se encuentra con una <strong>muralla de texto</strong> frente a sus ojos. Su plan de trabajar inmediatamente se arruinó. Ahora, para poder hacer su trabajo, que es entender estos datos, primero tiene que tener una batalla campal con el Software que tiene al frente.</p>

<figure class="article__figure"><img src="/assets/img/tabula-rasa-defaults/es_lo_wall.png" alt="LibreOffice Calc en su tema claro con &#39;encuesta-tabula-rasa.csv&#39; abierto, desplazado hasta las columnas de texto libre p5, p6 y p7. Todas las columnas conservan el mismo ancho por defecto, así que una respuesta larga solo puede crecer hacia abajo: las filas 4 y 10 se han hinchado en bloques de unas quince líneas mientras las filas 1 a 3 y 5 a 9 se quedan en una sola cada una, y cada una de esas líneas queda cortada en seco en el borde de la columna, a media frase. Las columnas vecinas quedan en blanco a lo largo de toda la altura de las dos filas altas, dejando huecos vacíos enormes en la página." loading="lazy" data-zoomable="" /><figcaption class="article__caption" lang="es">Una Muralla de Texto y su mañana se arruina</figcaption></figure>

<p>Creo que tal vez exageré con batalla campal, porque la realidad es otra, es una labor <em>sisifesca</em>. ¿Por qué? se preguntará. Bueno, pues porque usted está abriendo un archivo <code class="language-plaintext highlighter-rouge">csv</code>, y su Software favorito toma ese archivo y se lo muestra sin formato, quizás para castigarlo y para llevarlo de vuelta a un formato propietario como <code class="language-plaintext highlighter-rouge">xlsx</code> o <code class="language-plaintext highlighter-rouge">numbers</code>. Abrir ese archivo sin formato, con murallas de texto, sin encabezados persistentes, e incluso con letra fea, es una <strong>decisión de producto</strong>: usted está haciendo algo que los ejecutivos de Microsoft, de Apple o de Google no encuentran que sea correcto.</p>

<p>Luego, usted naturalmente empieza a usar un formato propietario de ellos, le agrega formato a su tabla, le agrega colores, congela la fila del encabezado, y recién a las 8:30 AM puede usted realmente sumergirse en sus datos. Lamentablemente el sistema que le genera el reporte se los entrega como <code class="language-plaintext highlighter-rouge">csv</code> cada vez. Así que como buen <em>Sísifo</em>, usted reformatea sus datos cada vez que genera un nuevo reporte.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> evita todo eso, y va más allá. Abre <code class="language-plaintext highlighter-rouge">csv</code>s y les agrega un formato amigable <strong>por defecto</strong> para que pueda inmediatamente ponerse a trabajar. Si no le gusta el formato, lo cambia, y el Software va a acordarse la próxima vez que abra el archivo. En este artículo vamos a ver un par de ejemplos de cómo Tabula Rasa lo acompaña en su viaje por los datos.</p>

<h2 id="los-defectos-que-desaparecen">Los defectos que desaparecen<sup id="fnref:defectos"><a href="#fn:defectos" class="footnote" rel="footnote" role="doc-noteref">1</a></sup></h2>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> intenta ayudarlo cuando usted trabaja con los datos, y particularmente, busca que sus datos estén <em>ahí</em>. El valor de un dato se encuentra en su contexto, y Tabula Rasa hace lo posible para poder entregarle ese contexto al usuario: buscamos encontrar un sano equilibrio entre cuántos datos y cuánto contexto queremos mostrarle al usuario.</p>

<p>Es por lo anterior, que buscamos que los valores por defecto de la aplicación <em>desaparezcan</em>, que el usuario no se dé cuenta por qué funciona <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, pero que por alguna razón siempre es fácil usarla. Un problema difícil de resolver es que nadie es “monedita de oro”<sup id="fnref:monedita"><a href="#fn:monedita" class="footnote" rel="footnote" role="doc-noteref">2</a></sup>, pero nuestro amigo Pareto viene en nuestra ayuda, el objetivo es que el ~80% de los usuarios se sientan cómodos con los valores por defecto, pero, y quizás mas fundamentalmente, que el otro ~20% pueda modificar la interfaz a su gusto, de forma flexible e <strong>intuitiva</strong>.</p>

<p>Fundamentalmente, el problema al que nos enfrentamos es que los datos son muy diversos (por eso somos austeros y solo buscamos acomodar al ~80%), y por lo mismo, no buscamos adaptar los datos a <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, si no que Tabula Rasa se adapte a los datos. Y en general tenemos tres perillas para lograr esto: Truncaciones, Ancho de Columna y Alto de Fila. Con esas tres perillas tenemos una libertad enorme para acomodar los datos y que nunca pierdan su contexto.</p>

<h3 id="truncaciones">Truncaciones</h3>

<p>Las truncaciones fueron las más simples de modelar.</p>

<p>Podríamos decir que en una tabla se manejan dos tipos de datos: textos y números, y estos deben ser truncados de forma diferente. Si usted ve <code class="language-plaintext highlighter-rouge">"832..."</code>, ¿Qué puede concluir de ese número? Prácticamente nada, no sabe si es <code class="language-plaintext highlighter-rouge">832.3</code>, <code class="language-plaintext highlighter-rouge">832000</code>, <code class="language-plaintext highlighter-rouge">832 trillones</code>, o un infinito etc. Pero por otra parte si usted ve <code class="language-plaintext highlighter-rouge">"Tabula Rasa es..."</code> inmediatamente sabe que la frase termina <code class="language-plaintext highlighter-rouge">"...El mejor Software de visualización de datos que existe."</code>… Ok tal vez no lo piense, pero claramente la cantidad de contexto que se pierde al truncar un texto es diferente al truncar un número, más aún, yo argumento que un número truncado es <em>inútil</em>, mientras que un texto truncado no lo es. Por lo mismo, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> nunca trunca un número, solo lo aproxima, le muestra <code class="language-plaintext highlighter-rouge">~8320</code> en vez de truncarlo, y cuando no puede mostrarle una aproximación gruesa, le muestra un <code class="language-plaintext highlighter-rouge">###</code>.</p>

<figure class="article__figure article__figure--media">
  <video src="/assets/video/tabula-rasa-defaults/tr_number-truncate.mp4" aria-label="Un archivo de dos columnas, &#39;datos.csv&#39;, abierto en Tabula Rasa con una sola fila, mientras se arrastra hacia la izquierda el divisor entre las columnas para ir apretando los números. Estos ceden por etapas en vez de ser cortados: &#39;832,001.5&#39; y &#39;8,326,659,876,531.5&#39; primero sueltan sus separadores de miles y quedan en &#39;832001.5&#39; y &#39;8326659876531.5&#39;; luego el primero se redondea a &#39;832002&#39; y aparece una pequeña marca naranja de aproximación en su encabezado para declararlo; y solo cuando ya no queda espacio alguno el segundo colapsa en &#39;###&#39;. El control de ancho de la barra de herramientas pasa de &#39;auto&#39; a &#39;mixed&#39; al empezar el arrastre. En ningún momento se muestra un número con sus dígitos simplemente cercenados." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es">Diferentes modos de truncar un número</figcaption></figure>

<p>En el ejemplo anterior se observa cómo <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> hace una <em>degradación elegante</em> de cómo muestra los números cuando falta espacio. Primero intenta compactarlo visualmente, después lo aproxima, y finalmente, la aplicación lo oculta. Lo importante es que en ningún momento hay ambigüedad de qué es lo que representa el número. En el último caso, cuando el número está oculto, siempre se puede hacer pasar el mouse encima y esperar a que el <em>tooltip</em> haga lo suyo.</p>

<h3 id="ancho-y-alto-de-celda">Ancho y Alto de celda</h3>

<p>Querido lector, si usted piensa que nos vamos a meter en todo el <em>entramado</em> de algoritmos para calcular el Ancho y Alto de celda que usa <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>, le tengo una buena y una mala noticia. La mala noticia es que eso no lo veremos hoy. La buena noticia es que podrá leerlo en un post futuro.</p>

<p>En una tabla, y en mi experiencia, el valor de un dato <strong>está en su contexto</strong>, y por lo mismo, <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> va a luchar si es necesario hasta con los mismos datos para lograr mostrarlos en su contexto. De ahí, que dediqué una gran cantidad de energía al algoritmo de cálculo de Ancho y Alto de celda que permitiese acomodar una gran cantidad de datos sin perder su contexto, y en consecuencia que sean útiles, no una muralla de texto deforme. Mire las siguientes imágenes, haga click, y vea la diferencia:</p>

<figure class="article__figure carousel" data-carousel="" aria-roledescription="carousel" aria-label="Video carousel" data-i18n-label-en="Video carousel" data-i18n-label-es="Carrusel de videos">
  <div class="carousel__viewport">
    <ul class="carousel__track" data-carousel-track=""><li class="carousel__slide" role="group" aria-roledescription="slide" aria-label="1 / 3"><video src="/assets/video/tabula-rasa-defaults/es_tr-lo_wall.mp4" aria-label="El mismo archivo de la encuesta recorrido de punta a punta dos veces: primero en Tabula Rasa, donde las columnas ya tomaron el ancho que su contenido necesita y cada fila se mantiene en unas tres líneas, y después en LibreOffice Calc, donde el archivo idéntico llega con un único ancho de columna uniforme y las respuestas largas revientan sus filas en abismos verticales vacíos" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><p class="carousel__slide-caption article__caption" lang="es">Tabula Rasa, después LibreOffice</p></li><li class="carousel__slide" role="group" aria-roledescription="slide" aria-label="2 / 3"><video src="/assets/video/tabula-rasa-defaults/es_tr_wall.mp4" aria-label="Tabula Rasa recorriendo hacia la derecha las dieciocho columnas de la encuesta. Cada columna tomó el ancho que su contenido necesita — angosta para id y edad, ancha para las respuestas de texto libre. Las cifras van alineadas a la derecha con separadores de miles, desde 73 hasta 2,413,800,000, y ninguna respuesta pasa de unas tres líneas antes de terminar en puntos suspensivos. Los números de fila quedan fijos en el borde izquierdo y los encabezados de columna siguen legibles a lo largo de todo el recorrido, así que ninguna fila queda nunca huérfana de su identidad" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><p class="carousel__slide-caption article__caption" lang="es">Tabula Rasa</p></li><li class="carousel__slide" role="group" aria-roledescription="slide" aria-label="3 / 3"><video src="/assets/video/tabula-rasa-defaults/es_lo_wall.mp4" aria-label="LibreOffice Calc recorriendo hacia la derecha el mismo archivo. Todas las columnas tienen el mismo ancho por defecto sin importar lo que contengan, así que las dos respuestas de mil palabras fuerzan sus filas hasta llenar la ventana mientras las filas de una línea quedan apretadas entre ellas, y el texto de cada celda larga queda cortado en seco en el borde de la columna. Pasada la última columna con datos, la planilla sigue hacia columnas vacías rotuladas con letras" loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><p class="carousel__slide-caption article__caption" lang="es">LibreOffice</p></li></ul>

    <button type="button" class="carousel__btn carousel__btn--prev" data-carousel-prev="" aria-label="Previous video" data-i18n-label-en="Previous video" data-i18n-label-es="Video anterior">
      <svg viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6" /></svg>
    </button>
    <button type="button" class="carousel__btn carousel__btn--next" data-carousel-next="" aria-label="Next video" data-i18n-label-en="Next video" data-i18n-label-es="Video siguiente">
      <svg viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6" /></svg>
    </button>
  </div><p class="carousel__counter" data-carousel-counter="" aria-hidden="true">
    <span data-carousel-index="">1</span> / 3
  </p><figcaption class="article__caption" lang="es">Comparación entre Tabula Rasa y LibreOffice. Datos ficticios</figcaption></figure>

<p>En la imagen anterior usted puede ver <a href="/assets/files/tabula-rasa-defaults/es_survey.csv">este</a> <code class="language-plaintext highlighter-rouge">csv</code>, desplegado en <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> y LibreOffice, tal y como se ve al abrir las respectivas aplicaciones. ¿Necesita más argumentos para cambiarse? No se preocupe, se los daré. Note que la tabla la generé automáticamente con una LLM, con un par de instrucciones completamente plausibles: que el largo de las respuestas fuese heterogéneo (algunas largas, otras cortas).</p>

<p>Mi idea no es hablar mal de LibreOffice, un Software Open Source, que ha hecho bastante por la comunidad, pero creo que la comparación muestra la fortaleza de <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> inmediatamente: <strong>los datos se pueden ver</strong>, la densidad de información es superior, y no hay murallas de texto.</p>

<p>Para lograr lo anterior, el algoritmo usa algunas heurísticas muy útiles</p>

<ol>
  <li>Los anchos de columna dependen de lo que contienen</li>
  <li>Ninguna Columna puede ser más ancha que cierto porcentaje de la pantalla.</li>
  <li>Las columnas negocian su ancho con las otras columnas. Si hay espacio disponible, una columna puede ser más ancha que lo <em>normal</em></li>
  <li>La relación entre ancho y alto no puede superar cierto umbral.</li>
</ol>

<p>Con esas 4 heurísticas, usted puede observar lo eficiente de la representación de los datos en la tabla.</p>

<p>Con la primera heurística el Software se asegura que una columna <em>dé el ancho</em> suficiente para mostrar los datos, si los anchos de columna dependen de lo que contienen, nunca le damos espacio extra a una columna, en caso contrario, si la columna tiene datos angostos, entonces va a ocupar poco espacio. La heurística 2 asegura algo así como lo contrario a la heurística 1, pues si el texto es muy largo, no queremos que se <em>coma</em> toda la pantalla. La heurística 3 agrega un factor muy importante, pues puede ocurrir (y ocurre) que la tabla consista de muchas columnas delgadas, y una columna muy ancha, y ahí no tiene sentido limitar el ancho de una columna grande <strong>si aún queda espacio</strong>.</p>

<p>La heurística número 4 vamos a discutirla con más detalle en el post del algoritmo, pues no tiene que ver con los valores por defecto, es decir, el cálculo que hace la aplicación al abrir un archivo, si no que tiene que ver con cómo la aplicación calcula la relación alto/ancho cuando el usuario hace click en <em>ajustar a los datos</em>, pero le puedo adelantar que busca evitar que una celda consuma mucho espacio vertical si los datos que tiene son muy largos.</p>

<p>Lo que nos trae de vuelta a la truncación de datos. Por defecto, si los datos no caben en un alto de 3 (equivalente a 3 filas de alto <em>1</em>), entonces se trunca el texto, como se puede observar en la siguiente figura</p>

<figure class="article__figure article__figure--media">
  <video src="/assets/video/tabula-rasa-defaults/es_tr_text-truncate.mp4" aria-label="Una columna de respuestas largas de la encuesta en Tabula Rasa, cada una cortada a tres líneas que terminan en puntos suspensivos para que todas las filas conserven la misma altura discreta. El puntero se posa sobre una celda: esta se ilumina en verde azulado con un punto cian pequeño en su esquina, y se abre un tooltip sobre las filas de abajo con esa respuesta completa. Después se ensancha la columna y las mismas respuestas se reacomodan — siguen siendo tres líneas cada una, pero se ve más de cada frase." loop="" muted="" playsinline="" controls="" preload="metadata" data-zoomable="" data-video-figure=""></video><figcaption class="article__caption" lang="es">Truncaciones y Tooltip en Tabula Rasa. Datos ficticios</figcaption></figure>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> tiene decenas de otros valores por defecto que desaparecen, o de comportamientos que se <em>adelantan</em> a su intencionalidad (<a href="https://blog.master.dev/tooltips-need-a-delay-and-then-they-need-to-skip-it/">tooltips con histéresis</a>, absorción de valores <code class="language-plaintext highlighter-rouge">NULL</code>s, o un “Word Wrap” inteligente). No los vamos a explorar todos, pues me imagino que usted terminará aburriéndose, pero una vez más lo invito a visitar <a href="https://tabularasa.cl">tabularasa.cl</a>, descargar la aplicación y maravillarse con los <strong>defectos que desaparecen</strong>.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:defectos">
      <p>Siéntase afortunado de leer esto en Español, porque este juego de palabras se lo van a perder los gringos <a href="#fnref:defectos" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
    <li id="fn:monedita">
      <p>Ser Monedita de Oro: Se dice de una persona o cosa que le <em>cae bien a todos</em>, que es conveniente. Como una moneda de oro ¿A quién no le gustaría encontrarse una? <a href="#fnref:monedita" class="reversefootnote" role="doc-backlink">↑</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Benjamín Opazo</name></author><category term="Tabula Rasa" /><summary type="html"><![CDATA[Discusión del ethos de Tabula Rasa respecto a los valores por defecto de la app]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-defaults/header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-defaults/header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="es"><title type="html">El origen de Tabula Rasa</title><link href="https://blog.benjaopazoc.cl/2026/08/el-origen-de-tabula-rasa/" rel="alternate" type="text/html" title="El origen de Tabula Rasa" /><published>2026-08-26T19:30:00+00:00</published><updated>2026-08-26T19:30:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/08/el-origen-de-tabula-rasa</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/08/el-origen-de-tabula-rasa/"><![CDATA[<p>El año pasado me vi sometido a la tortura de usar Excel en contra de mi voluntad. En mi trabajo teníamos una gran cantidad de registros que tenían que ser procesados a través de un análisis semántico y luego eran transformados usando una LLM. Estos datos eran exportados como una serie de CSVs que rondaban las 50.000 filas y una decena de MBs. El análisis necesitaba que yo me sumergiese en los datos, había que filtrarlos, ordenarlos, <em>amasarlos</em>, todo esto con el fin de programar un pipeline automático que los transformase según las necesidades del cliente.</p>

<p>Si alguna vez, querido lector, ha trabajado con una gran cantidad de datos, probablemente empatice con esa necesidad de tener los datos <em>en la punta de los dedos</em>. Explorar y entender datos no es solo tenerlos al frente en una linda interfaz, sino que requiere modificarlos, ponerlos a prueba, ordenar algo por aquí, filtrar algo por allá, quizás agrupar datos relevantes, entender qué <em>es</em> eso que se tiene al frente. Jugar con datos requiere de una interfaz <em>maleable</em>, una extensión de nuestros pensamientos por así decirlo, una forma de conectar las ideas, que están encerradas en la mente de uno, con los datos, que están <em>ordenaditos</em> en la pantalla al frente de uno.</p>

<p>Lamentablemente Excel no es nada de eso, es un Software que pone a prueba la sanidad mental de la pobre persona que tiene que verse sometida al tormento de usarlo. La siguiente es una lista no exhaustiva de los peores pecados que comete Excel (versión 2013, quizás algunas cosas han sido arregladas), en ningún orden en particular:</p>
<ul>
  <li><strong>Bloquea los archivos abiertos</strong>: Por alguna razón, probablemente concebida en los 90s, Excel bloquea los archivos que abre, es decir que no puedo modificar un archivo abierto por Excel, ¡el Sistema Operativo lo bloquea! Esto era particularmente frustrante cuando, al final de un <em>pipeline</em> que tardaba varios minutos en ejecutarse y cuyo último paso era guardar un CSV, no podía guardarlo porque tenía abierto en Excel el resultado del <em>pipeline</em> anterior.</li>
  <li><strong>No permite tener dos archivos abiertos con el mismo nombre</strong>: Ok, el punto anterior podría entenderlo quizás… ¿¿pero este punto?? Me cuesta poner en palabras la ridiculez que significa esto. La cantidad de <code class="language-plaintext highlighter-rouge">output.csv</code> que tuve que renombrar a <code class="language-plaintext highlighter-rouge">aoutput.csv</code> y luego <code class="language-plaintext highlighter-rouge">aaoutput.csv</code> solo para poder ver su contenido al mismo tiempo aún me mantiene despierto por las noches.</li>
  <li><strong>La fila de cabecera no se congela por defecto</strong>: Creo que la importancia de un dato es su contexto. En una tabla, el contexto de un dato es su fila, los datos cercanos <strong>y su cabecera</strong>. ¡No tengo idea si este número en la columna 14 corresponde a <code class="language-plaintext highlighter-rouge">Unidades vendidas</code>, <code class="language-plaintext highlighter-rouge">Devoluciones</code>, <code class="language-plaintext highlighter-rouge">Clientes nuevos</code>, o <code class="language-plaintext highlighter-rouge">Reclamos</code>! ¡Soy un usuario y exijo contexto de mis datos!</li>
  <li><strong>El ajuste de Columnas es cavernario</strong>: O más bien, inexistente. El dato es importante si puedo verlo, si puedo contextualizarlo, <strong>si me cabe en la pantalla</strong>.</li>
  <li><strong>Abrir archivos grandes es extremadamente lento</strong>: Estoy hablando de minutos, en plural. Estoy hablando de archivos de tan solo una decena de MBs, <strong>i-na-cep-ta-ble</strong> para un Software “Profesional” que se vende <a href="https://www.microsoft.com/en-us/microsoft-365/p/office-home-2024/cfq7ttc0pqvj">al precio que se vende</a>.</li>
</ul>

<p>Pero, querido lector, no vengo aquí solamente a descargarme, a llenarlo de la misma adrenalina que tuve circulando en mi sistema durante los casi 6 meses que duró aquel proyecto. Sino que vengo a hablarle del futuro, del mejor <strong>visualizador de datos tabulares que existe en el mercado</strong>. Sí, exactamente, le estoy hablando de <a href="https://tabularasa.cl">Tabula Rasa</a>. Una experiencia sublime, insuperable, una que respeta las intenciones de sus usuarios, y que quizás, a más de algún querido lector le saque lágrimas de júbilo.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> es una tabla en blanco, un <strong>borrón y cuenta nueva</strong>, un potencial ilimitado, una aplicación del tipo <strong>“el usuario está en el centro de la experiencia”</strong>. Tabula Rasa se pregunta constantemente, ¿Qué es lo que quiere el usuario de mí? Se adelanta a sus intenciones, lo acompaña en sus exploraciones, desaparece entre sus dedos, en fin, conecta sus pensamientos con los datos.</p>

<p>Claramente, y quizás un lector sagaz ya se dio cuenta que la lista de reclamos de más arriba no fue al azar, Tabula Rasa resuelve todos los dolores que expresé, y además le da vueltas de ventaja al Software de Microsoft. Veamos la magia de Tabula Rasa:</p>

<ul>
  <li><strong>Es ridículamente rápida</strong>: Se abre al instante, se actualiza en instantes, y más importante <strong>abre archivos de múltiples GBs</strong> en un santiamén. Nada detiene a Tabula Rasa, es ese humilde servidor que está siempre listo.</li>
  <li><strong>¿Bloquear archivos? ¿Qué es esto, los 90s?</strong>: Tabula Rasa nunca bloquea archivos, permite abrir archivos con el mismo nombre (o el mismo archivo) todas las veces que quieras (No puedo creer que pueda marketear esto como un <em>feature</em> 🤦). ¿Un archivo abierto cambió en disco? ¡Da lo mismo! Tabula Rasa te ofrece recargarlo, ¡o incluso ignorar los cambios! Nunca se interpondrá a los deseos de su usuario.</li>
  <li><strong>Features extremadamente útiles</strong>: Ajuste inteligente de columnas, ordenamiento de datos anidados, agrupación de datos, agregamiento de información, filtros (incluso SQLs para los más computines), búsqueda instantánea, mapas de calor, un <strong>gran etcétera</strong>.</li>
  <li><strong>El usuario siempre está al centro</strong>: No soy Microsoft o Apple, no puedo darme el lujo de <a href="https://youtu.be/eXkJWfZcIi0?si=xRoDqyVbRLG70knn&amp;t=30">ignorar a mis usuarios</a>. Todo lo contrario, los usuarios son todo en lo que pienso.</li>
</ul>

<p>Querido lector, no quiero aburrirlo listando una infinidad de features, lo invito mejor que vaya a <a href="https://tabularasa.cl">tabularasa.cl</a> y experimente la app. Puede dejarme un feedback en <a href="mailto:tabularasa@benjaopazoc.cl">tabularasa@benjaopazoc.cl</a>, pero más importantemente, explore sus datos, aproveche la libertad que le acabo de regalar de entender sus datos sin que un ejecutivo de Microsoft (o de la corporación de su gusto, aquí no discriminamos) decida qué tan miserable puede llegar a ser su experiencia, sin antes dejar de extraerle su dinero que sé que le cuesta tanto esfuerzo ganárselo.</p>

<p>Próximamente, exploraremos las funcionalidades de <strong>Tabula Rasa</strong> en más detalle. Si usted, querido lector, es un nerd de tomo y lomo como yo, va a disfrutar el desafío técnico al que me he tenido que enfrentar pensando solamente en usted, mi querido lector y futuro <strong>Usuario de</strong> <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>.</p>]]></content><author><name>Benjamín Opazo</name></author><category term="Tabula Rasa" /><summary type="html"><![CDATA[Tabula Rasa es el mejor visualizador de datos tabulares que existe en el mercado.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-origin/header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-origin/header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry xml:lang="en"><title type="html">The Origin of Tabula Rasa</title><link href="https://blog.benjaopazoc.cl/2026/08/the-origin-of-tabula-rasa/" rel="alternate" type="text/html" title="The Origin of Tabula Rasa" /><published>2026-08-26T19:30:00+00:00</published><updated>2026-08-26T19:30:00+00:00</updated><id>https://blog.benjaopazoc.cl/2026/08/the-origin-of-tabula-rasa</id><content type="html" xml:base="https://blog.benjaopazoc.cl/2026/08/the-origin-of-tabula-rasa/"><![CDATA[<p>Last year I found myself subjected to the torture of using Excel against my will. At work we had a large number of records that had to be processed through a semantic analysis and were then transformed using an LLM. This data would be exported as a series of CSVs that hovered around 50,000 rows and ten-odd MBs. The analysis required that I immerse myself in the data, I had to filter it, sort it, <em>knead</em> it, all with the aim of programming an automatic pipeline that would transform it according to the client’s needs.</p>

<p>If you have ever, dear reader, worked with a large amount of data, you probably empathize with that need to have the data <em>at your fingertips</em>. Exploring and understanding data is not just having it in front of you in a pretty interface, but rather requires modifying it, putting it to the test, sorting something over here, filtering something over there, perhaps grouping relevant data, understanding what it <em>is</em> that you have in front of you. Playing with data requires a <em>malleable</em> interface, an extension of our thoughts so to speak, a way of connecting the ideas, which are locked up inside one’s mind, with the data, which are <em>all neat and tidy</em> on the screen in front of one.</p>

<p>Unfortunately Excel is nothing of the sort, it is a piece of Software that puts to the test the mental sanity of the poor person who has to find themselves subjected to the torment of using it. The following is a non-exhaustive list of the worst sins that Excel commits (version 2013, perhaps some things have been fixed), in no particular order:</p>
<ul>
  <li><strong>It locks open files</strong>: For some reason, probably conceived in the 90s, Excel locks the files it opens, which is to say I can’t modify a file opened by Excel, the Operating System locks it! This was particularly frustrating when, at the end of a <em>pipeline</em> that took several minutes to run and whose last step was saving a CSV, I couldn’t save it because I had the previous <em>pipeline</em>’s result open in Excel.</li>
  <li><strong>It doesn’t allow having two files open with the same name</strong>: Ok, the previous point I could maybe understand… but this one?? I struggle to put into words the ridiculousness of what this means. The number of <code class="language-plaintext highlighter-rouge">output.csv</code> files I had to rename to <code class="language-plaintext highlighter-rouge">aoutput.csv</code> and then <code class="language-plaintext highlighter-rouge">aaoutput.csv</code> just to see their content simultaneously still keeps me up at night.</li>
  <li><strong>The header row isn’t frozen by default</strong>: I believe that the importance of a datum is its context. In a table, a datum’s context is its row, the nearby data <strong>and its header</strong>. I have no idea whether this number in column 14 corresponds to <code class="language-plaintext highlighter-rouge">Units sold</code>, <code class="language-plaintext highlighter-rouge">Returns</code>, <code class="language-plaintext highlighter-rouge">New customers</code>, or <code class="language-plaintext highlighter-rouge">Complaints</code>! I am a user and I demand context for my data!</li>
  <li><strong>Column fitting is cavemanlike</strong>: Or rather, nonexistent. A datum is important if I can see it, if I can contextualize it, <strong>if it fits on my screen</strong>.</li>
  <li><strong>Opening large files is extremely slow</strong>: I am talking about minutes, plural. I am talking about files of a mere dozen MBs, <strong>un-ac-cep-ta-ble</strong> for a “Professional” piece of Software that sells <a href="https://www.microsoft.com/en-us/microsoft-365/p/office-home-2024/cfq7ttc0pqvj">at the price it sells at</a>.</li>
</ul>

<p>But, dear reader, I do not come here only to vent, to fill you with the same adrenaline I had circulating in my system during the almost 6 months that project lasted. Rather, I come to speak to you of the future, of the best <strong>tabular data viewer that exists on the market</strong>. Yes, exactly, I am talking about <a href="https://tabularasa.cl">Tabula Rasa</a>. A sublime, unsurpassable experience, one that respects the intentions of its users, and one that, perhaps, will draw tears of joy from more than one dear reader.</p>

<p><code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code> is a blank table, a <strong>clean slate</strong>, unlimited potential, an application of the <strong>“the user is at the center of the experience”</strong> kind of type. Tabula Rasa constantly asks itself, What is it that the user wants from me? It anticipates their intentions, it accompanies them on their explorations, it disappears between their fingers, in short, it connects their thoughts with the data.</p>

<p>Clearly, and perhaps a shrewd reader has already noticed that the list of complaints further above was not random, Tabula Rasa solves every pain I expressed, and on top of that it laps Microsoft’s Software several times over. Let’s look at the magic of Tabula Rasa:</p>

<ul>
  <li><strong>It is ridiculously fast</strong>: It opens instantly, it refreshes in an instant, and more importantly <strong>it opens multi-GB files</strong> in a jiffy. Nothing stops Tabula Rasa, it is that humble servant who is always ready.</li>
  <li><strong>Locking files? What is this, the 90s?</strong>: Tabula Rasa never locks files, it lets you open files with the same name (or the same file) as many times as you want (I can’t believe I can market this as a <em>feature</em> 🤦). An open file changed on disk? It doesn’t matter! Tabula Rasa offers to reload it, or even to ignore the changes! It will never stand in the way of its user’s wishes.</li>
  <li><strong>Extremely useful features</strong>: Smart column fitting, sorting of nested data, data grouping, information aggregation, filters (even SQL for the more geeky among you), instant search, heat maps, a <strong>long etcetera</strong>.</li>
  <li><strong>The user is always at the center</strong>: I am not Microsoft or Apple, I can’t afford the luxury of <a href="https://youtu.be/eXkJWfZcIi0?si=xRoDqyVbRLG70knn&amp;t=30">ignoring my users</a>. Quite the opposite, users are all I think about.</li>
</ul>

<p>Dear reader, I don’t want to bore you by listing an infinity of features, I invite you instead to go to <a href="https://tabularasa.cl">tabularasa.cl</a> and experience the app. You can leave me some feedback at <a href="mailto:tabularasa@benjaopazoc.cl">tabularasa@benjaopazoc.cl</a>, but more importantly, explore your data, take advantage of the freedom I have just gifted you to understand your data without a Microsoft executive (or the corporation of your liking, we don’t discriminate here) deciding how miserable your experience can end up being, not before first extracting from you the money that I know costs you so much effort to earn.</p>

<p>Coming soon, we will explore the features of <strong>Tabula Rasa</strong> in more detail. If you, dear reader, are a nerd of the highest order like me, you are going to enjoy the technical challenge I have had to face while thinking only of you, my dear reader and future <strong>User of</strong> <code class="language-plaintext hl-guest-tabula-rasa highlighter-rouge">Tabula Rasa</code>.</p>]]></content><author><name>Benjamín Opazo</name></author><category term="Tabula Rasa" /><summary type="html"><![CDATA[Tabula Rasa is the best tabular data viewer that exists on the market.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-origin/header-og.png" /><media:content medium="image" url="https://blog.benjaopazoc.cl/assets/img/tabula-rasa-origin/header-og.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>