From da3183460c16650131ad94f29f501fd2e0e81aad Mon Sep 17 00:00:00 2001 From: Matthew Traynham Date: Tue, 9 Jun 2015 20:34:12 -0400 Subject: [PATCH 1/2] Data function doesn't return the group accessor. Composite chart should be extendable. --- dcjs/dc.d.ts | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/dcjs/dc.d.ts b/dcjs/dc.d.ts index 62739e16a6..bf31738019 100644 --- a/dcjs/dc.d.ts +++ b/dcjs/dc.d.ts @@ -20,6 +20,11 @@ declare module DC { (t: T, r?: R): V; } + export interface IGetSetComputed { + (): R; + (t: T): V; + } + export interface Scale { (x: any): T; @@ -118,7 +123,7 @@ declare module DC { minWidth: IGetSet; minHeight: IGetSet; dimension: IGetSet; - data: IGetSet<(group: any) => Array, T>; + data: IGetSetComputed<(group: any) => Array, Array, T>; group: IGetSet; ordering: IGetSet, T>; filterAll(): void; @@ -297,19 +302,21 @@ declare module DC { elasticRadius: IGetSet; } - export interface CompositeChart extends CoordinateGridMixin { - useRightAxisGridLines: IGetSet; - childOptions: IGetSet; - rightYAxisLabel: IGetSet; - compose: IGetSet>, CompositeChart>; + export interface ICompositeChart extends CoordinateGridMixin { + useRightAxisGridLines: IGetSet>; + childOptions: IGetSet>; + rightYAxisLabel: IGetSet>; + compose: IGetSet>, ICompositeChart>; children(): Array>; - shareColors: IGetSet; - shareTitle: IGetSet; - rightY: IGetSet<(n: any) => any, CompositeChart>; - rightYAxis: IGetSet; + shareColors: IGetSet>; + shareTitle: IGetSet>; + rightY: IGetSet<(n: any) => any, ICompositeChart>; + rightYAxis: IGetSet>; } - export interface SeriesChart extends CompositeChart { + export interface CompositeChart extends ICompositeChart {} + + export interface SeriesChart extends ICompositeChart { chart: IGetSet<(c: any) => BaseMixin, SeriesChart>; seriesAccessor: IGetSet, SeriesChart>; seriesSort: IGetSet<(a: any, b: any) => number, SeriesChart>; From e7d05ef700ef36cb3a57b2a58effd2d12be120b4 Mon Sep 17 00:00:00 2001 From: Matt Traynham Date: Wed, 10 Jun 2015 15:46:06 -0400 Subject: [PATCH 2/2] Fixes coordinate grid mixin --- dcjs/dc.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dcjs/dc.d.ts b/dcjs/dc.d.ts index bf31738019..9a7cda23a3 100644 --- a/dcjs/dc.d.ts +++ b/dcjs/dc.d.ts @@ -185,7 +185,7 @@ declare module DC { colorCalculator: IGetSet, T>; } - export interface CoordinateGridMixin extends BaseMixin, MarginMixin, BaseMixin { + export interface CoordinateGridMixin extends BaseMixin, MarginMixin, ColorMixin { rangeChart: IGetSet, T>; zoomScale: IGetSet, T>; zoomOutRestrict: IGetSet;