-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update yield curves code for tree-shaken series
- Loading branch information
1 parent
8e6c307
commit 135dfe7
Showing
6 changed files
with
47 additions
and
23 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 |
---|---|---|
@@ -1,6 +1,31 @@ | ||
import { LineData, WhitespaceData } from '../model/data-consumer'; | ||
import { SeriesPartialOptionsMap } from '../model/series-options'; | ||
import { SeriesDefinition } from '../model/series/series-def'; | ||
|
||
import { IChartApiBase } from './ichart-api'; | ||
import { ISeriesApi } from './iseries-api'; | ||
|
||
export type YieldCurveSeriesType = 'Area' | 'Line'; | ||
|
||
/** | ||
* The main interface of a single yield curve chart. | ||
*/ | ||
export interface IYieldCurveChartApi extends IChartApiBase<number> {} | ||
export interface IYieldCurveChartApi extends Omit<IChartApiBase<number>, 'addSeries'> { | ||
/** | ||
* Creates a series with specified parameters. | ||
* | ||
* Note that the Yield Curve chart only supports the Area and Line series types. | ||
* | ||
* @param definition - A series definition for either AreaSeries or LineSeries. | ||
* @param customOptions - Customization parameters of the series being created. | ||
* @param paneIndex - An index of the pane where the series should be created. | ||
* ```js | ||
* const series = chart.addSeries(LineSeries, { lineWidth: 2 }); | ||
* ``` | ||
*/ | ||
addSeries<T extends YieldCurveSeriesType>( | ||
definition: SeriesDefinition<T>, | ||
options?: SeriesPartialOptionsMap[T], | ||
paneIndex?: number | ||
): ISeriesApi<T, number, WhitespaceData<number> | LineData<number>>; | ||
} |
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