3.2.0Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
(any)
boolean
(any)
boolean
(any)
any
(any)
any
(any)
any
(any)
any
((Value | undefined | null))
any
(any)
(string)
Error
(any)
StringDictionary
Converts entire DataView to a string as utf-8.
(DataView)
bytes to convert
string:
the string
Log a message to the console. Put here to limit lint console errors for the times we really do want to use console.log. Will also append a p tag to a div#debug if it exists.
(string)
the message to log
void
typescript-y check if Error.
(any)
object that might be an Error
any:
true if Error object
typescript-y convert errors.
(any)
obejct that might be an Error object
Error:
an Error object
Log a warning message to the console. Put here to limit lint console errors for the times we really do want to use console.log. Will also append a p tag to a div#debug if it exists.
(string)
the message to log
void
String representation of input. This is kind of dumb but makes flow happier.
(any)
any kind of thing that can be turned into a string
string:
a string
(string)
DateTime
Create a luxon Interval from a start and end.
((string | DateTime))
start of the interval as iso string or DateTime
((string | DateTime))
end of the interval as string or DateTime
Interval:
the interval
Create a luxon Interval from a start and a duration. If the duration is negative, the start time will become the end time. This differs from luxon Interval.after which will return an invalid Interval instead.
((string | DateTime))
start of the interval as iso string or DateTime
Interval:
the interval
Create a luxon Interval from a duration and a end. If the duration is negative, the end time will become the start time. This differs from luxon Interval.before which will return an invalid Interval instead.
((string | DateTime))
end of the interval as string or DateTime
Interval:
the interval
Calculates offset of remote server versus local time. It is assumed that the argument was acquired as close in time to calling this as possible.
(DateTime)
now as reported by remote server
number:
offset in seconds to now on local machine
Type: DateTime
Type: DateTime
converts the input value is a DateTime, throws Error if not a string, Date or DateTime. Zero length string or "now" return current time.
DateTime:
DateTime created from argument
Converts name and value into a html query parameter, with appending ampersand.
(string)
parameter name
(any)
parameter value
string:
formated query parameter
Converts name and value into a parameter line, with appending newline, for including in POST body.
(string)
parameter name
(any)
parameter value
string:
formated query parameter
converts to ISO8601 but removes the trailing Z as FDSN web services do not allow that.
(DateTime)
DateTime to convert to string
string:
ISO8601 without timezone Z
Extracts a valid starting DateTime from interval. Throws Error if interval is not valid.
(Interval)
luxon Interval
DateTime:
start DateTime
Extracts a valid ending DateTime from interval. Throws Error if interval is not valid.
(Interval)
luxon Interval
DateTime:
end DateTime
Converts a luxon DateTime to a Javascript Date, checking for null, undefined and isValid first. Throws Error in that case.
((DateTime | null | undefined))
luxon DateTime
any:
Javascript Date
Check a Luxon DateTime, Interval or Duration for valid. Throws Error if not. THis is to avoid globally setting luxon's Settings.throwOnInvalid = true; but still throw/catch on invalid dates.
((null | DateTime | Interval | Duration))
luxon object
(string?)
optional message to add to error
any:
passed in object if valid
Create string name for a timezone. Uses zone name except for UTC, which returns "UTC".
((string | null | Zone))
timezone to describe
((DateTime | null)?)
optional time to calc name at ie EST vs EDT
string:
string version of zone
Utility method to pull raw text result from a url. Result returned is an Promise.
Promise<string>:
promise to string result
Utility method to pull raw json result from a url. Result returned is an Promise.
Promise<Record<string, any>>:
promise to string result
(any
= "http:")
string:
the protocol, http: or https: for the document if possible.
Note this includes the colon.
Upgrade url protocol to https if document location is https
(string)
url to upgrade
string:
upgraded url
Create default fetch init object with the given mimeType. Sets no-cache, follow redirects, cors mode, referrer as seisplotjs and mimetype as a header. Note that redirect with POST may fail due to POST being changed to GET on a 301. Fetching with POST may wish to use redirect: "manual" to handle the 301 correctly by POSTing to the new URL.
(string?)
requested mime type
RequestInit:
object with fetch configuration parameters
(RequestInit)
RequestInit
((URL | RequestInfo))
(RequestInit?)
Promise<Response>
Type: (null | function (url: (URL | RequestInfo), init: RequestInit): Promise<Response>)
function (url: (URL | RequestInfo), init: RequestInit): Promise<Response>
Does a fetch, but times out if it takes too long.
((RequestInit | null)?)
fetch configuration, initialization
(number?)
maximum time to wait in seconds
Promise<Response>:
promise to the result
Allows downloading of in memory data, as ArrayBufferLike, to file as if the user clicked a download link.
(Uint8Array<ArrayBuffer>)
ArrayBufferLike to download
(string)
default filename
(any
= "application/octet-stream")
mimeType, default application/octet-stream
Recursively calculates the mean of a slice of an array. This helps with very long seismograms to equally weight each sample point without overflowing.
((Int32Array | Float32Array | Float64Array))
slice of a seismogram
(number)
number of points in the original seismogram
number:
sum of slice data points divided by totalPts
Type: string
Type: string
(string)
SVGElement
(ArrayBufferLike)
boolean
(any
= "#sp-version")
Parses a string of the form 'an+b', where 'a' is a positive integer (can be omitted if 1), 'n' is a literal character, and 'b' is an integer (or omitted for zero). Examples include: '3n+1', 'n', '2n', '4n-2'. The resulting 'b' value will be reduced to its smallest positive form; for example, the previous example would return [4, 2] (-2 % 4 = 2), which is an equivalent representation when considering the bias for an infinite series.
Array<number>:
The 'a' and 'b' values parsed and reduced from the given 'value' string, returned as an array