@cdc/map 4.25.3 → 4.25.5-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/cdcmap.js +38945 -41511
  2. package/examples/hex-colors.json +3 -3
  3. package/examples/private/test.json +470 -1457
  4. package/examples/private/{mmr.json → wastewatermap.json} +86 -115
  5. package/index.html +13 -41
  6. package/package.json +4 -10
  7. package/src/CdcMap.tsx +51 -1555
  8. package/src/CdcMapComponent.tsx +594 -0
  9. package/src/_stories/CdcMap.Legend.Gradient.stories.tsx +10 -0
  10. package/src/_stories/CdcMap.Legend.stories.tsx +67 -0
  11. package/src/_stories/CdcMap.stories.tsx +4 -1
  12. package/src/_stories/UsaMap.NoData.stories.tsx +4 -4
  13. package/{examples/private/default-patterns.json → src/_stories/_mock/legends/legend-tests.json} +36 -131
  14. package/src/cdcMapComponent.styles.css +9 -0
  15. package/src/components/Annotation/Annotation.Draggable.tsx +27 -26
  16. package/src/components/Annotation/AnnotationDropdown.tsx +5 -6
  17. package/src/components/BubbleList.tsx +135 -49
  18. package/src/components/CityList.tsx +89 -87
  19. package/src/components/DataTable.tsx +8 -8
  20. package/src/components/EditorPanel/components/EditorPanel.tsx +714 -820
  21. package/src/components/EditorPanel/components/Error.tsx +9 -2
  22. package/src/components/EditorPanel/components/HexShapeSettings.tsx +127 -141
  23. package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +55 -86
  24. package/src/components/EditorPanel/components/Panels/Panel.PatternSettings.tsx +89 -75
  25. package/src/components/EditorPanel/components/editorPanel.styles.css +95 -0
  26. package/src/components/Geo.tsx +9 -1
  27. package/src/components/GoogleMap/components/GoogleMap.tsx +1 -1
  28. package/src/components/Legend/components/Legend.tsx +92 -87
  29. package/src/components/Legend/components/LegendGroup/Legend.Group.tsx +128 -0
  30. package/src/components/Legend/components/LegendGroup/legend.group.css +27 -0
  31. package/src/components/Legend/components/LegendItem.Hex.tsx +4 -1
  32. package/src/components/Legend/components/index.scss +18 -6
  33. package/src/components/Modal.tsx +17 -7
  34. package/src/components/NavigationMenu.tsx +11 -9
  35. package/src/components/UsaMap/components/SingleState/SingleState.CountyOutput.tsx +12 -8
  36. package/src/components/UsaMap/components/SingleState/SingleState.StateOutput.tsx +4 -4
  37. package/src/components/UsaMap/components/TerritoriesSection.tsx +33 -10
  38. package/src/components/UsaMap/components/Territory/Territory.Hexagon.tsx +12 -10
  39. package/src/components/UsaMap/components/Territory/Territory.Rectangle.tsx +12 -14
  40. package/src/components/UsaMap/components/Territory/TerritoryShape.ts +2 -1
  41. package/src/components/UsaMap/components/UsaMap.County.tsx +138 -96
  42. package/src/components/UsaMap/components/UsaMap.Region.styles.css +72 -0
  43. package/src/components/UsaMap/components/UsaMap.Region.tsx +56 -103
  44. package/src/components/UsaMap/components/UsaMap.SingleState.styles.css +10 -0
  45. package/src/components/UsaMap/components/UsaMap.SingleState.tsx +59 -66
  46. package/src/components/UsaMap/components/UsaMap.State.tsx +112 -91
  47. package/src/components/UsaMap/helpers/map.ts +1 -1
  48. package/src/components/UsaMap/helpers/shapes.ts +20 -7
  49. package/src/components/WorldMap/WorldMap.tsx +64 -118
  50. package/src/components/WorldMap/worldMap.styles.css +28 -0
  51. package/src/components/ZoomControls.tsx +15 -13
  52. package/src/components/zoomControls.styles.css +53 -0
  53. package/src/context.ts +17 -9
  54. package/src/data/initial-state.js +5 -2
  55. package/src/helpers/addUIDs.ts +151 -0
  56. package/src/helpers/applyColorToLegend.ts +39 -64
  57. package/src/helpers/applyLegendToRow.ts +51 -0
  58. package/src/helpers/colorDistributions.ts +12 -0
  59. package/src/helpers/constants.ts +44 -0
  60. package/src/helpers/displayGeoName.ts +9 -2
  61. package/src/helpers/generateColorsArray.ts +2 -1
  62. package/src/helpers/generateRuntimeData.ts +74 -0
  63. package/src/helpers/generateRuntimeFilters.ts +63 -0
  64. package/src/helpers/generateRuntimeLegend.ts +537 -0
  65. package/src/helpers/generateRuntimeLegendHash.ts +16 -15
  66. package/src/helpers/getColumnNames.ts +19 -0
  67. package/src/helpers/getMapContainerClasses.ts +23 -0
  68. package/src/helpers/handleMapTabbing.ts +31 -0
  69. package/src/helpers/hashObj.ts +1 -1
  70. package/src/helpers/index.ts +22 -0
  71. package/src/helpers/navigationHandler.ts +3 -3
  72. package/src/helpers/resetLegendToggles.ts +13 -0
  73. package/src/helpers/setBinNumbers.ts +5 -0
  74. package/src/helpers/sortSpecialClassesLast.ts +7 -0
  75. package/src/helpers/tests/getColumnNames.test.ts +52 -0
  76. package/src/helpers/titleCase.ts +1 -1
  77. package/src/helpers/toggleLegendActive.ts +25 -0
  78. package/src/hooks/useApplyTooltipsToGeo.tsx +51 -0
  79. package/src/hooks/useColumnsRequiredChecker.ts +51 -0
  80. package/src/hooks/useGeoClickHandler.ts +45 -0
  81. package/src/hooks/useLegendSeparators.ts +26 -0
  82. package/src/hooks/useMapLayers.tsx +34 -60
  83. package/src/hooks/useModal.ts +22 -0
  84. package/src/hooks/useResizeObserver.ts +4 -5
  85. package/src/hooks/useStateZoom.tsx +52 -75
  86. package/src/hooks/useTooltip.ts +2 -3
  87. package/src/index.jsx +3 -9
  88. package/src/scss/editor-panel.scss +3 -99
  89. package/src/scss/main.scss +1 -19
  90. package/src/scss/map.scss +15 -220
  91. package/src/store/map.actions.ts +46 -0
  92. package/src/store/map.reducer.ts +96 -0
  93. package/src/types/Annotations.ts +24 -0
  94. package/src/types/MapConfig.ts +23 -3
  95. package/src/types/MapContext.ts +36 -35
  96. package/src/types/Modal.ts +1 -0
  97. package/src/types/RuntimeData.ts +3 -0
  98. package/LICENSE +0 -201
  99. package/examples/private/DEV-9644.json +0 -184
  100. package/examples/private/DEV-9989.json +0 -229
  101. package/examples/private/ardi.json +0 -180
  102. package/examples/private/colors 2.json +0 -416
  103. package/examples/private/colors.json +0 -416
  104. package/examples/private/colors.json.zip +0 -0
  105. package/examples/private/customColors.json +0 -45348
  106. package/examples/test.json +0 -183
  107. package/src/helpers/closeModal.ts +0 -9
  108. package/src/scss/btn.scss +0 -69
  109. package/src/scss/filters.scss +0 -27
  110. package/src/scss/variables.scss +0 -1
  111. /package/src/hooks/{useActiveElement.js → useActiveElement.ts} +0 -0
@@ -0,0 +1,46 @@
1
+ import { MapConfig, Coordinate } from '../types/MapConfig'
2
+ import { GeneratedLegend } from '../hooks/useGenerateRuntimeLegend'
3
+ import { VizFilter } from '@cdc/core/types/VizFilter'
4
+ import { type Action } from '@cdc/core/types/Action'
5
+ import { RuntimeData } from '../types/RuntimeData'
6
+ import { Modal } from '../types/Modal'
7
+
8
+ // Action Types
9
+ type SET_ACCESSIBLE_STATUS = Action<'SET_ACCESSIBLE_STATUS', string>
10
+ type SET_CONFIG = Action<'SET_CONFIG', MapConfig>
11
+ type SET_COVE_LOADED_HAS_RAN = Action<'SET_COVE_LOADED_HAS_RAN', boolean>
12
+ type SET_DISPLAY_PANEL = Action<'SET_DISPLAY_PANEL', boolean>
13
+ type SET_FILTERED_COUNTRY_CODE = Action<'SET_FILTERED_COUNTRY_CODE', string>
14
+ type SET_IS_DRAGGING_ANNOTATION = Action<'SET_IS_DRAGGING_ANNOTATION', boolean>
15
+ type SET_LOADING = Action<'SET_LOADING', boolean>
16
+ type SET_MODAL = Action<'SET_MODAL', Modal>
17
+ type SET_POSITION = Action<'SET_POSITION', { coordinates: Coordinate; zoom: number }>
18
+ type SET_REQUIRED_COLUMNS = Action<'SET_REQUIRED_COLUMNS', string[]>
19
+ type SET_RUNTIME_DATA = Action<'SET_RUNTIME_DATA', RuntimeData>
20
+ type SET_RUNTIME_FILTERS = Action<'SET_RUNTIME_FILTERS', VizFilter[]>
21
+ type SET_RUNTIME_LEGEND = Action<'SET_RUNTIME_LEGEND', GeneratedLegend | []>
22
+ type SET_SCALE = Action<'SET_SCALE', number>
23
+ type SET_STATE_TO_SHOW = Action<'SET_STATE_TO_SHOW', string>
24
+ type SET_TOPO_DATA = Action<'SET_TOPO_DATA', any>
25
+ type SET_TRANSLATE = Action<'SET_TRANSLATE', [number, number]>
26
+
27
+ export type MapActions =
28
+ | SET_ACCESSIBLE_STATUS
29
+ | SET_CONFIG
30
+ | SET_COVE_LOADED_HAS_RAN
31
+ | SET_DISPLAY_PANEL
32
+ | SET_FILTERED_COUNTRY_CODE
33
+ | SET_IS_DRAGGING_ANNOTATION
34
+ | SET_LOADING
35
+ | SET_MODAL
36
+ | SET_POSITION
37
+ | SET_REQUIRED_COLUMNS
38
+ | SET_RUNTIME_DATA
39
+ | SET_RUNTIME_FILTERS
40
+ | SET_RUNTIME_LEGEND
41
+ | SET_SCALE
42
+ | SET_STATE_TO_SHOW
43
+ | SET_TOPO_DATA
44
+ | SET_TRANSLATE
45
+
46
+ export default MapActions
@@ -0,0 +1,96 @@
1
+ import { MapConfig } from '../types/MapConfig'
2
+ import MapActions from './map.actions'
3
+ import defaults from './../data/initial-state'
4
+ import { devToolsWrapper } from '@cdc/core/helpers/withDevTools'
5
+ import _ from 'lodash'
6
+
7
+ export const getInitialState = (configObj = {}): MapState => {
8
+ return {
9
+ dataUrl: configObj.dataUrl || '',
10
+ config: _.merge({}, defaults, configObj),
11
+ loading: false,
12
+ accessibleStatus: '',
13
+ coveLoadedHasRan: false,
14
+ displayPanel: false,
15
+ filteredCountryCode: '',
16
+ isDraggingAnnotation: false,
17
+ topoData: null,
18
+ translate: [0, 0],
19
+ position: { coordinates: [0, 0], zoom: 1 },
20
+ projection: null,
21
+ requiredColumns: [],
22
+ scale: 1,
23
+ modal: null,
24
+ runtimeData: { init: true },
25
+ runtimeFilters: [],
26
+ runtimeLegend: [],
27
+ stateToShow: ''
28
+ }
29
+ }
30
+
31
+ export type MapState = {
32
+ config: MapConfig
33
+ loading: boolean
34
+ accessibleStatus: string
35
+ coveLoadedHasRan: boolean
36
+ displayPanel: boolean
37
+ filteredCountryCode: string
38
+ isDraggingAnnotation: boolean
39
+ topoData: object | null
40
+ translate: number[]
41
+ position: { coordinates: number[]; zoom: number }
42
+ projection: object | null
43
+ requiredColumns: string[]
44
+ scale: number
45
+ modal: object | null
46
+ runtimeData: object
47
+ runtimeFilters: object[]
48
+ runtimeLegend: object[]
49
+ stateToShow: string
50
+ dataUrl: string
51
+ }
52
+
53
+ const reducer = (state: MapState, action: MapActions): MapState => {
54
+ switch (action.type) {
55
+ case 'SET_CONFIG':
56
+ return { ...state, config: action.payload }
57
+ case 'SET_LOADING':
58
+ return { ...state, loading: action.payload }
59
+ case 'SET_ACCESSIBLE_STATUS':
60
+ return { ...state, accessibleStatus: action.payload }
61
+ case 'SET_COVE_LOADED_HAS_RAN':
62
+ return { ...state, coveLoadedHasRan: action.payload }
63
+ case 'SET_DISPLAY_PANEL':
64
+ return { ...state, displayPanel: action.payload }
65
+ case 'SET_FILTERED_COUNTRY_CODE':
66
+ return { ...state, filteredCountryCode: action.payload }
67
+ case 'SET_IS_DRAGGING_ANNOTATION':
68
+ return { ...state, isDraggingAnnotation: action.payload }
69
+ case 'SET_TOPO_DATA':
70
+ return { ...state, topoData: action.payload }
71
+ case 'SET_TRANSLATE':
72
+ return { ...state, translate: action.payload }
73
+ case 'SET_POSITION':
74
+ return { ...state, position: action.payload }
75
+ case 'SET_REQUIRED_COLUMNS':
76
+ return { ...state, requiredColumns: action.payload }
77
+ case 'SET_SCALE':
78
+ return { ...state, scale: action.payload }
79
+ case 'SET_MODAL':
80
+ return { ...state, modal: action.payload }
81
+ case 'SET_RUNTIME_DATA':
82
+ return { ...state, runtimeData: action.payload }
83
+ case 'SET_RUNTIME_FILTERS':
84
+ return { ...state, runtimeFilters: action.payload }
85
+ case 'SET_RUNTIME_LEGEND':
86
+ return { ...state, runtimeLegend: action.payload }
87
+ case 'SET_STATE_TO_SHOW':
88
+ return { ...state, stateToShow: action.payload }
89
+ default:
90
+ return state
91
+ }
92
+ }
93
+
94
+ export const mapReducer = devToolsWrapper(reducer)
95
+
96
+ export type MapReducerType<MapState, MapActions> = (state: MapState, action: MapActions) => MapState
@@ -0,0 +1,24 @@
1
+ type Annotation = {
2
+ /** The x-coordinate of the annotation */
3
+ x: number
4
+ /** The y-coordinate of the annotation */
5
+ y: number
6
+ /** The x-offset for the annotation's text */
7
+ dx: number
8
+ /** The y-offset for the annotation's text */
9
+ dy: number
10
+ /** The opacity level of the annotation */
11
+ opacity: number
12
+ /** The text content of the annotation */
13
+ text: string
14
+ /** The type of connection for the annotation */
15
+ connectionType: string
16
+ edit: {
17
+ /** Indicates if the label can be edited */
18
+ label: boolean
19
+ /** Indicates if the subject can be edited */
20
+ subject: boolean
21
+ }
22
+ /** The type of marker used for the annotation */
23
+ marker: 'arrow' | 'circle'
24
+ }
@@ -23,7 +23,7 @@ export type MapVisualSettings = {
23
23
  additionalCityStyles: [] | [{ label: string; column: string; value: string; shape: string }]
24
24
  }
25
25
 
26
- type PatternSelection = {
26
+ export type PatternSelection = {
27
27
  // dropdown selection for getting the column used on a pattern
28
28
  dataKey: string
29
29
  // text field input to match values found in the column
@@ -68,9 +68,17 @@ export type HexMapSettings = {
68
68
 
69
69
  export type Coordinate = [number, number]
70
70
 
71
+ export type DataRow = {
72
+ uid?: string // optional 'uid' property
73
+ [key: string]: any // allowing any additional properties with a dynamic key (e.g., for `configPrimaryName`)
74
+ }
75
+
71
76
  export type MapConfig = Visualization & {
72
- color: string // map color palette
73
- customColors: string[] // custom color palette
77
+ annotations: Annotation[]
78
+ // map color palette
79
+ color: string
80
+ // custom color palette
81
+ customColors: string[]
74
82
  columns: {
75
83
  geo: GeoColumnProperties
76
84
  primary: PrimaryColumnProperties
@@ -80,9 +88,13 @@ export type MapConfig = Visualization & {
80
88
  categorical: { name: string }
81
89
  }
82
90
  dataUrl: string
91
+ data: DataRow[]
83
92
  runtimeDataUrl: string
84
93
  filters: VizFilter[]
85
94
  general: {
95
+ navigationTarget: '_self' | '_blank'
96
+ subtext: string
97
+ introText: string
86
98
  allowMapZoom: boolean
87
99
  convertFipsCodes: boolean
88
100
  displayAsHex: boolean
@@ -90,6 +102,8 @@ export type MapConfig = Visualization & {
90
102
  fullBorder: boolean
91
103
  geoBorderColor: string
92
104
  geoLabelOverride: string
105
+ // whether to use the old custom quantile scaling method or new custom quantile scaling method
106
+ equalNumberOptIn: boolean
93
107
  geoType:
94
108
  | 'us'
95
109
  | 'us-region'
@@ -109,6 +123,8 @@ export type MapConfig = Visualization & {
109
123
  isReversed: boolean
110
124
  }
111
125
  showDownloadMediaButton: boolean
126
+ showDownloadImgButton: boolean
127
+ showDownloadPdfButton: boolean
112
128
  showSidebar: boolean
113
129
  showTitle: boolean
114
130
  statePicked: {
@@ -142,6 +158,7 @@ export type MapConfig = Visualization & {
142
158
  tickRotation: string
143
159
  hideBorder: false
144
160
  singleColumnLegend: false
161
+ separators?: string
145
162
  }
146
163
  table: {
147
164
  label: string
@@ -154,6 +171,7 @@ export type MapConfig = Visualization & {
154
171
  forceDisplay: boolean
155
172
  download: boolean
156
173
  indexLabel: string
174
+ cellMinWidth: string
157
175
  }
158
176
  tooltips: {
159
177
  appearanceType: 'hover' | 'click'
@@ -175,6 +193,8 @@ export type MapConfig = Visualization & {
175
193
  filterBehavior: string
176
194
  filterIntro: string
177
195
  visual: MapVisualSettings
196
+ // visualization type
197
+ type: 'map'
178
198
  // version of the map
179
199
  version: Version
180
200
  }
@@ -1,51 +1,52 @@
1
- import { type MapConfig } from './MapConfig'
1
+ import { DataRow, type MapConfig } from './MapConfig'
2
2
  import { type ViewPort } from '@cdc/core/types/ViewPort'
3
+ import { DimensionsType } from '@cdc/core/types/Dimensions'
4
+ import { VizFilter } from '@cdc/core/types/VizFilter'
5
+ import { type RefObject } from 'react'
3
6
 
4
7
  export type MapContext = {
5
- applyLegendToRow
6
- applyTooltipsToGeo
7
8
  currentViewport: ViewPort
8
- data
9
- displayDataAsText
10
- displayGeoName
11
- filteredCountryCode
12
- generateColorsArray
13
- generateRuntimeData
14
- geoClickHandler
9
+ content: { geoName: string; keyedData: Record<string, any> }
10
+ data: DataRow[]
11
+ dimensions: DimensionsType
12
+ displayDataAsText: string | number
13
+ displayGeoName: (key: string, convertFipsCodes: boolean) => string
14
+ filteredCountryCode: string
15
+ generateRuntimeData: (
16
+ configObj: MapConfig,
17
+ filters: VizFilter[],
18
+ hash: number,
19
+ test?: boolean
20
+ ) => { [uid: string]: DataRow }
21
+ geoClickHandler: (geoDisplayName: string, geoData: object) => void
15
22
  handleCircleClick: Function
16
23
  handleDragStateChange: Function
17
24
  isDraggingAnnotation: boolean
18
- hasZoom
19
- innerContainerRef
20
- isDashboard
21
- isDebug
22
- isEditor
25
+ innerContainerRef: RefObject<HTMLDivElement>
26
+ isDashboard: boolean
27
+ isEditor: boolean
23
28
  isFilterValueSupported: boolean
24
- loadConfig
29
+ loadConfig: (configObj: MapConfig) => void
25
30
  logo: string
26
- position
27
- resetLegendToggles
28
- runtimeFilters
31
+ mapId: string
32
+ position: 'side' | 'top' | 'bottom'
33
+ resetLegendToggles: Function
34
+ runtimeFilters: Function
35
+ legendMemo: Function
36
+ legendSpecialClassLastMemo: Function
29
37
  runtimeLegend
30
- setAccessibleStatus
31
- setFilteredCountryCode
32
- setParentConfig
33
- setPosition
34
- setRuntimeData
35
- setRuntimeFilters
36
- setRuntimeLegend
37
- setSharedFilterValue
38
- setState: (newState: MapConfig) => MapConfig
39
- state: MapConfig
40
- viewport
41
- setStateToShow: (string) => void
38
+ setParentConfig: Function
39
+ setRuntimeData: Function
40
+ setRuntimeFilters: Function
41
+ setRuntimeLegend: Function
42
+ setSharedFilterValue: Function
43
+ setConfig: (newState: MapConfig) => MapConfig
44
+ config: MapConfig
45
+ viewport: ViewPort
42
46
  stateToShow: string
43
47
  scale: number
44
48
  translate: [number, number]
45
- topoData
46
- setScale: (number) => void
47
- setTranslate: ([x, y]: [number, number]) => void
49
+ topoData: object
48
50
  runtimeData: Object[]
49
51
  tooltipId: string
50
- setTopoData: Function
51
52
  }
@@ -0,0 +1 @@
1
+ export type Modal = { geoName: string; keyedData: Record<string, any>[] }
@@ -0,0 +1,3 @@
1
+ import { DataRow } from './MapConfig'
2
+
3
+ export type RuntimeData = { [uid: string]: DataRow }[]
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.