Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

GeoMap: Ignore points with null coordinate values #1775

Merged
merged 5 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Next Release

<br/>![New Features](/docs/assets/tags/new_features.svg)

#### Visual Environment

#### Enso Compiler

<br/>![Bug Fixes](/docs/assets/tags/bug_fixes.svg)

#### Visual Environment

- [GeoMap visualization will ignore points with `null` coordinates][1775]. Now
the presence of such points in the dataset will not break initial map
positioning.

[1775]: https://github.com/enso-org/ide/pull/1775

# Enso 2.0.0-alpha.11 (2021-08-09)

This update contains major performance improvements and exposes new privacy user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class GeoMapVisualization extends Visualization {

extractDataPoints(data, this.dataPoints, this.accentColor)
if (this.dataPoints.length === 0) {
// We have no valid data and should skip initialisation.
// We have no valid data and should skip initialization.
return false
}
const { latitude, longitude } = this.centerPoint()
Expand Down Expand Up @@ -219,7 +219,7 @@ class GeoMapVisualization extends Visualization {
}

/**
* Reset the internal state of the visualisation, discarding all previous data updates.
* Reset the internal state of the visualization, discarding all previous data updates.
*/
resetState() {
// We only need to reset the data points as everything else will be overwritten when new
Expand Down Expand Up @@ -288,7 +288,7 @@ class GeoMapVisualization extends Visualization {
}

/**
* Extract the visualisation data from a full configuration object.
* Extract the visualization data from a full configuration object.
*/
function extractVisualizationDataFromFullConfig(parsedData, preparedDataPoints, accentColor) {
if (parsedData.type === SCATTERPLOT_LAYER && parsedData.data.length) {
Expand All @@ -306,7 +306,7 @@ function extractVisualizationDataFromFullConfig(parsedData, preparedDataPoints,
}

/**
* Extract the visualisation data from a dataframe.
* Extract the visualization data from a dataframe.
*/
function extractVisualizationDataFromDataFrame(parsedData, preparedDataPoints, accentColor) {
const geoPoints = parsedData.df_latitude.map(function (latitude, i) {
Expand Down Expand Up @@ -348,11 +348,13 @@ function extractDataPoints(parsedData, preparedDataPoints, accentColor) {
*/
function pushPoints(dataPoints, targetList, accentColor) {
dataPoints.forEach(geoPoint => {
let position = [geoPoint.longitude, geoPoint.latitude]
let radius = isValidNumber(geoPoint.radius) ? geoPoint.radius : DEFAULT_POINT_RADIUS
let color = ok(geoPoint.color) ? geoPoint.color : accentColor
let label = ok(geoPoint.label) ? geoPoint.label : ''
targetList.push({ position, color, radius, label })
if (isValidNumber(geoPoint.longitude) && isValidNumber(geoPoint.latitude)) {
let position = [geoPoint.longitude, geoPoint.latitude]
let radius = isValidNumber(geoPoint.radius) ? geoPoint.radius : DEFAULT_POINT_RADIUS
let color = geoPoint.color ?? accentColor
let label = geoPoint.label ?? ''
targetList.push({ position, color, radius, label })
}
})
}

Expand Down