Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
[Bug] Fix server render error, remove react-ace (#206)
Shan Hec6f0ef7550d6
diff --git a/package.json b/package.jsonindex b226d8436..550c6dd86 100644--- a/package.json+++ b/package.json@@ -84,10 +84,10 @@"lodash.uniq": "^4.0.1","moment": "^2.10.6","prop-types": "^15.6.0",- "react-ace": "^6.1.1","react-anything-sortable": "^1.7.2","react-data-grid": "2.0.80-am-fix-defaultprops-warnings3337","react-file-drop": "^0.1.8",+ "react-json-pretty": "^1.7.9","react-map-gl": "^3.2.1","react-modal": "^3.1.10","react-onclickoutside": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.7.1.tgz",diff --git a/src/components/modals/export-config-modal.js b/src/components/modals/export-config-modal.jsindex ce45f4288..19ed27ba0 100644--- a/src/components/modals/export-config-modal.js+++ b/src/components/modals/export-config-modal.js@@ -21,8 +21,8 @@import React from 'react';import PropTypes from 'prop-types';import styled from 'styled-components';-import AceEditor from 'react-ace';import Switch from 'components/common/switch';+import JSONPretty from 'react-json-pretty';import {StyledModalContent} from 'components/common/styled-components';@@ -35,10 +35,11 @@ const StyledExportConfigSection = styled.div`flex-direction: row;margin: 35px 0;width: 100%;+ justify-content: space-between;.description {width: 185px;-+.title {font-weight: 500;color: ${props => props.theme.textColorLT};@@ -48,67 +49,39 @@ const StyledExportConfigSection = styled.div`color: ${props => props.theme.textColor};font-size: 11px;}-+.note {color: ${props => props.theme.errorColor};font-size: 11px;}}-+.selection {- display: flex;- flex-wrap: wrap;- flex: 1;padding-left: 50px;+ flex-grow: 1;- select {+ .viewer {+ border: 1px solid ${props => props.theme.selectBorderColorLT};background-color: white;- border-radius: 1px;+ border-radius: 2px;display: inline-block;font: inherit;line-height: 1.5em;padding: 0.5em 3.5em 0.5em 1em;- margin: 0;+ margin: 0;box-sizing: border-box;appearance: none;- width: 250px;- height: 36px;-- background-image:- linear-gradient(45deg, transparent 50%, gray 50%),- linear-gradient(135deg, gray 50%, transparent 50%),- linear-gradient(to right, #ccc, #ccc);- background-position:- calc(100% - 20px) calc(1em + 2px),- calc(100% - 15px) calc(1em + 2px),- calc(100% - 2.5em) 4.5em;- background-size:- 5px 5px,- 5px 5px,- 1px 1.5em;- background-repeat: no-repeat;- }-- select:focus {- background-image:- linear-gradient(45deg, green 50%, transparent 50%),- linear-gradient(135deg, transparent 50%, green 50%),- linear-gradient(to right, #ccc, #ccc);- background-position:- calc(100% - 15px) 1em,- calc(100% - 20px) 1em,- calc(100% - 2.5em) 4.5em;- background-size:- 5px 5px,- 5px 5px,- 1px 1.5em;- background-repeat: no-repeat;- border-color: green;- outline: 0;+ height: 300px;+ width: 100%;+ overflow-y: scroll;}}`;+const StyledModalContentInner = styled.div`+ width: 100%;+`;+const ExportConfigModal = ({data,config,@@ -117,7 +90,7 @@ const ExportConfigModal = ({}) => (<div className="export-config-modal"><StyledModalContent>- <div>+ <StyledModalContentInner className="export-config-modal__inner"><StyledExportConfigSection><div className="description"><div className="title">@@ -134,25 +107,9 @@ const ExportConfigModal = ({</div></div><div className="selection">- <AceEditor- mode="json"- theme="monokai"- name="kepler.gl-config"- fontSize={9}- readOnly={true}- wrapEnabled={true}- height="280px"- showPrintMargin={true}- showGutter={true}- highlightActiveLine={false}- value={JSON.stringify(config, null, 2)}- setOptions={{- enableBasicAutocompletion: false,- enableLiveAutocompletion: true,- enableSnippets: false,- showLineNumbers: true,- tabSize: 2- }}/>+ <div className="viewer">+ <JSONPretty id="json-pretty" json={config}/>+ </div></div></StyledExportConfigSection><StyledExportConfigSection>@@ -171,7 +128,7 @@ const ExportConfigModal = ({onChange={onChangeExportData}/></div></StyledExportConfigSection>- </div>+ </StyledModalContentInner></StyledModalContent></div>);diff --git a/src/reducers/vis-state-updaters.js b/src/reducers/vis-state-updaters.jsindex ee10132fc..fce1cc30b 100644--- a/src/reducers/vis-state-updaters.js+++ b/src/reducers/vis-state-updaters.js@@ -55,10 +55,16 @@ import {mergeLayerBlending} from './vis-state-merger';-import {LayerClasses, Layer} from 'layers';+// LayerClasses contain ES6 Class, do not instatiate in iso rendering+// const {LayerClasses} = isBrowser || isTesting ?+// require('layers') : {+// LayerClasses: {}+// };++import {Layer, LayerClasses} from 'layers'// react-palm-// disable capture exception for react-palm call to withTasks+// disable capture exception for react-palm call to withTaskdisableStackCapturing();export const INITIAL_VIS_STATE = {diff --git a/yarn.lock b/yarn.lockindex f5e4e7af6..53a078290 100644--- a/yarn.lock+++ b/yarn.lock@@ -1335,10 +1335,6 @@ brace-expansion@^1.0.0, brace-expansion@^1.1.7:balanced-match "^1.0.0"concat-map "0.0.1"-brace@^0.11.0:- version "0.11.1"- resolved "https://registry.yarnpkg.com/brace/-/brace-0.11.1.tgz#4896fcc9d544eef45f4bb7660db320d3b379fe58"-braces@^1.8.2:version "1.8.5"resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7"@@ -2420,10 +2416,6 @@ detective@^5.0.2:defined "^1.0.0"minimist "^1.1.1"-diff-match-patch@^1.0.0:- version "1.0.1"- resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.1.tgz#d5f880213d82fbc124d2b95111fb3c033dbad7fa"-diff@^3.1.0:version "3.5.0"resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"@@ -4508,14 +4500,6 @@ lodash.flattendeep@^4.2.0, lodash.flattendeep@^4.4.0:version "4.4.0"resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"-lodash.get@^4.4.2:- version "4.4.2"- resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"--lodash.isequal@^4.1.1:- version "4.5.0"- resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"-lodash.isplainobject@^4.0.6:version "4.0.6"resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"@@ -5832,16 +5816,6 @@ re-emitter@^1.0.0:version "1.1.3"resolved "https://registry.yarnpkg.com/re-emitter/-/re-emitter-1.1.3.tgz#fa9e319ffdeeeb35b27296ef0f3d374dac2f52a7"-react-ace@^6.1.1:- version "6.1.1"- resolved "https://registry.yarnpkg.com/react-ace/-/react-ace-6.1.1.tgz#c8339b4f0a27401bff53f477f125d3d7eac2a090"- dependencies:- brace "^0.11.0"- diff-match-patch "^1.0.0"- lodash.get "^4.4.2"- lodash.isequal "^4.1.1"- prop-types "^15.5.8"-react-addons-test-utils@^15.6.2:version "15.6.2"resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.6.2.tgz#c12b6efdc2247c10da7b8770d185080a7b047156"@@ -5887,6 +5861,12 @@ react-hot-loader@^3.0.0-beta.6:redbox-react "^1.3.6"source-map "^0.6.1"+react-json-pretty@^1.7.9:+ version "1.7.9"+ resolved "https://registry.yarnpkg.com/react-json-pretty/-/react-json-pretty-1.7.9.tgz#d153c52579fda9e245c81fceb3da22fdf1d93c1e"+ dependencies:+ create-react-class "^15.5.2"+react-lifecycles-compat@^3.0.0:version "3.0.3"resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.3.tgz#473820154732f1ccd762e89324abab154255da6b"