back-testing-react 1.0.5 → 1.0.6

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 (58) hide show
  1. package/dist/cjs/index.js +17 -17
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +17 -17
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.ts +10 -1
  6. package/package.json +5 -1
  7. package/src/components/back-testing-cat-legend/back-testing-cat-legend.css +1 -1
  8. package/src/components/back-testing-cat-legend/back-testing-cat-legend.tsx +7 -7
  9. package/src/components/back-testing-map/back-testing-map.css +1 -1
  10. package/src/components/back-testing-map/back-testing-map.tsx +50 -17
  11. package/src/components/back-testing-map/back-testing-map.types.ts +67 -10
  12. package/src/components/back-testing-payout-info/back-testing-payout-info.css +112 -0
  13. package/src/components/back-testing-payout-info/back-testing-payout-info.tsx +371 -0
  14. package/src/components/back-testing-payout-info/back-testing-payout-info.types.ts +9 -0
  15. package/src/components/back-testing-stepper/back-testing-stepper.css +30 -0
  16. package/src/components/back-testing-stepper/back-testing-stepper.tsx +322 -0
  17. package/src/components/back-testing-stepper/back-testing-stepper.types.ts +41 -0
  18. package/src/components/back-testing-stepper/inputs/distance-input/distance-input.css +57 -0
  19. package/src/components/back-testing-stepper/inputs/distance-input/distance-input.stories.tsx +20 -0
  20. package/src/components/back-testing-stepper/inputs/distance-input/distance-input.tsx +93 -0
  21. package/src/components/back-testing-stepper/inputs/distance-input/distance-input.types.ts +41 -0
  22. package/src/components/back-testing-stepper/inputs/file-input/file-input.css +26 -0
  23. package/src/components/back-testing-stepper/inputs/file-input/file-input.stories.tsx +20 -0
  24. package/src/components/back-testing-stepper/inputs/file-input/file-input.tsx +43 -0
  25. package/src/components/back-testing-stepper/inputs/file-input/file-input.types.ts +10 -0
  26. package/src/components/back-testing-stepper/inputs/number-input/number-input.css +48 -0
  27. package/src/components/back-testing-stepper/inputs/number-input/number-input.stories.tsx +20 -0
  28. package/src/components/back-testing-stepper/inputs/number-input/number-input.tsx +55 -0
  29. package/src/components/back-testing-stepper/inputs/number-input/number-input.types.ts +12 -0
  30. package/src/components/back-testing-stepper/inputs/select-input/select-input.css +13 -0
  31. package/src/components/back-testing-stepper/inputs/select-input/select-input.stories.tsx +27 -0
  32. package/src/components/back-testing-stepper/inputs/select-input/select-input.tsx +63 -0
  33. package/src/components/back-testing-stepper/inputs/select-input/select-input.types.ts +8 -0
  34. package/src/components/back-testing-stepper/inputs/text-input/text-input.css +35 -0
  35. package/src/components/back-testing-stepper/inputs/text-input/text-input.stories.tsx +18 -0
  36. package/src/components/back-testing-stepper/inputs/text-input/text-input.tsx +32 -0
  37. package/src/components/back-testing-stepper/inputs/text-input/text-input.types.ts +6 -0
  38. package/src/components/back-testing-stepper/inputs/worldmap-search/worldmap-search.css +16 -0
  39. package/src/components/back-testing-stepper/inputs/worldmap-search/worldmap-search.stories.tsx +20 -0
  40. package/src/components/back-testing-stepper/inputs/worldmap-search/worldmap-search.tsx +151 -0
  41. package/src/components/back-testing-stepper/inputs/worldmap-search/worldmap-search.types.ts +11 -0
  42. package/src/components/back-testing-stepper/steps/input-anemometer/input-anemometer.css +0 -0
  43. package/src/components/back-testing-stepper/steps/input-anemometer/input-anemometer.tsx +188 -0
  44. package/src/components/back-testing-stepper/steps/input-anemometer/input-anemometer.types.ts +16 -0
  45. package/src/components/back-testing-stepper/steps/input-ciac/input-ciac.scss +0 -0
  46. package/src/components/back-testing-stepper/steps/input-ciac/input-ciac.tsx +225 -0
  47. package/src/components/back-testing-stepper/steps/input-ciac/input-ciac.types.ts +17 -0
  48. package/src/components/back-testing-stepper/steps/input-location/input-location.css +0 -0
  49. package/src/components/back-testing-stepper/steps/input-location/input-location.tsx +135 -0
  50. package/src/components/back-testing-stepper/steps/input-location/input-location.types.ts +16 -0
  51. package/src/components/back-testing-stepper/steps/input-proxy/input-proxy.css +0 -0
  52. package/src/components/back-testing-stepper/steps/input-proxy/input-proxy.tsx +173 -0
  53. package/src/components/back-testing-stepper/steps/input-proxy/input-proxy.types.ts +16 -0
  54. package/src/components/back-testing-stepper/steps/step.types.ts +58 -0
  55. package/src/components/back-testing-wizard/back-testing-wizard.css +36 -0
  56. package/src/components/back-testing-wizard/back-testing-wizard.stories.tsx +734 -0
  57. package/src/components/back-testing-wizard/back-testing-wizard.tsx +102 -0
  58. package/src/components/back-testing-wizard/back-testing-wizard.types.ts +12 -0
package/dist/index.d.ts CHANGED
@@ -58,11 +58,20 @@ interface BackTestingMapProps {
58
58
  ciacPayouts?: Payout[];
59
59
  includeNoNameStorms?: boolean;
60
60
  includeZeroPayouts?: boolean;
61
+ proxyEnabled?: boolean;
62
+ anemometerEnabled?: boolean;
63
+ ciacEnabled?: boolean;
64
+ isCalculatePayoutEnabled?: boolean;
65
+ onCalculatePayoutEnabledChanged?: (e: boolean) => void;
61
66
  onViewChange?: (view: MapView) => void;
67
+ stormPayouts: StormPayout[];
62
68
  onCalculatePayouts?: (payouts: StormPayout[]) => void;
69
+ onLoad?: (e: React.MutableRefObject<mapboxgl.Map | undefined>) => void;
70
+ appStatus: ('loading' | 'idle');
71
+ onAppStatusChange: (e: 'loading' | 'idle') => void;
63
72
  }
64
73
  interface BackTestingActions {
65
- calculatePayouts: (proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNameStorms: boolean, includeZeroPayouts: boolean, limit: number) => void;
74
+ calculatePayouts: (proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNameStorms: boolean, includeZeroPayouts: boolean, limit: number, proxyEnabled: boolean, anemometerEnabled: boolean, ciacEnabled: boolean) => void;
66
75
  }
67
76
  declare enum MapView {
68
77
  CAT_INTENSITY = "__cat_view",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "back-testing-react",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Parametric back testing application developed by NormanMax Insurance Solutions",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -41,10 +41,14 @@
41
41
  "@emotion/react": "^11.13.3",
42
42
  "@emotion/styled": "^11.13.0",
43
43
  "@mapbox/search-js-core": "^1.0.0-beta.22",
44
+ "@mapbox/search-js-react": "^1.0.0-beta.24",
45
+ "@mui/icons-material": "^6.1.8",
44
46
  "@mui/material": "^6.1.6",
45
47
  "@turf/turf": "^7.1.0",
48
+ "@types/papaparse": "^5.3.15",
46
49
  "@types/react-dom": "^18.3.1",
47
50
  "mapbox-gl": "^3.8.0",
51
+ "papaparse": "^5.4.1",
48
52
  "rimraf": "^6.0.1"
49
53
  },
50
54
  "peerDependencies": {
@@ -20,7 +20,7 @@
20
20
  left: 5px;
21
21
  }
22
22
 
23
- .legend > .item-container:hover > item {
23
+ .legend > .item-container:hover > .item {
24
24
  opacity: 0.2;
25
25
  }
26
26
 
@@ -7,14 +7,14 @@ const BackTestingCatLegend: React.FC<BackTestingCatLegendProps> = (props) => {
7
7
  return(
8
8
  <div className={props.className + " legend"}>
9
9
  <div className="item-container">
10
- <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 5</span>}><span className="item" style={{backgroundColor:generateCATColor(5)}}/></Tooltip>
11
- <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 4</span>}><span className="item" style={{backgroundColor:generateCATColor(4)}}/></Tooltip>
12
- <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 3</span>}><span className="item" style={{backgroundColor:generateCATColor(3)}}/></Tooltip>
13
- <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 2</span>}><span className="item" style={{backgroundColor:generateCATColor(2)}}/></Tooltip>
14
- <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 1</span>}><span className="item" style={{backgroundColor:generateCATColor(1)}}/></Tooltip>
15
- <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Tropical Storm</span>}><span className="item" style={{backgroundColor:generateCATColor(0)}}/></Tooltip>
16
- <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Tropical Depression</span>}><span className="item" style={{backgroundColor:generateCATColor(-1)}}/></Tooltip>
17
10
  <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Tropical Expression</span>}><span className="item" style={{backgroundColor:generateCATColor(-2)}}/></Tooltip>
11
+ <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Tropical Depression</span>}><span className="item" style={{backgroundColor:generateCATColor(-1)}}/></Tooltip>
12
+ <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Tropical Storm</span>}><span className="item" style={{backgroundColor:generateCATColor(0)}}/></Tooltip>
13
+ <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 1</span>}><span className="item" style={{backgroundColor:generateCATColor(1)}}/></Tooltip>
14
+ <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 2</span>}><span className="item" style={{backgroundColor:generateCATColor(2)}}/></Tooltip>
15
+ <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 3</span>}><span className="item" style={{backgroundColor:generateCATColor(3)}}/></Tooltip>
16
+ <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 4</span>}><span className="item" style={{backgroundColor:generateCATColor(4)}}/></Tooltip>
17
+ <Tooltip title={<span style={{ fontSize:'1.25em', padding:'2px' }}>Category 5</span>}><span className="item" style={{backgroundColor:generateCATColor(5)}}/></Tooltip>
18
18
  </div>
19
19
  </div>
20
20
  );
@@ -5,7 +5,7 @@ body{
5
5
 
6
6
  .map__wrapper{
7
7
  width: 100%;
8
- height: 100vh;
8
+ height: 100%;
9
9
  display: grid;
10
10
  grid-template-columns: 1fr;
11
11
  }
@@ -23,7 +23,6 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
23
23
  const [locationMarker, setLocationMarker] = useState<mapboxgl.Marker>(new mapboxgl.Marker());
24
24
  const [catCircle, setCatCircle] = useState<Feature<Polygon, GeoJsonProperties> | undefined>(undefined);
25
25
  const [mapView, setMapView] = useState<MapView>(MapView.CAT_INTENSITY);
26
- const [payouts, setPayouts] = useState<StormPayout[]>([]);
27
26
 
28
27
  const toggleView = (
29
28
  event: React.MouseEvent<HTMLElement>,
@@ -39,17 +38,17 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
39
38
  };
40
39
 
41
40
  useImperativeHandle(ref, () => ({
42
- calculatePayouts(proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNamedStorms: boolean, includeZeroPayouts: boolean, limit: number){
43
- calculatePayouts(proxyPayouts, anemometerCode, anemometerPayouts, ciacPayouts, includeNoNamedStorms, includeZeroPayouts, limit);
41
+ calculatePayouts(proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNamedStorms: boolean, includeZeroPayouts: boolean, limit: number, proxyEnabled: boolean, anemometerEnabled: boolean, ciacEnabled: boolean){
42
+ calculatePayouts(proxyPayouts, anemometerCode, anemometerPayouts, ciacPayouts, includeNoNamedStorms, includeZeroPayouts, limit, proxyEnabled, anemometerEnabled, ciacEnabled);
44
43
  }
45
44
  }));
46
45
 
47
- function calculatePayouts(proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNamedStorms: boolean, includeZeroPayouts: boolean, limit: number){
46
+ function calculatePayouts(proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNamedStorms: boolean, includeZeroPayouts: boolean, limit: number, proxyEnabled: boolean, anemometerEnabled: boolean, ciacEnabled: boolean){
48
47
  if(props.ciacRadius != undefined && props.ciacRadius != null && props.location != undefined && props.location != null){
49
48
  let latLng : LngLatLike = [props.location.longitude,props.location.latitude];
50
- const proxy = generateProxyRequest(latLng as [number,number], 1000, proxyPayouts);
51
- const anemometer = generateAnemometerRequest(latLng as [number,number], anemometerCode, anemometerPayouts);
52
- const ciac = generateCIACRequest(latLng as [number,number], props.ciacRadius, includeNoNamedStorms, ciacPayouts);
49
+ const proxy = generateProxyRequest(latLng as [number,number], 1000, proxyPayouts, proxyEnabled);
50
+ const anemometer = generateAnemometerRequest(latLng as [number,number], anemometerCode, anemometerPayouts, anemometerEnabled);
51
+ const ciac = generateCIACRequest(latLng as [number,number], props.ciacRadius, includeNoNamedStorms, ciacPayouts, ciacEnabled);
53
52
  let request : PayoutRequest = {
54
53
  includeZeroPayouts: includeZeroPayouts,
55
54
  limit: limit,
@@ -59,15 +58,22 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
59
58
  anemometer: anemometer,
60
59
  ciac: ciac
61
60
  }
61
+ props.onAppStatusChange('loading')
62
62
  fetchPayouts(request, props.apiAccessToken).then((data) => {
63
63
  let storms = data.payouts.map((storm,index) => { storm.color = randomColor(index); return storm})
64
- setPayouts(storms);
65
64
  if(props.onCalculatePayouts != undefined){
66
65
  props.onCalculatePayouts(storms);
67
66
  }
68
67
  }, (err) => {
69
68
  console.error(err);
70
69
  throw Error(err);
70
+ }).finally(() => {
71
+ if(props.isCalculatePayoutEnabled != undefined){
72
+ if(props.onCalculatePayoutEnabledChanged != undefined){
73
+ props.onCalculatePayoutEnabledChanged(false);
74
+ props.onAppStatusChange('idle')
75
+ }
76
+ }
71
77
  })
72
78
  }
73
79
  }
@@ -418,7 +424,9 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
418
424
  }
419
425
  popup.remove();
420
426
  });
421
-
427
+ if(props.onLoad != undefined){
428
+ props.onLoad(mapInstanceRef);
429
+ }
422
430
  });
423
431
  return () => mapInstanceRef.current?.remove();
424
432
 
@@ -445,15 +453,12 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
445
453
  let latLng : LngLatLike = [props.location.longitude,props.location.latitude];
446
454
  var circle = turf.circle(latLng as [number,number], props.ciacRadius, { steps:200, units: "miles"});
447
455
  setCatCircle(catCircle)
448
-
449
456
  const source = mapInstanceRef.current.getSource(CIAC_SOURCE)
450
457
  if (source){
451
- console.log("draw circle");
452
458
  (source as GeoJSONSource).setData({type: 'FeatureCollection', features: [circle]})
453
459
  }
454
460
  }
455
461
  } else {
456
- console.log("skip circle")
457
462
  if(mapInstanceRef?.current){
458
463
  setCatCircle(undefined)
459
464
  const source = mapInstanceRef.current.getSource(CIAC_SOURCE)
@@ -467,14 +472,42 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
467
472
 
468
473
  useEffect(() => {
469
474
  if(mapLoaded){
470
- updateStormTracks(payouts,mapView)
475
+ updateStormTracks(props.stormPayouts,mapView)
471
476
  }
472
- },[mapLoaded,payouts,mapView])
477
+ },[mapLoaded,props.stormPayouts,mapView])
473
478
 
474
479
  useEffect(() => {
475
480
  if(mapLoaded){
476
- if(props.location && props.limit && props.proxyPayouts && props.anemometerCode && props.anemometerPayouts && props.ciacRadius && props.ciacRadius && props.ciacPayouts && mapInstanceRef){
477
- calculatePayouts(props.proxyPayouts, props.anemometerCode, props.anemometerPayouts, props.ciacPayouts, false, false, props.limit)
481
+ if(props.location && props.limit && props.proxyPayouts && (props.anemometerCode != undefined && props.anemometerCode != null) && props.anemometerPayouts && props.ciacRadius && props.ciacRadius && props.ciacPayouts && mapInstanceRef){
482
+ if(props.isCalculatePayoutEnabled != undefined){
483
+ if(props.isCalculatePayoutEnabled == true){
484
+ calculatePayouts(
485
+ props.proxyPayouts,
486
+ props.anemometerCode,
487
+ props.anemometerPayouts,
488
+ props.ciacPayouts,
489
+ false,
490
+ false,
491
+ props.limit,
492
+ props.proxyEnabled != undefined ? props.proxyEnabled : true,
493
+ props.anemometerEnabled != undefined ? props.anemometerEnabled : true,
494
+ props.ciacEnabled != undefined ? props.ciacEnabled : true
495
+ )
496
+ }
497
+ }else {
498
+ calculatePayouts(
499
+ props.proxyPayouts,
500
+ props.anemometerCode,
501
+ props.anemometerPayouts,
502
+ props.ciacPayouts,
503
+ false,
504
+ false,
505
+ props.limit,
506
+ props.proxyEnabled != undefined ? props.proxyEnabled : true,
507
+ props.anemometerEnabled != undefined ? props.anemometerEnabled : true,
508
+ props.ciacEnabled != undefined ? props.ciacEnabled : true
509
+ )
510
+ }
478
511
  }
479
512
  }
480
513
  },[props.location, props.limit, props.proxyPayouts, props.anemometerCode, props.anemometerPayouts, props.ciacRadius, props.ciacPayouts, props.ciacRadius, mapInstanceRef, mapLoaded])
@@ -494,7 +527,7 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
494
527
  <ToggleButton value={MapView.CAT_INTENSITY}>CAT Strength View</ToggleButton>
495
528
  <ToggleButton value={MapView.STORMS}>Storms View</ToggleButton>
496
529
  </ToggleButtonGroup>
497
- {mapView == MapView.STORMS && <BackTestingStormLegend stormTracks={payouts}/>}
530
+ {mapView == MapView.STORMS && <BackTestingStormLegend stormTracks={props.stormPayouts}/>}
498
531
  <div ref={mapContainerRef} className="map__container" />
499
532
  </div>
500
533
  );
@@ -59,12 +59,21 @@ export interface BackTestingMapProps {
59
59
  ciacPayouts?: Payout[],
60
60
  includeNoNameStorms?: boolean,
61
61
  includeZeroPayouts?: boolean,
62
- onViewChange?: (view: MapView) => void
63
- onCalculatePayouts?: (payouts: StormPayout[]) => void
62
+ proxyEnabled?: boolean,
63
+ anemometerEnabled?: boolean,
64
+ ciacEnabled?: boolean,
65
+ isCalculatePayoutEnabled?: boolean,
66
+ onCalculatePayoutEnabledChanged?: (e:boolean) => void,
67
+ onViewChange?: (view: MapView) => void,
68
+ stormPayouts: StormPayout[],
69
+ onCalculatePayouts?: (payouts: StormPayout[]) => void ,
70
+ onLoad?: (e:React.MutableRefObject<mapboxgl.Map | undefined>) => void
71
+ appStatus: ('loading'| 'idle')
72
+ onAppStatusChange: (e: 'loading'| 'idle') => void
64
73
  }
65
74
 
66
75
  export interface BackTestingActions {
67
- calculatePayouts: (proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNameStorms: boolean, includeZeroPayouts: boolean, limit: number) => void,
76
+ calculatePayouts: (proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNameStorms: boolean, includeZeroPayouts: boolean, limit: number, proxyEnabled: boolean, anemometerEnabled: boolean, ciacEnabled: boolean) => void,
68
77
  }
69
78
 
70
79
  export enum MapView {
@@ -141,10 +150,10 @@ export function randomColor(index:number): string {
141
150
  return `hsla(${hue}, 90%, 60%, 1)`;
142
151
  }
143
152
 
144
- export function generateProxyRequest(latLng: [number,number], radius: number, payouts: Payout[] | undefined ){
153
+ export function generateProxyRequest(latLng: [number|undefined,number|undefined], radius: number, payouts: Payout[] | undefined, enabled: boolean ){
145
154
  let coord = (latLng);
146
155
  let proxy : ProxyRequest = {
147
- enabled:true,
156
+ enabled:enabled,
148
157
  radius: radius,
149
158
  latitude: coord[1],
150
159
  longitude: coord[0],
@@ -153,10 +162,10 @@ export function generateProxyRequest(latLng: [number,number], radius: number, pa
153
162
  return proxy
154
163
  }
155
164
 
156
- export function generateAnemometerRequest(latLng: [number,number], anemometerCode:string, payouts: Payout[] | undefined){
165
+ export function generateAnemometerRequest(latLng: [number|undefined,number|undefined], anemometerCode:string, payouts: Payout[] | undefined, enabled: boolean){
157
166
  let coord = (latLng);
158
167
  let anemometer : AnemometerRequest = {
159
- enabled:true,
168
+ enabled:enabled,
160
169
  code:anemometerCode,
161
170
  latitude: coord[1],
162
171
  longitude: coord[0],
@@ -165,10 +174,10 @@ export function generateAnemometerRequest(latLng: [number,number], anemometerCod
165
174
  return anemometer
166
175
  }
167
176
 
168
- export function generateCIACRequest(latLng: [number,number], radius: number | undefined, includeNoNameStorms: boolean, payouts: Payout[] | undefined){
177
+ export function generateCIACRequest(latLng: [number|undefined,number|undefined], radius: number | undefined, includeNoNameStorms: boolean, payouts: Payout[] | undefined, enabled: boolean){
169
178
  let coord = (latLng);
170
179
  let ciac : CIACRequest = {
171
- enabled:true,
180
+ enabled:enabled,
172
181
  shapes:[{
173
182
  type: "__circle",
174
183
  latitude: coord[1],
@@ -179,4 +188,52 @@ export function generateCIACRequest(latLng: [number,number], radius: number | un
179
188
  payouts: payouts
180
189
  }
181
190
  return ciac
182
- }
191
+ }
192
+
193
+ export function generateInitialProxyRequest() : ProxyRequest {
194
+ return {
195
+ enabled:true,
196
+ latitude: undefined,
197
+ longitude: undefined,
198
+ radius: 1000,
199
+ payouts: undefined
200
+ }
201
+ }
202
+
203
+ export function generateInitialAnemometerRequest() : AnemometerRequest {
204
+ return {
205
+ enabled:true,
206
+ code: "",
207
+ latitude: undefined,
208
+ longitude: undefined,
209
+ payouts: undefined
210
+ }
211
+ }
212
+
213
+ export function generateInitialCIACRequest() : CIACRequest {
214
+ return {
215
+ enabled:true,
216
+ includeNotNamedStorms: false,
217
+ shapes: [
218
+ {
219
+ type: "__circle",
220
+ latitude: undefined,
221
+ longitude: undefined,
222
+ radius: 15
223
+ }
224
+ ],
225
+ payouts: undefined
226
+ }
227
+ }
228
+
229
+ export function generateInitialPayoutRequest() : PayoutRequest {
230
+ return {
231
+ limit: 0,
232
+ latitude: undefined,
233
+ longitude: undefined,
234
+ includeZeroPayouts: false,
235
+ proxy: generateInitialProxyRequest(),
236
+ anemometer: generateInitialAnemometerRequest(),
237
+ ciac: generateInitialCIACRequest()
238
+ }
239
+ }
@@ -0,0 +1,112 @@
1
+ .payout-info-container {
2
+ padding:0;
3
+ font-family: system-ui, sans-serif;
4
+ }
5
+
6
+ .payout-info-container .header{
7
+ margin: 15px;
8
+ }
9
+
10
+ .payout-info-container ::-webkit-scrollbar{
11
+ width: 10px;
12
+ }
13
+
14
+ .payout-info-container ::-webkit-scrollbar-track {
15
+ background: #f1f1f1;
16
+ }
17
+
18
+ .payout-info-container ::-webkit-scrollbar-thumnb {
19
+ background: #c7c6c6;
20
+ }
21
+
22
+ .payout-info-container ::-webkit-scrollbar-thumb:hover {
23
+ background: #868686;
24
+ }
25
+
26
+ .payout-info-container .wind {
27
+ height: 25px;
28
+ line-height: 25px;
29
+ text-align: center;
30
+ color: black;
31
+ font-weight: 700;
32
+ font-size: 0.8em;
33
+ padding: 3px 10px;
34
+ border-radius: 2px;
35
+ border: 0.5px solid darkgray;
36
+ }
37
+
38
+ .payout-info-container .cat{
39
+ height: 25px;
40
+ line-height: 25px;
41
+ text-align: center;
42
+ color: white;
43
+ font-weight: 700;
44
+ font-size: 0.8em;
45
+ padding: 3px 10px;
46
+ border-radius: 2px;
47
+ margin-right: 5px;
48
+ }
49
+
50
+ .payout-info-container .cat.cat-5{
51
+ background-color: #fc5c0d;
52
+ }
53
+
54
+ .payout-info-container .cat.cat-4{
55
+ background-color: #fa8d0e;
56
+ }
57
+
58
+ .payout-info-container .cat.cat-3{
59
+ background-color: #f7be0f;
60
+ }
61
+
62
+ .payout-info-container .cat.cat-2{
63
+ background-color: #f6d70f;
64
+ }
65
+
66
+ .payout-info-container .cat.cat-1{
67
+ background-color: #c0e826;
68
+ }
69
+
70
+ .payout-info-container .cat.cat-0{
71
+ background-color: #9cf435;
72
+ }
73
+
74
+ .payout-info-container .cat.cat--1{
75
+ background-color: #78ff44;
76
+ }
77
+
78
+ .payout-info-container .cat.cat--2{
79
+ background-color: #78ff44;
80
+ }
81
+
82
+ .payout-info-container .cat.cat--3{
83
+ background-color: #78ff44;
84
+ }
85
+
86
+ .payout-info-container .cat.cat--4{
87
+ background-color: #78ff44;
88
+ }
89
+
90
+ .payout-info-container .cat.cat--5{
91
+ background-color: #78ff44;
92
+ }
93
+
94
+ .payout-info-container .cat.cat--10{
95
+ background-color: #7d837b;
96
+ }
97
+
98
+ .payout-info-container .scroll-container{
99
+ height: calc(100vh - 2.5em - 15px - 15px - 75px);
100
+ overflow-y:hidden;
101
+ scrollbar-gutter: stable;
102
+ position: relative;
103
+ top: 10px;
104
+ }
105
+
106
+ .payout-info-container .scroll-container:hover{
107
+ overflow-y: auto;
108
+ }
109
+
110
+ .payout-info-container .scroll-container .card-container:last-child div{
111
+ margin-bottom: 0px;
112
+ }