Methods
-
$$(id [, source])
-
Shorthand for
getElementById().Equivalent to prototype style
$(), which is faster but less powerful than jQuery style$().Parameters:
Name Type Argument Description idstring An ID tag for a valid DOM element.
sourceHTMLElement <optional>
A valid DOM node to search within. If not provided, the entire document is searched.
Returns:
The DOM node associated with the ID, or null if a node is not found.
- Type
- HTMLElement
-
$$$(selector [, source])
-
Functional equivalent of
querySelector().Functionally equivalent to jQuery
$(). UsesquerySelectorAllto maintain compatibility with Internet Explorer 9.Note: If multiple elements match the selector, only the first is returned.
Parameters:
Name Type Argument Description selectorstring CSS style selector.
sourceHTMLElement <optional>
Node to select within. If not provided, the entire document is searched.
Returns:
The first element to match the selector.
- Type
- HTMLElement
-
ingestor(fns)
-
Builds a pre‑compiled ingest function from a sequence of pure transforms.
ingestortakes one or more(s: string) => stringtransform functions and returns aningestfunction that you can call repeatedly with different inputs. Each transform is applied left‑to‑right, but the pipeline is defined once and executed many times.Error handling
- If any transform throws, the error is recorded in a private, per‑pipeline error log and the value from the previous step is passed on unchanged. Execution continues through the remaining transforms.
- After the entire pipeline finishes,
ingestchecks whether errors were recorded. If at least one transform failed,ingestthrows anError. The thrown error'smessagesummarises the number of failures, but the complete error list is available on theingestfunction itself viagetErrors(). - The error log is reset at the beginning of every
ingest(input)call, so you always see only the errors from the most recent invocation.
Returned
ingestfunction In addition to being callable, the returnedingestobject exposes:ingest.getErrors()→ returns a shallow copy of the errors accumulated during the last call. Each error is an object with the shape{ step: string, message: string, input: string }.ingest.onError(handler)→ registers a callback that receives the same error object immediately when a transform fails, before the final throw. Useful for live logging or metrics. Returnsingestfor chaining.
Parameters:
Name Type Argument Description fnsIngestor~IngestTransform <repeatable>
Transform functions to apply in order. Each must be a pure function that either returns a canonical string or throws on unrecoverable input.
- Since:
-
10.5.0
Throws:
-
-
If any argument is not a function.
- Type
- TypeError
-
-
-
If
ingest(input)is called and one or more transforms fail, an Error is thrown after the full pipeline has executed. The thrown error'smessageindicates the number of failures. - Type
- Error
-
Returns:
A pre‑bound function
ingest(input).Example
```js import { ingestor, whitespace, quotes } from './cli-canonicalize.js'; // Define the pipeline once const ingest = ingestor( whitespace.normalizeNewlines, whitespace.collapseWhitespace, quotes.unquote, quotes.quoteWith('"') ); // Optionally attach a live error logger ingest.onError(err => console.warn('Transform issue:', err)); // Use it for different inputs try { const cmd1 = ingest(llmOutput1); console.log('Command:', cmd1); } catch (e) { console.error(e.message); console.error('Detailed errors:', ingest.getErrors()); } // Errors are isolated per call – after a successful call, getErrors() is empty const cmd2 = ingest(llmOutput2); // no errors console.assert(ingest.getErrors().length === 0); ``` -
registerFDC3(stx [, config])
-
Registers the chart with the FDC3 connector.
To enable this function, include the fdc3.js file (in the js/extras folder of the library) in your application. The file provides access to the open protocols established by the Financial Desktop Connectivity and Collaboration Consortium (FDC3) and FINOS for desktop inter-application messaging.
Parameters:
Name Type Argument Description stxCIQ.ChartEngine The chart engine instance.
configobject <optional>
Configuration options. Provide only those specifications you want to customize. The rest of the configuration will be the default values shown below.
Properties
Name Type Argument Default Description broadcastAsIntentboolean <optional>
true Whether to respond to a broadcast as if responding to an intent.
maxSymbolsnumber <optional>
16 Maximum number of comparison symbols allowed.
swatchColorsArray.<string> <optional>
Color codes to use for comparison series plots. See the
parameters.colorparameter of CIQ.ChartEngine#addSeries for accepted formats of the color strings.In the default implementation,
defaultSeriesParams, the colors are selected sequentially as comparison series are added to the chart. When the last color in the array has been used, selection resumes at the first color in the array. To ensure unique colors for all comparison series, create an arraymaxSymbolsin length filled with unique color values.Default
["#8ec648", "#00afed", "#ee652e", "#912a8e", "#fff126", "#e9088c", "#ea1d2c", "#00a553", "#00a99c", "#0056a4", "#f4932f", "#0073ba", "#66308f", "#323390"]defaultSeriesParamsfunction <optional>
Provides parameters to the CIQ.ChartEngine#addSeries function based on symbol. Customize this parameter by assigning a function that contains custom specifications.
The function has three parameters which are supplied with arguments when the function is called:
symbol— The symbol of the comparison series added to the chart. Use this parameter to create symbol-specific customizations.instrCount— The numerical order in which the series is added to the chart; for example, 3 indicates that the series is the third comparison series added to the chart.-
colors— A array of colors from which the color of the comparison series plot can be selected. SeeswatchColors.
Default
(symbol, instrCount, colors) => { return { renderer: "Lines", color: colors[instrCount % colors.length], width: 1, pattern: "solid" }; }defaultPeriodicityfunction <optional>
Provides periodicity to the CIQ.ChartEngine#loadChart function in a multiseries chart. See CIQ.ChartEngine~PeriodicityParameters. Customize this parameter by assigning a function that contains custom specifications.
The function has a single boolean parameter that indicates whether the chart shows holdings (that is, positions or a portfolio), in which case you may want to show a different periodicity. An argument is provided when the function is called.
Default
(isHolding) => { if (isHolding) return { interval: "day" }; return { period: 1, interval: 5, timeUnit: "minute" }; }- Since:
-
- 8.2.0
- 8.2.1 Added the
configparameter.
-
setConfigBasedUI(context)
-
Replaces default CrossPlot dropdown menus with a context-based menu.
Parameters:
Name Type Description contextCIQ.UI.Context The context for the chart.
-
startActiveTrader(stx)
-
Starts the Active Trader module
Parameters:
Name Type Description stxCIQ.ChartEngine Chart Engine
Returns:
Chart Engine (same object as the input parameter)
- Type
- CIQ.ChartEngine
