jupyterlab_tabular_data_viewer_extension 1.2.9 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modal.js +12 -9
- package/package.json +1 -1
- package/src/modal.ts +13 -10
package/lib/modal.js
CHANGED
|
@@ -90,12 +90,6 @@ export class ColumnStatsModal extends Widget {
|
|
|
90
90
|
}
|
|
91
91
|
// String statistics
|
|
92
92
|
if (this._stats.data_type === 'string') {
|
|
93
|
-
const stringSection = document.createElement('div');
|
|
94
|
-
stringSection.className = 'jp-ColumnStatsModal-section';
|
|
95
|
-
const stringTitle = document.createElement('h4');
|
|
96
|
-
stringTitle.textContent = 'String Statistics';
|
|
97
|
-
stringSection.appendChild(stringTitle);
|
|
98
|
-
const stringList = document.createElement('ul');
|
|
99
93
|
const items = [];
|
|
100
94
|
if (this._stats.most_common_value !== undefined) {
|
|
101
95
|
items.push(`Most common: "${this._stats.most_common_value}" (${this._stats.most_common_count})`);
|
|
@@ -109,9 +103,18 @@ export class ColumnStatsModal extends Widget {
|
|
|
109
103
|
if (this._stats.avg_length !== undefined) {
|
|
110
104
|
items.push(`Avg length: ${this._formatNumber(this._stats.avg_length)} characters`);
|
|
111
105
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
// Only show section if we have stats to display
|
|
107
|
+
if (items.length > 0) {
|
|
108
|
+
const stringSection = document.createElement('div');
|
|
109
|
+
stringSection.className = 'jp-ColumnStatsModal-section';
|
|
110
|
+
const stringTitle = document.createElement('h4');
|
|
111
|
+
stringTitle.textContent = 'String Statistics';
|
|
112
|
+
stringSection.appendChild(stringTitle);
|
|
113
|
+
const stringList = document.createElement('ul');
|
|
114
|
+
stringList.innerHTML = items.map(item => `<li>${item}</li>`).join('');
|
|
115
|
+
stringSection.appendChild(stringList);
|
|
116
|
+
content.appendChild(stringSection);
|
|
117
|
+
}
|
|
115
118
|
}
|
|
116
119
|
// Date/datetime statistics
|
|
117
120
|
if (this._stats.data_type === 'date' || this._stats.data_type === 'datetime') {
|
package/package.json
CHANGED
package/src/modal.ts
CHANGED
|
@@ -105,13 +105,6 @@ export class ColumnStatsModal extends Widget {
|
|
|
105
105
|
|
|
106
106
|
// String statistics
|
|
107
107
|
if (this._stats.data_type === 'string') {
|
|
108
|
-
const stringSection = document.createElement('div');
|
|
109
|
-
stringSection.className = 'jp-ColumnStatsModal-section';
|
|
110
|
-
const stringTitle = document.createElement('h4');
|
|
111
|
-
stringTitle.textContent = 'String Statistics';
|
|
112
|
-
stringSection.appendChild(stringTitle);
|
|
113
|
-
|
|
114
|
-
const stringList = document.createElement('ul');
|
|
115
108
|
const items: string[] = [];
|
|
116
109
|
|
|
117
110
|
if (this._stats.most_common_value !== undefined) {
|
|
@@ -127,9 +120,19 @@ export class ColumnStatsModal extends Widget {
|
|
|
127
120
|
items.push(`Avg length: ${this._formatNumber(this._stats.avg_length)} characters`);
|
|
128
121
|
}
|
|
129
122
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
// Only show section if we have stats to display
|
|
124
|
+
if (items.length > 0) {
|
|
125
|
+
const stringSection = document.createElement('div');
|
|
126
|
+
stringSection.className = 'jp-ColumnStatsModal-section';
|
|
127
|
+
const stringTitle = document.createElement('h4');
|
|
128
|
+
stringTitle.textContent = 'String Statistics';
|
|
129
|
+
stringSection.appendChild(stringTitle);
|
|
130
|
+
|
|
131
|
+
const stringList = document.createElement('ul');
|
|
132
|
+
stringList.innerHTML = items.map(item => `<li>${item}</li>`).join('');
|
|
133
|
+
stringSection.appendChild(stringList);
|
|
134
|
+
content.appendChild(stringSection);
|
|
135
|
+
}
|
|
133
136
|
}
|
|
134
137
|
|
|
135
138
|
// Date/datetime statistics
|