@carto/kepler.gl 0.0.12 → 0.0.16-alpha.0
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/CHANGELOG.md +711 -0
- package/dist/components/common/icons/index.js +9 -1
- package/dist/components/common/icons/swap-horizontal.js +68 -0
- package/dist/components/map-container.js +59 -53
- package/dist/components/side-panel/layer-panel/color-palette.js +12 -6
- package/dist/components/side-panel/layer-panel/color-range-selector.js +51 -17
- package/dist/components/side-panel/layer-panel/custom-palette.js +22 -8
- package/dist/components/side-panel/layer-panel/layer-config-group.js +19 -10
- package/dist/components/side-panel/layer-panel/layer-configurator.js +4 -4
- package/dist/components/side-panel/layer-panel/text-label-panel.js +18 -10
- package/dist/constants/default-settings.js +2 -2
- package/dist/localization/en.js +6 -1
- package/dist/processors/index.js +7 -1
- package/package.json +8 -8
- package/src/components/common/icons/index.js +1 -0
- package/src/components/common/icons/swap-horizontal.js +43 -0
- package/src/components/map-container.js +7 -4
- package/src/components/side-panel/layer-panel/color-palette.js +10 -3
- package/src/components/side-panel/layer-panel/color-range-selector.js +68 -28
- package/src/components/side-panel/layer-panel/custom-palette.js +23 -17
- package/src/components/side-panel/layer-panel/layer-config-group.js +16 -7
- package/src/components/side-panel/layer-panel/layer-configurator.js +20 -12
- package/src/components/side-panel/layer-panel/text-label-panel.js +15 -6
- package/src/localization/en.js +5 -0
- package/src/processors/data-processor.d.ts +1 -0
- package/src/processors/index.js +1 -0
- package/umd/keplergl.min.js +28 -28
|
@@ -144,7 +144,8 @@ function LayerConfigGroupFactory(LayerConfigGroupLabel) {
|
|
|
144
144
|
expanded: false,
|
|
145
145
|
onChange: () => {},
|
|
146
146
|
description: null,
|
|
147
|
-
disabled: false
|
|
147
|
+
disabled: false,
|
|
148
|
+
CollapseButton: VertThreeDots
|
|
148
149
|
};
|
|
149
150
|
|
|
150
151
|
static getDerivedStateFromProps(props, state) {
|
|
@@ -153,6 +154,10 @@ function LayerConfigGroupFactory(LayerConfigGroupLabel) {
|
|
|
153
154
|
return {collapsed: false};
|
|
154
155
|
}
|
|
155
156
|
|
|
157
|
+
if (props.layer && !props.layer.config.visConfig[props.property] && !state.collapsed) {
|
|
158
|
+
return {collapsed: true};
|
|
159
|
+
}
|
|
160
|
+
|
|
156
161
|
return null;
|
|
157
162
|
}
|
|
158
163
|
|
|
@@ -169,17 +174,15 @@ function LayerConfigGroupFactory(LayerConfigGroupLabel) {
|
|
|
169
174
|
onChange,
|
|
170
175
|
collapsible,
|
|
171
176
|
description,
|
|
172
|
-
disabled
|
|
177
|
+
disabled,
|
|
178
|
+
CollapseButton
|
|
173
179
|
} = this.props;
|
|
174
180
|
|
|
175
181
|
const {collapsed} = this.state;
|
|
176
182
|
|
|
177
183
|
return (
|
|
178
184
|
<StyledLayerConfigGroup className={classnames('layer-config-group', {collapsed, disabled})}>
|
|
179
|
-
<StyledConfigGroupHeader
|
|
180
|
-
className="layer-config-group__header"
|
|
181
|
-
onClick={() => this.setState({collapsed: !this.state.collapsed})}
|
|
182
|
-
>
|
|
185
|
+
<StyledConfigGroupHeader className="layer-config-group__header">
|
|
183
186
|
<LayerConfigGroupLabel label={label} description={description} />
|
|
184
187
|
<StyledLayerConfigGroupAction className="layer-config-group__action">
|
|
185
188
|
{property ? (
|
|
@@ -189,7 +192,13 @@ function LayerConfigGroupFactory(LayerConfigGroupLabel) {
|
|
|
189
192
|
onChange={() => onChange({[property]: !layer.config.visConfig[property]})}
|
|
190
193
|
/>
|
|
191
194
|
) : null}
|
|
192
|
-
{collapsible ?
|
|
195
|
+
{collapsible ? (
|
|
196
|
+
<CollapseButton
|
|
197
|
+
onClick={() => this.setState({collapsed: !this.state.collapsed})}
|
|
198
|
+
active={!this.state.collapsed}
|
|
199
|
+
height="18px"
|
|
200
|
+
/>
|
|
201
|
+
) : null}
|
|
193
202
|
</StyledLayerConfigGroupAction>
|
|
194
203
|
</StyledConfigGroupHeader>
|
|
195
204
|
<ConfigGroupContent
|
|
@@ -951,7 +951,11 @@ export default function LayerConfiguratorFactory(
|
|
|
951
951
|
{layer.layerInfoModal ? (
|
|
952
952
|
<HowToButton onClick={() => this.props.openModal(layer.layerInfoModal)} />
|
|
953
953
|
) : null}
|
|
954
|
-
<LayerConfigGroup
|
|
954
|
+
<LayerConfigGroup
|
|
955
|
+
label={'layer.basic'}
|
|
956
|
+
collapsible={Object.keys(layer.config.columns).length > 0}
|
|
957
|
+
expanded={!layer.hasAllColumns()}
|
|
958
|
+
>
|
|
955
959
|
<LayerTypeSelector
|
|
956
960
|
datasets={datasets}
|
|
957
961
|
layer={layer}
|
|
@@ -966,17 +970,21 @@ export default function LayerConfiguratorFactory(
|
|
|
966
970
|
onSelect={value => updateLayerConfig({dataId: value})}
|
|
967
971
|
/>
|
|
968
972
|
)}
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
973
|
+
{Object.keys(layer.config.columns).length > 0 && (
|
|
974
|
+
<ConfigGroupCollapsibleContent>
|
|
975
|
+
<LayerColumnConfig
|
|
976
|
+
columnPairs={layer.columnPairs}
|
|
977
|
+
columns={layer.config.columns}
|
|
978
|
+
assignColumnPairs={layer.assignColumnPairs.bind(layer)}
|
|
979
|
+
assignColumn={layer.assignColumn.bind(layer)}
|
|
980
|
+
columnLabels={layer.columnLabels}
|
|
981
|
+
fields={fields}
|
|
982
|
+
fieldPairs={fieldPairs}
|
|
983
|
+
updateLayerConfig={updateLayerConfig}
|
|
984
|
+
updateLayerType={this.props.updateLayerType}
|
|
985
|
+
/>
|
|
986
|
+
</ConfigGroupCollapsibleContent>
|
|
987
|
+
)}
|
|
980
988
|
</LayerConfigGroup>
|
|
981
989
|
{this[renderTemplate] &&
|
|
982
990
|
this[renderTemplate]({
|
|
@@ -50,8 +50,17 @@ function TextLabelPanelFactory(RangeSlider, LayerConfigGroup, FieldSelector) {
|
|
|
50
50
|
updateLayerTextLabel: PropTypes.func.isRequired
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
static defaultProps = {
|
|
54
|
+
AddButton: props => (
|
|
55
|
+
<Button {...props} link>
|
|
56
|
+
<Add height="12px" />
|
|
57
|
+
<FormattedMessage id="panel.text.addMoreLabel" />
|
|
58
|
+
</Button>
|
|
59
|
+
)
|
|
60
|
+
};
|
|
61
|
+
|
|
53
62
|
render() {
|
|
54
|
-
const {updateLayerTextLabel, textLabel, fields} = this.props;
|
|
63
|
+
const {updateLayerTextLabel, textLabel, fields, AddButton} = this.props;
|
|
55
64
|
const currentFields = textLabel.map(tl => tl.field && tl.field.name).filter(d => d);
|
|
56
65
|
return (
|
|
57
66
|
<LayerConfigGroup label={'panel.text.label'} collapsible>
|
|
@@ -65,7 +74,10 @@ function TextLabelPanelFactory(RangeSlider, LayerConfigGroup, FieldSelector) {
|
|
|
65
74
|
</ConfigGroupCollapsibleHeader>
|
|
66
75
|
<ConfigGroupCollapsibleContent>
|
|
67
76
|
{textLabel.map((tl, idx) => (
|
|
68
|
-
<div
|
|
77
|
+
<div
|
|
78
|
+
key={tl.field ? tl.field.name : `null-${idx}`}
|
|
79
|
+
className="side-panel-section-group"
|
|
80
|
+
>
|
|
69
81
|
<PanelLabel>
|
|
70
82
|
<FormattedMessage id={'panel.text.labelWithId'} values={{labelId: idx + 1}} />
|
|
71
83
|
</PanelLabel>
|
|
@@ -129,10 +141,7 @@ function TextLabelPanelFactory(RangeSlider, LayerConfigGroup, FieldSelector) {
|
|
|
129
141
|
</div>
|
|
130
142
|
))}
|
|
131
143
|
<SidePanelSection>
|
|
132
|
-
<
|
|
133
|
-
<Add height="12px" />
|
|
134
|
-
<FormattedMessage id="panel.text.addMoreLabel" />
|
|
135
|
-
</Button>
|
|
144
|
+
<AddButton onClick={val => updateLayerTextLabel(textLabel.length)} />
|
|
136
145
|
</SidePanelSection>
|
|
137
146
|
</ConfigGroupCollapsibleContent>
|
|
138
147
|
</LayerConfigGroup>
|
package/src/localization/en.js
CHANGED
|
@@ -11,6 +11,7 @@ export function processGeojson(rawData: object): ProcessorResult;
|
|
|
11
11
|
export function processCsvData(rawData: string | any[][], header?: string[]): ProcessorResult;
|
|
12
12
|
export function processKeplerglJSON(rawData: SavedMap): ProcessorResult;
|
|
13
13
|
export function processRowObject(rawData: object[]): ProcessorResult;
|
|
14
|
+
export function parseRowsByFields(rows: any[][], fields: Field[]): any[][];
|
|
14
15
|
export function processKeplerglDataset(
|
|
15
16
|
rawData: object | object[]
|
|
16
17
|
): ParsedDataset | ParsedDataset[] | null;
|