@ -1088,7 +1088,7 @@ var require_react_development = __commonJS({
}
return dispatcher . useContext ( Context ) ;
}
function useState 2 ( initialState ) {
function useState ( initialState ) {
var dispatcher = resolveDispatcher ( ) ;
return dispatcher . useState ( initialState ) ;
}
@ -1890,7 +1890,7 @@ var require_react_development = __commonJS({
exports . useMemo = useMemo ;
exports . useReducer = useReducer2 ;
exports . useRef = useRef3 ;
exports . useState = useState 2 ;
exports . useState = useState ;
exports . useSyncExternalStore = useSyncExternalStore ;
exports . useTransition = useTransition ;
exports . version = ReactVersion ;
@ -24379,11 +24379,11 @@ var require_react_jsx_runtime_development = __commonJS({
return jsxWithValidation ( type , props , key , false ) ;
}
}
var jsx 5 = jsxWithValidationDynamic ;
var jsxs 3 = jsxWithValidationStatic ;
var jsx 6 = jsxWithValidationDynamic ;
var jsxs 4 = jsxWithValidationStatic ;
exports . Fragment = REACT _FRAGMENT _TYPE ;
exports . jsx = jsx 5 ;
exports . jsxs = jsxs 3 ;
exports . jsx = jsx 6 ;
exports . jsxs = jsxs 4 ;
} ) ( ) ;
}
}
@ -24404,6 +24404,18 @@ var require_jsx_runtime = __commonJS({
// src/index.tsx
var import _client = _ _toESM ( require _client ( ) , 1 ) ;
// src/Header.tsx
var import _jsx _runtime = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
function Header ( ) {
return /* @__PURE__ */ ( 0 , import _jsx _runtime . jsxs ) ( "div" , { className : "header" , children : [
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h1" , { children : "Choose Probabilities" } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h5" , { children : "X-Axis = Ticks, Y-Axis = Underlying Price" } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h5" , { children : "Begin with 2 Ticks, T_0 and T_1. Can add more in-between or at ends. Do not have to be equidistant." } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h5" , { children : 'Begin with 2 Nodes to the "right" of each Node representing what can happen in the next tick. Can add more. No not need to be equidistant.' } )
] } ) ;
}
var Header _default = Header ;
// node_modules/@kurkle/color/dist/color.esm.js
function round ( v ) {
return v + 0.5 | 0 ;
@ -35977,19 +35989,36 @@ function createTypedChart(type, registerables) {
}
var Line = /* @__PURE__ */ createTypedChart ( "line" , LineController ) ;
// src/Header.tsx
var import _jsx _runtime = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
function Header ( ) {
return /* @__PURE__ */ ( 0 , import _jsx _runtime . jsxs ) ( "div" , { className : "header" , children : [
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h1" , { children : "Choose Probabilities" } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h5" , { children : "X-Axis = Ticks, Y-Axis = Underlying Price" } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h5" , { children : "Begin with 2 Ticks, T_0 and T_1. Can add more in-between or at ends. Do not have to be equidistant." } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime . jsx ) ( "h5" , { children : 'Begin with 2 Nodes to the "right" of each Node representing what can happen in the next tick. Can add more. No not need to be equidistant.' } )
] } ) ;
// src/HistoricalImpliedVolatilityChart.tsx
var import _jsx _runtime2 = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
Chart . register ( LineElement , plugin _tooltip , plugin _legend , CategoryScale , LinearScale , PointElement ) ;
function HistoricalImpliedVolatilityChart ( ) {
return /* @__PURE__ */ ( 0 , import _jsx _runtime2 . jsx ) ( "div" , { children : /* @__PURE__ */ ( 0 , import _jsx _runtime2 . jsx ) (
Line ,
{
datasetIdKey : "id" ,
data : {
labels : [ "Jun" , "Jul" , "Aug" ] ,
datasets : [
{
//@ts-ignore
id : 1 ,
label : "" ,
data : [ 5 , 6 , 7 ]
} ,
{
//@ts-ignore
id : 2 ,
label : "" ,
data : [ 3 , 2 , 1 ]
}
]
}
}
) } ) ;
}
var Header _default = Header ;
// src/QuoteDatePicker.tsx
// src/ Picker.tsx
var import _react3 = _ _toESM ( require _react ( ) , 1 ) ;
// node_modules/jotai/esm/vanilla.mjs
@ -36637,63 +36666,78 @@ function useAtom(atom2, options) {
] ;
}
// src/QuoteDatePicker.tsx
var import _jsx _runtime2 = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
var $dates = atom ( [ ] ) ;
var $isLoading = atom ( false ) ;
function QuoteDatePicker ( ) {
const [ dates , setDates ] = useAtom ( $dates ) ;
// src/Picker.tsx
var import _jsx _runtime3 = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
function create$Picker ( { $options = atom ( [ ] ) , $isLoading = atom ( false ) , $selectedOption = atom ( "" ) , $url = atom ( "" ) , $isEnabled = atom ( true ) } ) {
return atom ( {
$options ,
$isLoading ,
$selectedOption ,
$url ,
Picker : ( ) => {
const [ url , setUrl ] = useAtom ( $url ) ;
const [ options , setOptions2 ] = useAtom ( $options ) ;
const [ isLoading , setIsLoading ] = useAtom ( $isLoading ) ;
const [ selectedOption , setSelectedOption ] = useAtom ( $selectedOption ) ;
const [ isEnabled , setIsEnabled ] = useAtom ( $isEnabled ) ;
( 0 , import _react3 . useEffect ) ( ( ) => {
fetch ( "http://127.0.0.1:8234/option_quotes/AAPL/quote_dates" ) . then ( ( x ) => x . json ( ) ) . catch ( ( err ) => [ "2021-01-02" , "2021-01-03" , "2021-01-04" ] ) . then ( ( dates _ ) => {
setDates ( dates _ ) ;
if ( isEnabled ) {
fetch ( url ) . then ( ( x ) => x . json ( ) ) . catch ( ( err ) => [ "AAPL" , "MSFT" , "GOOG" ] ) . then ( ( underlyings _ ) => {
setOptions2 ( underlyings _ ) ;
setIsLoading ( false ) ;
} ) ;
} , [ ] ) ;
return /* @__PURE__ */ ( 0 , import _jsx _runtime2 . jsx ) ( "div" , { children : isLoading ? /* @__PURE__ */ ( 0 , import _jsx _runtime2 . jsx ) ( "span" , { children : "Loading..." } ) : /* @__PURE__ */ ( 0 , import _jsx _runtime2 . jsx ) ( "select" , { children : dates . map (
( date ) => /* @__PURE__ */ ( 0 , import _jsx _runtime2 . jsx ) ( "option" , { value : date , children : date } , date )
) } ) } ) ;
}
} , [ isEnabled , url ] ) ;
return /* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsx ) ( "div" , { children : isLoading ? /* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsx ) ( "span" , { children : "Loading..." } ) : /* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsxs ) ( "select" , { value : selectedOption , onChange : ( e ) => {
setSelectedOption ( e . target . value ) ;
} , children : [
/* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsx ) ( "option" , { value : "" } , "" ) ,
options . map (
( date ) => /* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsx ) ( "option" , { value : date , children : date } , date )
)
] } ) } ) ;
}
} ) ;
}
// src/App.tsx
var import _jsx _runtime3 = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
Chart . register ( LineElement , plugin _tooltip , plugin _legend , CategoryScale , LinearScale , PointElement ) ;
var import _jsx _runtime4 = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
var baseUrl = "http://127.0.0.1:8234" ;
var $underlyingsUrl = atom ( ` ${ baseUrl } /option_quotes/underlyings ` ) ;
var $underlyingPicker = create$Picker ( { $url : $underlyingsUrl } ) ;
var $quoteDatePicker = create$Picker ( {
$url : atom ( ( get ) => ` ${ baseUrl } /option_quotes/ ${ get ( get ( $underlyingPicker ) . $selectedOption ) } /quote_dates ` ) ,
$isEnabled : atom ( ( get ) => get ( get ( $underlyingPicker ) . $selectedOption ) !== "" )
} ) ;
var $frontMonthPicker = create$Picker ( {
$url : atom ( ( get ) => ` ${ baseUrl } /option_quotes/ ${ get ( get ( $underlyingPicker ) . $selectedOption ) } / ${ get ( get ( $quoteDatePicker ) . $selectedOption ) } /expirations ` ) ,
$isEnabled : atom ( ( get ) => get ( get ( $quoteDatePicker ) . $selectedOption ) !== "" && get ( get ( $underlyingPicker ) . $selectedOption ) !== "" )
} ) ;
var $backMonthPicker = create$Picker ( {
$url : atom ( ( get ) => ` ${ baseUrl } /option_quotes/ ${ get ( get ( $underlyingPicker ) . $selectedOption ) } / ${ get ( get ( $quoteDatePicker ) . $selectedOption ) } /expirations ` ) ,
$isEnabled : atom ( ( get ) => get ( get ( $quoteDatePicker ) . $selectedOption ) !== "" && get ( get ( $underlyingPicker ) . $selectedOption ) !== "" )
} ) ;
function App ( ) {
return /* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsxs ) ( "div" , { children : [
/* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsx ) ( Header _default , { } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsx ) ( QuoteDatePicker , { } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime3 . jsx ) (
Line ,
{
datasetIdKey : "id" ,
data : {
labels : [ "Jun" , "Jul" , "Aug" ] ,
datasets : [
{
//@ts-ignore
id : 1 ,
label : "" ,
data : [ 5 , 6 , 7 ]
} ,
{
//@ts-ignore
id : 2 ,
label : "" ,
data : [ 3 , 2 , 1 ]
}
]
}
}
)
const { Picker : UnderlyingPicker , $selectedOption } = useAtomValue ( $underlyingPicker ) ;
const { Picker : QuoteDatePicker } = useAtomValue ( $quoteDatePicker ) ;
const { Picker : FrontMonthPicker } = useAtomValue ( $frontMonthPicker ) ;
const { Picker : BackMonthPicker } = useAtomValue ( $backMonthPicker ) ;
return /* @__PURE__ */ ( 0 , import _jsx _runtime4 . jsxs ) ( "div" , { children : [
/* @__PURE__ */ ( 0 , import _jsx _runtime4 . jsx ) ( Header _default , { } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime4 . jsx ) ( UnderlyingPicker , { } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime4 . jsx ) ( QuoteDatePicker , { } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime4 . jsx ) ( FrontMonthPicker , { } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime4 . jsx ) ( BackMonthPicker , { } ) ,
/* @__PURE__ */ ( 0 , import _jsx _runtime4 . jsx ) ( HistoricalImpliedVolatilityChart , { } )
] } ) ;
}
var App _default = App ;
// src/index.tsx
var import _jsx _runtime 4 = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
var import _jsx _runtime5 = _ _toESM ( require _jsx _runtime ( ) , 1 ) ;
var rootEl = document . getElementById ( "app" ) ;
var Root = ( 0 , import _client . createRoot ) ( rootEl ) ;
Root . render ( /* @__PURE__ */ ( 0 , import _jsx _runtime 4 . jsx ) ( App _default , { } ) ) ;
Root . render ( /* @__PURE__ */ ( 0 , import _jsx _runtime5 . jsx ) ( App _default , { } ) ) ;
/ * ! B u n d l e d l i c e n s e i n f o r m a t i o n :
react / cjs / react . development . js :