• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

keplergl / kepler.gl / 12236323982

09 Dec 2024 01:09PM UTC coverage: 69.193% (-0.02%) from 69.212%
12236323982

push

github

web-flow
[fix] Line layer is not displayed for between hex ids (#2820)

- fix Line layer is not displayed for between hex ID's
- rename type ColumnModeConfig since ColumnModeConfig
- export ColumnModeConfig

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>

5452 of 9133 branches covered (59.7%)

Branch coverage included in aggregate %.

10 of 14 new or added lines in 2 files covered. (71.43%)

25 existing lines in 1 file now uncovered.

11384 of 15199 relevant lines covered (74.9%)

95.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/utils/src/position-utils.ts
1
// SPDX-License-Identifier: MIT
2
// Copyright contributors to the kepler.gl project
3

4
import {h3ToGeo} from 'h3-js';
5

6
import {LayerColumn} from '@kepler.gl/types';
7

8
import {DataContainerInterface} from './data-container-interface';
9

10
export function getPositionFromHexValue(token) {
11
  const pos = h3ToGeo(token);
480✔
12

13
  if (Array.isArray(pos) && pos.every(Number.isFinite)) {
480!
14
    return [pos[1], pos[0]];
480✔
15
  }
NEW
16
  return null;
×
17
}
18

19
export function maybeHexToGeo(
20
  dc: DataContainerInterface,
21
  d: {index: number},
22
  lat: LayerColumn,
23
  lng: LayerColumn
24
) {
25
  // lat or lng column could be hex column
26
  // we assume string value is hex and try to convert it to geo lat lng
27
  const latVal = dc.valueAt(d.index, lat.fieldIdx);
2,978✔
28
  const lngVal = dc.valueAt(d.index, lng.fieldIdx);
2,978✔
29

30
  return typeof latVal === 'string'
2,978✔
31
    ? getPositionFromHexValue(latVal)
32
    : typeof lngVal === 'string'
2,498!
33
    ? getPositionFromHexValue(lngVal)
34
    : null;
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc