Constructor.
a URL helper for accessing node datum via SolarQuery
the filter parameters to use
Optional
authBuilder: AuthorizationV2Builderthe auth builder to authenticate requests with; if not provided then only public data can be queried; when provided a pre-signed key must be available
Protected
Readonly
apiThe URL helper instance to use.
Protected
Optional
Readonly
authAn authorization builder to use to make authenticated HTTP requests.
Readonly
filterThe filter.
Get the optional callback function.
the current callback function or null
if not defined
Set the callback function, invoked after all data has been loaded or after every result page in incremental mode.
The callback function will be passed a minimum of two arguments: an error and the results.
In incremental mode, the callback will also be passed a boolean that will be true
on that
last page of data, and a Pagination
that details which page the callback represents.
the callback function to use, or null
to remove the existing callback function
this object
Get the concurrency limit to use for parallel requests.
the current concurrency value
Set the concurrency limit to use for parallel requests.
By default requests are not made in parallel (this property is configured as 0
). Change
to a positive number to enable parallel query mode.
When parallel mode is enabled the loader will make one request that includes the total result count and first page of results, followed by parallel requests for any remaining pages based on that total result count and configured page size.
the concurrency level to use, or Infinity
for no limit
this object
Get the flag for requesting the total results count.
By default the datum loader will not request the overal total result count when querying
for data, as this speeds up queries. By setting this to true
the total result count will
be requested on the first query page.
the total results count inclusion mode
Set the flag for requesting the total results count.
By default the datum loader will not request the overal total result count when querying
for data, as this speeds up queries. By setting this to true
the total result count will
be requested on the first query page.
the flag to include total results count
this object
Get the incremental mode for loading the data.
true
if incremental mode is enabled
Set incremental mode for loading the data.
When incremental mode is enabled (set to true
) then the callback function will be invoked
after each result page that is loaded, passing all results loaded thusfar. The function
will be passed a second boolean
argument that will be set to true
only on the last page
of result data, and a third Pagination` object argument that details the starting offset of
the page.
When incremental mode is disabled (set to false
, the default) then all result pages are
combined into a single array and the callback will be invoked just once.
true
to enable incremental mode
this object
Get the concurrency jitter value to use for parallel requests.
the current concurrency jitter value (milliseconds); defaults to 150
Set the concurrency jitter amount to use for parallel requests.
When parallel mode is enabled by setting concurrency()
to a positive value, a random amount
of "pause" time can be added before parallel requests are made by configuring this
to a positive value. This can be helpful to avoid API rate limiting errors.
the concurrency jitter amount to use, in milliseconds, or 0
to disable
this object
Initiate loading the data.
As an alternative to configuring the callback function via the DatumLoader.callback
method,a callback function can be passed as an argument to this function. That allows this
function to be passed to things like queue.defer
, for example.
Optional
callback: LoaderDataCallbackFn<Domain.Datum[]>a callback function to use; either this argument must be provided or the function must have already been configured via DatumLoader.callback
this object
Get the result pagination size.
the pagination size; defaults to 1000
Set the result pagination size.
the pagination size to set
this object
Get the additional URL parameters.
the URL parameters, or null
Set additional URL parameters.
The parameters are set as object properties. If a property value is an array, multiple parameters for that property will be added.
the URL parameters to include with the JSON request, or null
to remove any existing parameters object
this object
Get the URL to a proxy to use for loading the data.
the proxy URL
Set the URL to a proxy to use for loading the data.
This can be configured as an absolute URL to the proxy server to use instead of making requests
directly to the URL returned by the configured SolarQueryApi
. For example:
the proxy URL to set, or null
or an empty string to not use any proxy
this object
Get the readings mode for loading the data.
true
to return reading query, false
for list query
Set the readings mode for loading the data.
When readings mode is enabled (set to true
) then the /datum/reading
endpoint will be invoked
to load data.
When readings mode is disabled (set to false
, the default) then the /datum/list
endpoint will
be invoked to load data.
true
to return reading query, false
for list query
this object
Protected
requestorCreate a URL fetch requestor.
The returned function can be passed to d3.queue
or invoked directly.
the URL to request.
Optional
signUrl: stringthe URL to sign (might be different to url
if a proxy is used)
Optional
delay: numberan optional number of milliseconds to sleep before initiating the request
a function that accepts a callback argument
Load data for a set of source IDs, date range, and aggregate level using either the
listDatumUrl()
ordatumReadingUrl()
URLs ofSolarQueryApi
(the/datum/list
or/datum/reading
endpoints).This object is designed to be used once per query. After creating the object and optionally configuring any other settings, call Tool.DatumLoader#fetch to start loading the data. The returned
Promise
will be resolved once all data has been loaded.Example