Skip to content

Commit

Permalink
chore: allows stackAsPercentage only for areas and bars
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Jul 4, 2019
1 parent 32bd14a commit 3093ec9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
11 changes: 2 additions & 9 deletions src/lib/series/domains/y_domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@ export type YDomain = BaseDomain & {
};
export type YBasicSeriesSpec = Pick<
BasicSeriesSpec,
| 'id'
| 'seriesType'
| 'yScaleType'
| 'groupId'
| 'stackAccessors'
| 'yScaleToDataExtent'
| 'colorAccessors'
| 'stackAsPercentage'
>;
'id' | 'seriesType' | 'yScaleType' | 'groupId' | 'stackAccessors' | 'yScaleToDataExtent' | 'colorAccessors'
> & { stackAsPercentage?: boolean };

export function mergeYDomain(
dataSeries: Map<SpecId, RawDataSeries[]>,
Expand Down
12 changes: 8 additions & 4 deletions src/lib/series/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ export interface SeriesAccessors {
splitSeriesAccessors?: Accessor[];
/** An array of fields thats indicates the stack membership */
stackAccessors?: Accessor[];
/**
* Stack each series in percentage for each point.
*/
stackAsPercentage?: boolean;
/** An optional array of field name thats indicates the stack membership */
colorAccessors?: Accessor[];
}
Expand Down Expand Up @@ -140,6 +136,10 @@ export type BarSeriesSpec = BasicSeriesSpec & {
/** If true, will stack all BarSeries and align bars to ticks (instead of centered on ticks) */
enableHistogramMode?: boolean;
barSeriesStyle?: CustomBarSeriesStyle;
/**
* Stack each series in percentage for each point.
*/
stackAsPercentage?: boolean;
};

/**
Expand Down Expand Up @@ -171,6 +171,10 @@ export type AreaSeriesSpec = BasicSeriesSpec &
/** The type of interpolator to be used to interpolate values between points */
curve?: CurveType;
areaSeriesStyle?: AreaSeriesStyle;
/**
* Stack each series in percentage for each point.
*/
stackAsPercentage?: boolean;
};

interface HistogramConfig {
Expand Down

0 comments on commit 3093ec9

Please sign in to comment.