This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TabPanelProps = { | |
// the index of the active tab | |
activeIndex: number, | |
... | |
}; | |
... | |
renderTab(tab: Tab, index: number): JSX.Element { | |
let classes = 'tab'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Border = "top" | "bottom"; | |
let myBorder: Border = "top"; // Ok | |
myBorder = "bottom"; // Ok | |
myBorder = "left"; // Compiler error, broken guarantee prevented | |
myBorder = null; // Compiler error, broken guarantee prevented |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
triangleBlip : Position -> Svg msg | |
triangleBlip pos = | |
path | |
[ d "M412.201,311.406c0.021,0,0.042,0,0.063,0c0.067,0,0.135,0,0.201,0c4.052,0,6.106-0.051,8.168-0.102c2.053-0.051,4.115-0.102,8.176-0.102h0.103c6.976-0.183,10.227-5.306,6.306-11.53c-3.988-6.121-4.97-5.407-8.598-11.224c-1.631-3.008-3.872-4.577-6.179-4.577c-2.276,0-4.613,1.528-6.48,4.699c-3.578,6.077-3.26,6.014-7.306,11.723C402.598,306.067,405.426,311.406,412.201,311.406" | |
, transform <| "scale(" ++ toString (blipWidth / 34) ++ ") translate(" ++ toString (-404 + pos.x * (34 / blipWidth) - 17) ++ ", " ++ toString (-282 + pos.y * (34 / blipWidth) - 17) ++ ")" | |
] | |
[] | |
circleBlip : Position -> Svg msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arc : Float -> Float -> Float -> Float -> Float -> Attribute msg | |
arc x y radius startAngle endAngle = | |
let | |
( startX, startY ) = | |
polarToCartesian x y radius endAngle | |
( endX, endY ) = | |
polarToCartesian x y radius startAngle | |
largeArcFlag = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generateEvenValues : Int -> Generator (List Int) | |
generateEvenValues howMany = | |
Random.map | |
(\randInt -> | |
if randInt % 2 == 0 then | |
randInt | |
else | |
randInt + 1 | |
) | |
(Random.int 1 99) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mockData : List GoogleSheetBlip | |
mockData = | |
List.range 1 4 | |
|> List.map | |
(\quadrantNum -> | |
let | |
quadrant = | |
case quadrantNum of | |
1 -> | |
Tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
determineCoordinatesForRadar : List GoogleSheetBlip -> List PositionedBlip | |
determineCoordinatesForRadar blips = | |
List.foldl | |
(\blip ( accBlips, seed ) -> | |
let | |
generator = | |
accBlips | |
|> List.map .position | |
|> findCoordForBlip 0 blip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[libs] | |
flow-typed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./build/", | |
"sourceMap": false, | |
"strictNullChecks": true, | |
"noImplicitAny": true, | |
"noImplicitThis": true, | |
"alwaysStrict": true, | |
"module": "commonjs", | |
"target": "es5", |