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
import { getIntersectionOverUnion } from "./math"; | |
describe("getIntersectionOverUnion", () => { | |
// Values from https://learnopencv.com/intersection-over-union-iou-in-object-detection-and-segmentation | |
it("should accept two sets of coordinates and return a numeric value", () => { | |
const intersectionOverUnion = getIntersectionOverUnion( | |
[1202, 123, 1650, 868], | |
[1162.0001, 92.0021, 1619.9832, 694.0033] | |
); |
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
import React, { | |
useState, | |
useEffect, | |
ChangeEvent, | |
useMemo, | |
ChangeEventHandler, | |
} from "react"; | |
import { TextField } from "@material-ui/core"; | |
import { debounce } from "lodash"; |
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
import mapboxgl, { | |
getBezierLine, getDarkenedColor, | |
getTransparency, | |
primaryColor, setMapCursorPointer, unsetMapCursorPointer | |
} from "../../../../../Projects/Demo/frontend/src/utils/mapbox/mapbox"; | |
import {EventData, MapboxGeoJSONFeature, MapMouseEvent} from "mapbox-gl"; | |
import {Properties} from "@turf/helpers"; | |
import midpoint from "@turf/midpoint"; | |
import * as turfHelpers from "@turf/helpers"; | |
import bezierSpline from "@turf/bezier-spline"; |
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
// @ts-ignore - Wish this didn't suck, but it does and I'm moving on. | |
import MapiClient, { SdkConfig } from "@mapbox/mapbox-sdk"; | |
import MapboxGeocoder, { | |
GeocodeService, | |
GeocodeRequest, | |
GeocodeResponse, | |
} from "@mapbox/mapbox-sdk/services/geocoding"; | |
import mapboxgl, { | |
EventData, | |
LngLat, |
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
.mapboxgl-popup-content { | |
/* The content is delcared with a white background, but no default color */ | |
color: #222; | |
} | |
.mapboxgl-ctrl-bottom-left { | |
/* Provides a barrier to prevent long content from overlapping the other control groups */ | |
right: 56px; | |
} |
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
import rootVM from "@/main.ts"; | |
import YourComponent from "@/components/YourComponent.vue"; | |
export const getHtmlElementFromVueComponent = (): HTMLElement => { | |
const element = document.createElement("span"); | |
// This may not show an IDE error. | |
// You can reproduce what's being ignored using npm run test:unit. | |
// @ts-ignore | |
const yourComponent = new Vue({ | |
...YourComponent, |
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
const render = (data) => { | |
console.log(data); | |
var height = 900; | |
var width = 1000; | |
var margin = { top: 20, right: 15, bottom: 25, left: 25 }; | |
width = width - margin.left - margin.right; | |
height = height - margin.top - margin.bottom; |
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 NonFunctionPropertyNames<T> = { | |
[K in keyof T]: T[K] extends Function ? never : K; | |
}[keyof T]; | |
type NonFunctionProperties<T> = Pick<T, NonFunctionPropertyNames<T>>; | |
type PartialWithoutFunctions<T> = Partial<NonFunctionProperties<T>>; | |
interface IKeywordsResponseArguments { | |
results?: PartialWithoutFunctions<KeywordResult>[]; | |
} | |
export class KeywordsResponse extends ResultsResponse { |
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
<template> | |
<div | |
class="google-map" | |
ref="mapContainer" | |
:style="{ 'min-height': minHeight }" | |
/> | |
</template> | |
<script lang="ts"> | |
import { |
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
<script lang="ts"> | |
import { | |
createComponent, | |
createElement, | |
onErrorCaptured, | |
reactive, | |
SetupContext | |
} from "@vue/composition-api"; | |
import DefaultFallbackUI from "./ErrorBoundaryFallbackUI.vue"; | |
import { IErrorBoundaryState } from "@/components/errorBoundary/IErrorBoundary"; |
NewerOlder