Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Enhancement] Remove table cell char limit and increased cell header height (#1038)

Giuseppe Macrì6b9b4dc14977
diff --git a/src/components/common/data-table/index.js b/src/components/common/data-table/index.js
index f2651e9fa..fe5e07a8f 100644
--- a/src/components/common/data-table/index.js
+++ b/src/components/common/data-table/index.js
@@ -194,7 +194,7 @@ export const Container = styled.div`
font-weight: 500;
display: flex;
flex-direction: column;
- justify-content: space-around;
+ justify-content: flex-start;
height: 100%;
overflow: hidden;
flex-grow: 1;
@@ -233,13 +233,6 @@ export const Container = styled.div`
}
`;
-const validateCellDataSize = (data, {cellSizeLimit = 10000}) => {
- if (`${data}`.length <= cellSizeLimit) {
- return data;
- }
- return 'Data too large, download CSV';
-};
-
const defaultColumnWidth = 200;
const columnWidthFunction = (columns, cellSizeCache, ghost) => ({index}) => {
@@ -344,13 +337,11 @@ const renderHeaderCell = (columns, isPinned, props, toggleMoreOptions, moreOptio
const renderDataCell = (columns, isPinned, props) => {
return cellInfo => {
const {columnIndex, key, style, rowIndex} = cellInfo;
- const {cellSizeLimit, rows, colMeta} = props;
+ const {rows, colMeta} = props;
const column = columns[columnIndex];
const isGhost = column.ghost;
- const rowCell = isGhost
- ? ''
- : validateCellDataSize(getRowCell({...props, column, rowIndex}), {cellSizeLimit});
+ const rowCell = isGhost ? '' : getRowCell({...props, column, rowIndex});
const type = isGhost ? null : colMeta[column];
const endCell = columnIndex === columns.length - 1;
diff --git a/src/components/common/item-selector/keyevent.js b/src/components/common/item-selector/keyevent.js
index 9eacd6b64..e8f04ceda 100644
--- a/src/components/common/item-selector/keyevent.js
+++ b/src/components/common/item-selector/keyevent.js
@@ -17,6 +17,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+
import window from 'global/window';
/* eslint-disable no-use-before-define */
const KeyEvent = Object.assign({}, window.KeyEvent);
diff --git a/src/components/side-panel/filter-manager.js b/src/components/side-panel/filter-manager.js
index b80cc875c..7b843f595 100644
--- a/src/components/side-panel/filter-manager.js
+++ b/src/components/side-panel/filter-manager.js
@@ -88,7 +88,12 @@ function FilterManagerFactory(SourceDataCatalog, FilterPanel) {
/>
))}
</SidePanelSection>
- <Button className="add-filter-button" inactive={hadEmptyFilter || !hadDataset} width="105px" onClick={this._addFilter}>
+ <Button
+ className="add-filter-button"
+ inactive={hadEmptyFilter || !hadDataset}
+ width="105px"
+ onClick={this._addFilter}
+ >
<Add height="12px" />
Add Filter
</Button>
diff --git a/src/components/side-panel/layer-manager.js b/src/components/side-panel/layer-manager.js
index 0ffdb2163..4433a9d15 100644
--- a/src/components/side-panel/layer-manager.js
+++ b/src/components/side-panel/layer-manager.js
@@ -82,7 +82,13 @@ const SortableStyledItem = styled.div`
export function AddDataButtonFactory() {
const AddDataButton = ({onClick, isInactive}) => (
- <Button className="add-data-button" onClick={onClick} isInactive={!isInactive} width="105px" secondary>
+ <Button
+ className="add-data-button"
+ onClick={onClick}
+ isInactive={!isInactive}
+ width="105px"
+ secondary
+ >
<Add height="12px" />
Add Data
</Button>
diff --git a/src/components/side-panel/map-manager.js b/src/components/side-panel/map-manager.js
index f45e678b3..32659c41d 100644
--- a/src/components/side-panel/map-manager.js
+++ b/src/components/side-panel/map-manager.js
@@ -100,7 +100,11 @@ function MapManagerFactory(MapStyleSelector, LayerGroupSelector) {
<SidePanelSection>
<ColorSelector colorSets={colorSets} disabled={!hasBuildingLayer} />
</SidePanelSection>
- <Button className="add-map-style-button" onClick={this.props.showAddMapStyleModal} secondary>
+ <Button
+ className="add-map-style-button"
+ onClick={this.props.showAddMapStyleModal}
+ secondary
+ >
<Add height="12px" />
Add Map Style
</Button>
diff --git a/src/styles/base.js b/src/styles/base.js
index 50b712f4c..b8cd6cb91 100644
--- a/src/styles/base.js
+++ b/src/styles/base.js
@@ -265,7 +265,7 @@ export const notificationPanelItemHeight = 60;
const headerRowHeight = 70;
const rowHeight = 32;
const headerPaddingTop = 6;
-const headerPaddingBottom = 12;
+const headerPaddingBottom = 8;
const cellPaddingSide = 10;
const edgeCellPaddingSide = 10;
const cellFontSize = 10;
diff --git a/yarn.lock b/yarn.lock
index cb144b1d4..5dd994790 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2941,7 +2941,7 @@ acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1:
acorn-walk "^7.0.0"
xtend "^4.0.2"
-acorn-walk@^6.1.1:
+acorn-walk@^6.0.1, acorn-walk@^6.1.1:
version "6.2.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c"
integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==
@@ -2966,6 +2966,11 @@ acorn@^5.2.1, acorn@^5.5.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
+acorn@^6.0.1:
+ version "6.4.1"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
+ integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==
+
acorn@^6.0.7, acorn@^6.2.1:
version "6.4.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784"
@@ -16074,7 +16079,7 @@ whatwg-fetch@>=0.10.0:
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
-whatwg-mimetype@^2.3.0:
+whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==