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

Commit

Permalink
Geomap Case Insensitive (#1392)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwu-tow authored Mar 26, 2021
1 parent 7e52671 commit 85a1adc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
example, having selected node with Table output and adding a new node with
expression `at "x" == "y"` the selected node was applied to the right side of
`==`: `at "x" == operator1."y"` instead of `operator1.at "x" == "y"`.
- [Geo Map visualization recognizes columns regardless of their name letter
case][1392]. This allows visualizing tables with columns like `LONGITUDE` or
`Longitude`, where previously only `longitude` was recognized.

#### EnsoGL (rendering engine)

Expand All @@ -94,6 +97,7 @@ you can find their release notes
[1348]: https://github.com/enso-org/ide/pull/1348
[1353]: https://github.com/enso-org/ide/pull/1353
[1385]: https://github.com/enso-org/ide/pull/1385
[1392]: https://github.com/enso-org/ide/pull/1392

<br/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,13 @@ class GeoMapVisualization extends Visualization {
this.setPreprocessorCode(`
df -> case df of
Table.Table _ ->
columns = df.select ['label', 'latitude', 'longitude'] . columns
serialized = columns.map (c -> ['df_' + c.name, c.to_vector])
Json.from_pairs serialized . to_text
names = ['label', 'latitude', 'longitude']
look_for name =
is_matching column = column.name.equals_ignore_case name
["df_" + name, df.columns.find is_matching . to_vector]
valid_column pair = pair.at 1 . is_error . not
pairs = names.map look_for . filter valid_column
Json.from_pairs pairs . to_text
_ -> df . to_json . to_text
`)
}
Expand Down

0 comments on commit 85a1adc

Please sign in to comment.