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

uber / deck.gl / 13340

10 Sep 2019 - 3:13 coverage decreased (-2.6%) to 80.892%
13340

Pull #3552

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
[#3548 - Part 4] Modify setup.py to specify that README is markdown
Pull Request #3552: [#3548 - Part 4] Update notebook documentation to include additional pydeck features

3330 of 4491 branches covered (74.15%)

Branch coverage included in aggregate %.

6860 of 8106 relevant lines covered (84.63%)

5923.39 hits per line

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

90.91
/modules/geo-layers/src/s2-layer/s2-layer.js
1
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
6×
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20

21
import {CompositeLayer} from '@deck.gl/core';
22
import {PolygonLayer} from '@deck.gl/layers';
23

24
import {getS2Polygon} from './s2-utils';
25

26
const defaultProps = Object.assign(
1×
27
  {
UNCOV
28
    getS2Token: {type: 'accessor', value: d => d.token}
!
29
  },
30
  PolygonLayer.defaultProps
31
);
32

33
export default class S2Layer extends CompositeLayer {
34
  renderLayers() {
35
    // Layer prop
36
    const {data, getS2Token} = this.props;
26×
37

38
    // Rendering props underlying layer
39
    const {
40
      elevationScale,
41
      extruded,
42
      wireframe,
43
      filled,
44
      stroked,
45
      lineWidthUnits,
46
      lineWidthScale,
47
      lineWidthMinPixels,
48
      lineWidthMaxPixels,
49
      lineJointRounded,
50
      lineMiterLimit,
51
      lineDashJustified,
52
      getElevation,
53
      getFillColor,
54
      getLineColor,
55
      getLineWidth,
56
      getLineDashArray
57
    } = this.props;
26×
58

59
    // Accessor props for underlying layers
60
    const {updateTriggers, material} = this.props;
26×
61

62
    // Filled Polygon Layer
63
    const CellLayer = this.getSubLayerClass('cell', PolygonLayer);
26×
64
    return new CellLayer(
26×
65
      {
66
        filled,
67
        wireframe,
68

69
        extruded,
70
        elevationScale,
71

72
        stroked,
73
        lineWidthUnits,
74
        lineWidthScale,
75
        lineWidthMinPixels,
76
        lineWidthMaxPixels,
77
        lineJointRounded,
78
        lineMiterLimit,
79
        lineDashJustified,
80

81
        material,
82

83
        getElevation,
84
        getFillColor,
85
        getLineColor,
86
        getLineWidth,
87
        getLineDashArray
88
      },
89
      this.getSubLayerProps({
90
        id: 'cell',
91
        updateTriggers: {
92
          getElevation: updateTriggers.getElevation,
93
          getFillColor: updateTriggers.getFillColor,
94
          getLineColor: updateTriggers.getLineColor,
95
          getLineWidth: updateTriggers.getLineWidth,
96
          getLineDashArray: updateTriggers.getLineDashArray
97
        }
98
      }),
99
      {
100
        data,
101
        getPolygon: (x, objectInfo) => getS2Polygon(getS2Token(x, objectInfo))
2,610×
102
      }
103
    );
104
  }
105
}
106

107
S2Layer.layerName = 'S2Layer';
1×
108
S2Layer.defaultProps = defaultProps;
1×
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