back-testing-react 1.0.13 → 1.0.14
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.
- package/README.md +4 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/back-testing-map/back-testing-map.service.ts +1 -44
- package/src/components/back-testing-map/back-testing-map.tsx +3 -3
- package/src/components/back-testing-map/back-testing-map.types.ts +44 -2
- package/src/components/back-testing-map/index.ts +6 -1
- package/src/components/back-testing-payout-info/back-testing-payout-info.tsx +1 -2
- package/src/components/back-testing-payout-info/back-testing-payout-info.types.ts +1 -1
- package/src/components/back-testing-stepper/back-testing-stepper.css +20 -0
- package/src/components/back-testing-stepper/back-testing-stepper.tsx +1 -1
- package/src/components/back-testing-stepper/back-testing-stepper.types.ts +1 -1
- package/src/components/back-testing-storm-legend/back-testing-storm-legend.stories.tsx +1 -1
- package/src/components/back-testing-storm-legend/back-testing-storm-legend.tsx +1 -1
- package/src/components/back-testing-storm-legend/back-testing-storm-legend.types.ts +1 -1
- package/src/components/back-testing-wizard/back-testing-wizard.tsx +1 -1
- package/src/components/back-testing-wizard/back-testing-wizard.types.ts +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,6 @@ interface StormPayout {
|
|
|
38
38
|
LOCATION: Point;
|
|
39
39
|
}[];
|
|
40
40
|
}
|
|
41
|
-
|
|
42
41
|
interface Payout {
|
|
43
42
|
category: number;
|
|
44
43
|
payout: number;
|
|
@@ -113,8 +112,9 @@ interface BackTestingWizardProps {
|
|
|
113
112
|
key: string;
|
|
114
113
|
value: Payout[];
|
|
115
114
|
}[];
|
|
115
|
+
onStormPayoutsCalculated: (e: StormPayout[]) => void;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
declare function BackTestingWizard(props: BackTestingWizardProps): react_jsx_runtime.JSX.Element;
|
|
119
119
|
|
|
120
|
-
export { BackTestingCatLegend, BackTestingMap, BackTestingStormLegend, BackTestingWizard };
|
|
120
|
+
export { BackTestingMap as AnemometerRequest, BackTestingCatLegend, BackTestingMap, BackTestingStormLegend, BackTestingWizard, BackTestingMap as CIACRequest, BackTestingMap as PayoutRequest, BackTestingMap as ProxyRequest, BackTestingMap as StormPayout };
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PayoutRequest } from "./back-testing-map.types";
|
|
1
|
+
import { PayoutRequest, PayoutResponse } from "./back-testing-map.types";
|
|
3
2
|
|
|
4
3
|
const DEV_API_ROOT_URI='https://api-dev.nms3939.com'
|
|
5
4
|
const UAT_API_ROOT_URI='https://api-uat.nms3939.com'
|
|
@@ -21,48 +20,6 @@ export class AppConfig {
|
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
export interface StormPayout {
|
|
25
|
-
name: string;
|
|
26
|
-
year: number;
|
|
27
|
-
maxRecovery: number;
|
|
28
|
-
maxRecoveryAmount: number;
|
|
29
|
-
proxy:{
|
|
30
|
-
name?: string;
|
|
31
|
-
year?: number;
|
|
32
|
-
category?: number;
|
|
33
|
-
windspeedMPH?: number;
|
|
34
|
-
proxyPayout: number;
|
|
35
|
-
},
|
|
36
|
-
anemometer:{
|
|
37
|
-
name?: string;
|
|
38
|
-
year?: number;
|
|
39
|
-
category?: number;
|
|
40
|
-
windspeedMPH?: number;
|
|
41
|
-
anemometerPayout: number;
|
|
42
|
-
},
|
|
43
|
-
ciac:{
|
|
44
|
-
name?: string;
|
|
45
|
-
year?: number;
|
|
46
|
-
category?: number;
|
|
47
|
-
windspeedMPH?: number;
|
|
48
|
-
ciacPayout: number;
|
|
49
|
-
}
|
|
50
|
-
color?: string;
|
|
51
|
-
stormTrack:{
|
|
52
|
-
NAME: string;
|
|
53
|
-
SEASON: number;
|
|
54
|
-
ISO_TIME: string,
|
|
55
|
-
USA_WIND: number;
|
|
56
|
-
USA_SSHS: number;
|
|
57
|
-
LOCATION: Point
|
|
58
|
-
}[]
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface PayoutResponse {
|
|
62
|
-
status: number;
|
|
63
|
-
payouts: StormPayout[];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
23
|
export const fetchPayouts = async (request: PayoutRequest, apiKey: string, env: 'dev' | 'uat' | 'prod') => {
|
|
67
24
|
const rootURI = selectRootURI(env);
|
|
68
25
|
const url = rootURI + AppConfig.endpoints.backTesting.payouts;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BackTestingActions, BackTestingMapProps, Payout, CIAC_LAYER, CIAC_SOURCE, Constants, DEFAULT_MAP_COORDINATE, DEFAULT_MAP_ZOOM, generateCATColor, MapView, TROPICAL_STORM_LAYER, TROPICAL_STORM_SOURCE, TROPICAL_STORM_TRACK_LAYER, TROPICAL_STORM_TRACK_SOURCE, generateCIACRequest, generateProxyRequest, generateAnemometerRequest, PayoutRequest, randomColor } from "./back-testing-map.types";
|
|
1
|
+
import { BackTestingActions, StormPayout, BackTestingMapProps, Payout, CIAC_LAYER, CIAC_SOURCE, Constants, DEFAULT_MAP_COORDINATE, DEFAULT_MAP_ZOOM, generateCATColor, MapView, TROPICAL_STORM_LAYER, TROPICAL_STORM_SOURCE, TROPICAL_STORM_TRACK_LAYER, TROPICAL_STORM_TRACK_SOURCE, generateCIACRequest, generateProxyRequest, generateAnemometerRequest, PayoutRequest, randomColor } from "./back-testing-map.types";
|
|
2
2
|
import { GeoJsonProperties, Feature, Polygon, Geometry, LineString, Point, FeatureCollection } from "geojson";
|
|
3
3
|
import "mapbox-gl/dist/mapbox-gl.css";
|
|
4
4
|
import "./back-testing-map.css"
|
|
@@ -8,7 +8,7 @@ import { LngLatLike } from "@mapbox/search-js-core";
|
|
|
8
8
|
import * as turf from "@turf/turf";
|
|
9
9
|
|
|
10
10
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
11
|
-
import { fetchPayouts
|
|
11
|
+
import { fetchPayouts } from "./back-testing-map.service";
|
|
12
12
|
import { BackTestingCatLegend } from "../back-testing-cat-legend";
|
|
13
13
|
import { BackTestingStormLegend } from "../back-testing-storm-legend";
|
|
14
14
|
import { ToggleButton, ToggleButtonGroup } from "@mui/material";
|
|
@@ -380,7 +380,7 @@ const BackTestingMap = forwardRef<BackTestingActions, BackTestingMapProps>((prop
|
|
|
380
380
|
MapView.STORMS + "5false",["get","color"],
|
|
381
381
|
Constants.COLOR_MUTED
|
|
382
382
|
],
|
|
383
|
-
'circle-radius':
|
|
383
|
+
'circle-radius': 7,
|
|
384
384
|
},
|
|
385
385
|
});
|
|
386
386
|
|
|
@@ -1,6 +1,48 @@
|
|
|
1
|
-
import mapboxgl from 'mapbox-gl';
|
|
2
1
|
import { LngLatLike } from "@mapbox/search-js-core"
|
|
3
|
-
import {
|
|
2
|
+
import { Point } from "geojson";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface StormPayout {
|
|
6
|
+
name: string;
|
|
7
|
+
year: number;
|
|
8
|
+
maxRecovery: number;
|
|
9
|
+
maxRecoveryAmount: number;
|
|
10
|
+
proxy:{
|
|
11
|
+
name?: string;
|
|
12
|
+
year?: number;
|
|
13
|
+
category?: number;
|
|
14
|
+
windspeedMPH?: number;
|
|
15
|
+
proxyPayout: number;
|
|
16
|
+
},
|
|
17
|
+
anemometer:{
|
|
18
|
+
name?: string;
|
|
19
|
+
year?: number;
|
|
20
|
+
category?: number;
|
|
21
|
+
windspeedMPH?: number;
|
|
22
|
+
anemometerPayout: number;
|
|
23
|
+
},
|
|
24
|
+
ciac:{
|
|
25
|
+
name?: string;
|
|
26
|
+
year?: number;
|
|
27
|
+
category?: number;
|
|
28
|
+
windspeedMPH?: number;
|
|
29
|
+
ciacPayout: number;
|
|
30
|
+
}
|
|
31
|
+
color?: string;
|
|
32
|
+
stormTrack:{
|
|
33
|
+
NAME: string;
|
|
34
|
+
SEASON: number;
|
|
35
|
+
ISO_TIME: string,
|
|
36
|
+
USA_WIND: number;
|
|
37
|
+
USA_SSHS: number;
|
|
38
|
+
LOCATION: Point
|
|
39
|
+
}[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PayoutResponse {
|
|
43
|
+
status: number;
|
|
44
|
+
payouts: StormPayout[];
|
|
45
|
+
}
|
|
4
46
|
|
|
5
47
|
export interface Payout {
|
|
6
48
|
category: number,
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import BackTestingMap from './back-testing-map';
|
|
2
|
+
import StormPayout from './back-testing-map';
|
|
3
|
+
import ProxyRequest from './back-testing-map';
|
|
4
|
+
import AnemometerRequest from './back-testing-map';
|
|
5
|
+
import CIACRequest from './back-testing-map';
|
|
6
|
+
import PayoutRequest from './back-testing-map';
|
|
2
7
|
|
|
3
|
-
export {BackTestingMap}
|
|
8
|
+
export {BackTestingMap,ProxyRequest,AnemometerRequest,CIACRequest,StormPayout,PayoutRequest}
|
|
@@ -23,8 +23,7 @@ import { GeoJSONSource } from "mapbox-gl";
|
|
|
23
23
|
import { Geometry, GeoJsonProperties, Feature, FeatureCollection } from "geojson";
|
|
24
24
|
import { RadioButtonChecked, RadioButtonUncheckedOutlined } from "@mui/icons-material";
|
|
25
25
|
import { BackTestingPayoutInfoProps } from "./back-testing-payout-info.types";
|
|
26
|
-
import {
|
|
27
|
-
import { TROPICAL_STORM_LAYER, TROPICAL_STORM_SOURCE, TROPICAL_STORM_TRACK_LAYER, TROPICAL_STORM_TRACK_SOURCE } from "../back-testing-map/back-testing-map.types";
|
|
26
|
+
import { TROPICAL_STORM_SOURCE, TROPICAL_STORM_TRACK_SOURCE } from "../back-testing-map/back-testing-map.types";
|
|
28
27
|
|
|
29
28
|
interface ExpandMoreProps extends IconButtonProps {
|
|
30
29
|
expand: boolean;
|
|
@@ -6,6 +6,26 @@
|
|
|
6
6
|
height: calc(100% - 40px);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
.stepper-container .header{
|
|
10
|
+
margin: 15px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.stepper-container ::-webkit-scrollbar{
|
|
14
|
+
width: 10px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.stepper-container ::-webkit-scrollbar-track {
|
|
18
|
+
background: #f1f1f1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.stepper-container ::-webkit-scrollbar-thumb {
|
|
22
|
+
background: #a1a1a1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.stepper-container ::-webkit-scrollbar-thumb:hover {
|
|
26
|
+
background: #868686;
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
.stepper-container .MuiStepConnector-line.MuiStepConnector-lineVertical {
|
|
10
30
|
margin-left:8px;
|
|
11
31
|
}
|
|
@@ -264,7 +264,7 @@ const BackTestingStepper = (props: BackTestingStepperProps) => {
|
|
|
264
264
|
|
|
265
265
|
return(
|
|
266
266
|
<div className="stepper-container">
|
|
267
|
-
<Box sx={{ maxWidth: 400, height: 'calc(100% - 1em)' }}>
|
|
267
|
+
<Box sx={{ maxWidth: 400, height: wizardStep === PayoutWizardStepType.DISPLAY_PAYOUTS ? 'calc(100% - 1em)': '100%', overflowY: wizardStep === PayoutWizardStepType.DISPLAY_PAYOUTS ? '': 'auto'}}>
|
|
268
268
|
{wizardStep !== PayoutWizardStepType.DISPLAY_PAYOUTS && <Stepper activeStep={activeStep} orientation="vertical">
|
|
269
269
|
{steps.map((step, index) => (
|
|
270
270
|
<Step key={step.label}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StormPayout } from "../back-testing-map/back-testing-map.
|
|
1
|
+
import { StormPayout } from "../back-testing-map/back-testing-map.types";
|
|
2
2
|
import { Payout, PayoutRequest } from "../back-testing-map/back-testing-map.types"
|
|
3
3
|
import { PayoutWizardStepType, RadioChoice, WizardStep } from "./steps/step.types"
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoryFn, Meta } from "@storybook/react";
|
|
2
2
|
import BackTestingStormLegend from "./back-testing-storm-legend";
|
|
3
|
-
import { StormPayout } from "../back-testing-map/back-testing-map.
|
|
3
|
+
import { StormPayout } from "../back-testing-map/back-testing-map.types";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: "ReactComponentLibrary/BackTestingStormLegend",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Card, CardContent, Typography } from "@mui/material";
|
|
2
|
-
import { StormPayout } from "../back-testing-map/back-testing-map.
|
|
2
|
+
import { StormPayout } from "../back-testing-map/back-testing-map.types";
|
|
3
3
|
import { BackTestingStormLegendProps } from "./back-testing-storm-legend.types";
|
|
4
4
|
import './back-testing-storm-legend.css'
|
|
5
5
|
|
|
@@ -5,7 +5,7 @@ import { BackTestingMap } from "../back-testing-map";
|
|
|
5
5
|
import { generateInitialPayoutRequest, PayoutRequest } from "../back-testing-map/back-testing-map.types";
|
|
6
6
|
import BackTestingStepper from "../back-testing-stepper/back-testing-stepper";
|
|
7
7
|
import { BackTestingWizardProps } from "./back-testing-wizard.types";
|
|
8
|
-
import { StormPayout } from "../back-testing-map/back-testing-map.
|
|
8
|
+
import { StormPayout } from "../back-testing-map/back-testing-map.types";
|
|
9
9
|
import { PayoutWizardStepType, RadioChoice } from "../back-testing-stepper/steps/step.types";
|
|
10
10
|
|
|
11
11
|
function BackTestingWizard(props: BackTestingWizardProps){
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Payout } from "../back-testing-map/back-testing-map.types";
|
|
1
|
+
import { Payout, StormPayout } from "../back-testing-map/back-testing-map.types";
|
|
2
2
|
|
|
3
3
|
export interface BackTestingWizardProps {
|
|
4
4
|
apiAccessToken:string,
|
|
@@ -10,4 +10,5 @@ export interface BackTestingWizardProps {
|
|
|
10
10
|
anemometerPayoutOptions: {key:string,value: Payout[]}[],
|
|
11
11
|
selectedCIACPayoutOptionIndex:number;
|
|
12
12
|
ciacPayoutOptions: {key:string,value: Payout[]}[],
|
|
13
|
+
onStormPayoutsCalculated: (e:StormPayout[]) => void
|
|
13
14
|
}
|