Skip to content

Commit 047c929

Browse files
committed
chore: update documentation
1 parent a0f43f9 commit 047c929

2 files changed

Lines changed: 49 additions & 29 deletions

File tree

data/attributes.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
["Styling", "hide-row-borders"],
2121
["Styling", "hide-thead-border"],
2222
["Styling", "hide-index-border"],
23+
["Styling", "no-wrap"],
2324
["Truncation", "max-rows"],
2425
["Truncation", "max-columns"],
2526
["Truncation", "trim-size"],
@@ -42,6 +43,7 @@
4243
["false", "Removes horizontal borders between data rows"],
4344
["false", "Removes border below the header section"],
4445
["false", "Removes border between index and data columns"],
46+
["false", "Prevents text wrapping in table cells"],
4547
["30", "Maximum number of rows to render"],
4648
["30", "Maximum number of columns to render"],
4749
["5", "Number of head/tail rows to include"],

index.html

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -129,68 +129,86 @@ <h3>Data</h3>
129129
<td>Table data content arranged in rows and columns</td>
130130
</tr>
131131
<tr>
132-
<td rowspan="2">columns</td>
133-
<td rowspan="2">Yes</td>
134-
<td>Array</td>
135-
<td>Column labels (single-level): ["A", "B"]</td>
132+
<td colspan="4"><strong>columns</strong> (Object)</td>
136133
</tr>
137134
<tr>
138-
<td>Array[]</td>
139-
<td>Column labels (multi-level): [["A1", "B1"], ["A2", "B2"]]</td>
135+
<td>columns.values</td>
136+
<td>Yes</td>
137+
<td>Array | Array[]</td>
138+
<td>Column labels. Single-level: ["A", "B"]. Multi-level: [["A1", "B1"], ["A2", "B2"]]</td>
140139
</tr>
141140
<tr>
142-
<td rowspan="2">index</td>
143-
<td rowspan="2">Yes</td>
141+
<td>columns.names</td>
142+
<td>No</td>
144143
<td>Array</td>
145-
<td>Row labels (single-level): ["Row1", "Row2"]</td>
144+
<td>Names for each column level in hierarchical order</td>
146145
</tr>
147146
<tr>
148-
<td>Array[]</td>
149-
<td>Row labels (multi-level): [["Group1", "Item1"], ["Group1", "Item2"]]</td>
147+
<td>columns.dtypes</td>
148+
<td>No</td>
149+
<td>Array</td>
150+
<td>Data type per column ("str", "int", "float", "bool", "datetime", "category")</td>
150151
</tr>
151152
<tr>
152-
<td>columnNames</td>
153+
<td>columns.formatOptions</td>
153154
<td>No</td>
154-
<td>Array</td>
155-
<td>Names for each column level in hierarchical order</td>
155+
<td>Object[]</td>
156+
<td>Locale formatting options per column (currency, notation, grouping, etc)</td>
156157
</tr>
157158
<tr>
158-
<td>indexNames</td>
159+
<td colspan="4"><strong>index</strong> (Object)</td>
160+
</tr>
161+
<tr>
162+
<td>index.values</td>
163+
<td>Yes</td>
164+
<td>Array | Array[]</td>
165+
<td>Row labels. Single-level: ["Row1", "Row2"]. Multi-level: [["Group1", "Item1"], ["Group1", "Item2"]]</td>
166+
</tr>
167+
<tr>
168+
<td>index.names</td>
159169
<td>No</td>
160170
<td>Array</td>
161171
<td>Names for each index level in hierarchical order</td>
162172
</tr>
163173
<tr>
164-
<td>dtypes</td>
174+
<td>index.dtypes</td>
165175
<td>No</td>
166176
<td>Array</td>
167-
<td>Data type per column ("str", "int", "float", "bool", "datetime", "category")</td>
177+
<td>Data type per index level</td>
168178
</tr>
169179
<tr>
170-
<td>formatOptions</td>
180+
<td>index.formatOptions</td>
171181
<td>No</td>
172182
<td>Object[]</td>
173-
<td>Locale formatting options per column (currency, notation, grouping, etc)</td>
183+
<td>Locale formatting options per index level</td>
174184
</tr>
175185
</tbody>
176186
</table>
177187
<h4>Example Single-Level Structure</h4>
178188
<pre><code>{
179189
"values": [[1, 2], [3, 4]],
180-
"columns": ["A", "B"],
181-
"index": ["Row1", "Row2"],
182-
"columnNames": ["Products"],
183-
"indexNames": ["Items"],
184-
"dtypes": ["int", "int"]
190+
"columns": {
191+
"values": ["A", "B"],
192+
"names": ["Products"],
193+
"dtypes": ["int", "int"]
194+
},
195+
"index": {
196+
"values": ["Row1", "Row2"],
197+
"names": ["Items"]
198+
}
185199
}</code></pre>
186200
<h4>Example Multi-Level Structure</h4>
187201
<pre><code>{
188202
"values": [[1, 2], [3, 4]],
189-
"columns": [["2023", "Q1"], ["2023", "Q2"]],
190-
"index": [["Region1", "City1"], ["Region1", "City2"]],
191-
"columnNames": ["Year", "Quarter"],
192-
"indexNames": ["Region", "City"],
193-
"dtypes": ["int", "int"]
203+
"columns": {
204+
"values": [["2023", "Q1"], ["2023", "Q2"]],
205+
"names": ["Year", "Quarter"],
206+
"dtypes": ["int", "int"]
207+
},
208+
"index": {
209+
"values": [["Region1", "City1"], ["Region1", "City2"]],
210+
"names": ["Region", "City"]
211+
}
194212
}</code></pre>
195213
</section>
196214
<script src="src/viewer.js" type="module"></script>

0 commit comments

Comments
 (0)