Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

uber / deck.gl / 14011

20 Sep 2019 - 23:54 coverage increased (+2.7%) to 82.999%
14011

Pull #3672

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
bump loaders.gl version
Pull Request #3672: Fix bugs in pre-bundled version

3393 of 4577 branches covered (74.13%)

Branch coverage included in aggregate %.

7157 of 8134 relevant lines covered (87.99%)

4305.9 hits per line

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

91.67
/modules/geo-layers/src/h3-layers/h3-cluster-layer.js
1
import {h3SetToMultiPolygon} from 'h3-js';
2

3
import {CompositeLayer, createIterable} from '@deck.gl/core';
4
import {PolygonLayer} from '@deck.gl/layers';
5

6
const defaultProps = Object.assign(
1×
7
  {
8
    getHexagons: {type: 'accessor', value: d => d.hexagons}
6×
9
  },
10
  PolygonLayer.defaultProps
11
);
12

13
export default class H3ClusterLayer extends CompositeLayer {
14
  updateState({props, oldProps, changeFlags}) {
15
    if (
1×
16
      changeFlags.dataChanged ||
Branches [[1, 2]] missed.
17
      (changeFlags.updateTriggers && changeFlags.updateTriggers.getHexagons)
18
    ) {
19
      const {data, getHexagons} = props;
2×
20
      const polygons = [];
1×
21

22
      const {iterable, objectInfo} = createIterable(data);
1×
23
      for (const object of iterable) {
1×
24
        objectInfo.index++;
1×
25
        const hexagons = getHexagons(object, objectInfo);
1×
26
        const multiPolygon = h3SetToMultiPolygon(hexagons, true);
1×
27

UNCOV
28
        for (const polygon of multiPolygon) {
!
29
          polygons.push(this.getSubLayerRow({polygon}, object, objectInfo.index));
26×
30
        }
31
      }
32

33
      this.setState({polygons});
6×
34
    }
35
  }
36

37
  renderLayers() {
38
    const {
39
      elevationScale,
40
      extruded,
41
      wireframe,
42
      filled,
43
      stroked,
44
      lineWidthScale,
45
      lineWidthMinPixels,
46
      lineWidthMaxPixels,
47
      lineJointRounded,
48
      lineMiterLimit,
49
      lineDashJustified,
50
      material,
51

52
      getFillColor,
53
      getLineColor,
54
      getLineWidth,
55
      getLineDashArray,
56
      getElevation,
57
      updateTriggers
58
    } = this.props;
6×
59

60
    const SubLayerClass = this.getSubLayerClass('cluster-region', PolygonLayer);
6×
61

62
    return new SubLayerClass(
6×
63
      {
64
        filled,
65
        wireframe,
66

67
        extruded,
68
        elevationScale,
69

70
        stroked,
71
        lineWidthScale,
72
        lineWidthMinPixels,
73
        lineWidthMaxPixels,
74
        lineJointRounded,
75
        lineMiterLimit,
76
        lineDashJustified,
77

78
        material,
79

80
        getFillColor: this.getSubLayerAccessor(getFillColor),
81
        getLineColor: this.getSubLayerAccessor(getLineColor),
82
        getLineWidth: this.getSubLayerAccessor(getLineWidth),
83
        getLineDashArray: this.getSubLayerAccessor(getLineDashArray),
84
        getElevation: this.getSubLayerAccessor(getElevation)
85
      },
86
      this.getSubLayerProps({
87
        id: 'cluster-region',
88
        updateTriggers
89
      }),
90
      {
91
        data: this.state.polygons,
92
        getPolygon: d => d.polygon
120×
93
      }
94
    );
95
  }
96
}
97

98
H3ClusterLayer.defaultProps = defaultProps;
120×
99
H3ClusterLayer.layerName = 'H3ClusterLayer';
120×
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2019 Coveralls, LLC