Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Duane Millar Barlow
committed
May 31, 2022
1 parent
449af11
commit 109c85c
Showing
17 changed files
with
962 additions
and
78 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ dist/ | |
node_modules/ | ||
test/output/*-changed.svg | ||
test/output/*-changed.html | ||
tsconfig.tsbuildinfo | ||
yarn-error.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"require": ["module-alias/register.js", "ts-node/register"], | ||
"loader": "ts-node/esm", | ||
"extensions": ["js", "ts"], | ||
"spec": [ | ||
"test/**/*-test.*", | ||
"test/plot.js" | ||
], | ||
"watch-files": [ | ||
"bundle.js", | ||
"test", | ||
"src" | ||
] | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import {ascending, descending} from "d3"; | ||
import {ascending, descending, type Primitive} from "d3"; | ||
|
||
export function defined(x) { | ||
export function defined(x: Primitive | undefined): boolean { | ||
return x != null && !Number.isNaN(x); | ||
} | ||
|
||
export function ascendingDefined(a, b) { | ||
return defined(b) - defined(a) || ascending(a, b); | ||
export function ascendingDefined(a: Primitive | undefined, b: Primitive | undefined): number { | ||
return +defined(b) - +defined(a) || ascending(a, b); | ||
} | ||
|
||
export function descendingDefined(a, b) { | ||
return defined(b) - defined(a) || descending(a, b); | ||
export function descendingDefined(a: Primitive | undefined, b: Primitive | undefined): number { | ||
return +defined(b) - +defined(a) || descending(a, b); | ||
} | ||
|
||
export function nonempty(x) { | ||
export function nonempty(x: unknown): boolean { | ||
return x != null && `${x}` !== ""; | ||
} | ||
|
||
export function finite(x) { | ||
export function finite(x: number): number { | ||
return isFinite(x) ? x : NaN; | ||
} | ||
|
||
export function positive(x) { | ||
export function positive(x: number): number { | ||
return x > 0 && isFinite(x) ? x : NaN; | ||
} | ||
|
||
export function negative(x) { | ||
export function negative(x: number): number { | ||
return x < 0 && isFinite(x) ? x : NaN; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const radians = Math.PI / 180; | ||
export const radians: number = Math.PI / 180; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
declare module 'isoformat' { | ||
export function format(value: any, fallback: string): string; | ||
export function format(value: any, fallback: any): any; | ||
export function parse(value: string): Date; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"lib": [ | ||
"esnext", | ||
"dom" | ||
], | ||
"strict": true, | ||
"stripInternal": true, | ||
"outDir": "dist", | ||
"allowJs": true, | ||
"resolveJsonModule": true, | ||
"moduleResolution": "node", | ||
"paths": { | ||
"@observablehq/plot": ["./src/index.js"] | ||
} | ||
}, | ||
"ts-node": { "files": true }, | ||
"include": ["src/**/*"] | ||
} |
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
Oops, something went wrong.