Skip to content

Commit

Permalink
refactor: rename enum types to singular
Browse files Browse the repository at this point in the history
Fixup SeriesTypes.

Signed-off-by: Tre' Seymour <[email protected]>
  • Loading branch information
wayneseymour committed Mar 29, 2021
1 parent 52b37c5 commit ff37e2b
Show file tree
Hide file tree
Showing 31 changed files with 185 additions and 186 deletions.
16 changes: 8 additions & 8 deletions api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const AreaSeries: React_2.FunctionComponent<SpecRequiredProps & SpecOptio

// @public
export type AreaSeriesSpec = BasicSeriesSpec & HistogramConfig & Postfixes & {
seriesType: typeof SeriesTypes.Area;
seriesType: typeof SeriesType.Area;
curve?: CurveType;
areaSeriesStyle?: RecursivePartial<AreaSeriesStyle>;
stackMode?: StackMode;
Expand Down Expand Up @@ -266,7 +266,7 @@ export const BarSeries: React_2.FunctionComponent<SpecRequiredProps_2 & SpecOpti

// @public
export type BarSeriesSpec = BasicSeriesSpec & Postfixes & {
seriesType: typeof SeriesTypes.Bar;
seriesType: typeof SeriesType.Bar;
enableHistogramMode?: boolean;
barSeriesStyle?: RecursivePartial<BarSeriesStyle>;
stackMode?: StackMode;
Expand Down Expand Up @@ -364,7 +364,7 @@ export const BubbleSeries: React_2.FunctionComponent<SpecRequiredProps_3 & SpecO

// @alpha
export type BubbleSeriesSpec = BasicSeriesSpec & {
seriesType: typeof SeriesTypes.Bubble;
seriesType: typeof SeriesType.Bubble;
bubbleSeriesStyle?: RecursivePartial<BubbleSeriesStyle>;
pointStyleAccessor?: PointStyleAccessor;
};
Expand Down Expand Up @@ -1375,7 +1375,7 @@ export const LineSeries: React_2.FunctionComponent<SpecRequiredProps_6 & SpecOpt

// @public
export type LineSeriesSpec = BasicSeriesSpec & HistogramConfig & {
seriesType: typeof SeriesTypes.Line;
seriesType: typeof SeriesType.Line;
curve?: CurveType;
lineSeriesStyle?: RecursivePartial<LineSeriesStyle>;
pointStyleAccessor?: PointStyleAccessor;
Expand Down Expand Up @@ -1948,7 +1948,7 @@ export interface SeriesSpec extends Spec {
groupId: string;
hideInLegend?: boolean;
name?: SeriesNameAccessor;
seriesType: SeriesTypes;
seriesType: SeriesType;
// @deprecated
sortIndex?: number;
// (undocumented)
Expand All @@ -1965,18 +1965,18 @@ export interface SeriesSpec extends Spec {
// @public (undocumented)
export type SeriesSpecs<S extends BasicSeriesSpec = BasicSeriesSpec> = Array<S>;

// Warning: (ae-missing-release-tag) "SeriesTypes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
// Warning: (ae-missing-release-tag) "SeriesType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const SeriesTypes: Readonly<{
export const SeriesType: Readonly<{
Area: "area";
Bar: "bar";
Line: "line";
Bubble: "bubble";
}>;

// @public
export type SeriesTypes = $Values<typeof SeriesTypes>;
export type SeriesType = $Values<typeof SeriesType>;

// Warning: (ae-missing-release-tag) "Settings" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
Expand Down
4 changes: 2 additions & 2 deletions docs/0-Intro/1-Overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export interface SeriesSpec {
/** An array of data */
data: Datum[];
/** The type of series you are looking to render */
seriesType: SeriesTypes;
seriesType: SeriesType;
/** Set colors for specific series */
customSeriesColors?: CustomSeriesColors;
/** If the series should appear in the legend
Expand Down Expand Up @@ -201,7 +201,7 @@ A `BarSeriesSpec` for example is the following intersection type:
export type BarSeriesSpec = SeriesSpec &
SeriesAccessors &
SeriesScales & {
seriesType: SeriesTypes.Bar;
seriesType: SeriesType.Bar;
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/2-ChartPropTables/13-AreaProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Default props are set in the area_series.tsx file
| data `(required)` | datum[] | | An array of data |
| chartType | `typeof ChartType.XYAxis` | ChartType.XYAxis | |
| specType | `typeof SpecType.Series` | SpecType.Series | |
| seriesType| `typeof SeriesTypes.Area` | SeriesTypes.Area | |
| seriesType| `typeof SeriesType.Area` | SeriesType.Area | |
| groupId | string | DEFAULT_GLOBAL_ID | |
| yScaleToDataExtent | boolean | false | |
| hideInLegend | boolean | false | hide the series in the legend |
Expand Down
2 changes: 1 addition & 1 deletion docs/2-ChartPropTables/14-LineProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| id `(required)`|`string` ||The id of the spec |
| chartType | `typeof ChartType.XYAxis` | ChartType.XYAxis | |
| specType | `typeof SpecType.Series` | SpecType.Series | |
| seriesTypes | | SeriesTypes.Line | |
| seriesTypes | | SeriesType.Line | |
| groupId || DEFAULT_GROUP_ID |The ID of the line |
| xScaleType `(required)`| `ScaleType (ScaleType.Ordinal or ScaleType.Linear or ScaleType.Time)`|ScaleType.Ordinal | The x axis scale type |
| yScaleType `(required)`| `ScaleType (ScaleType.Ordinal or ScaleType.Linear or ScaleType.Time)`| ScaleType.Linear | The y axis scale type |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { SpecType } from '../../../specs/constants';
import { Dimensions } from '../../../utils/dimensions';
import { computeSeriesDomains } from '../state/utils/utils';
import { computeXScale } from '../utils/scales';
import { BasicSeriesSpec, SeriesTypes } from '../utils/specs';
import { BasicSeriesSpec, SeriesType } from '../utils/specs';
import { getCursorBandPosition, getSnapPosition } from './crosshair_utils';

describe('Crosshair utils linear scale', () => {
Expand All @@ -37,7 +37,7 @@ describe('Crosshair utils linear scale', () => {
specType: SpecType.Series,
id: barSeries1SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Bar,
seriesType: SeriesType.Bar,
data: [
[0, 0],
[1, 0],
Expand All @@ -53,7 +53,7 @@ describe('Crosshair utils linear scale', () => {
specType: SpecType.Series,
id: barSeries2SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Bar,
seriesType: SeriesType.Bar,
data: [
[0, 2],
[1, 2],
Expand All @@ -69,7 +69,7 @@ describe('Crosshair utils linear scale', () => {
specType: SpecType.Series,
id: lineSeries1SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Line,
seriesType: SeriesType.Line,
data: [
[0, 0],
[1, 0],
Expand All @@ -85,7 +85,7 @@ describe('Crosshair utils linear scale', () => {
specType: SpecType.Series,
id: lineSeries2SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Line,
seriesType: SeriesType.Line,
data: [
[0, 2],
[1, 2],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ScaleType } from '../../../scales/constants';
import { SpecType } from '../../../specs/constants';
import { computeSeriesDomains } from '../state/utils/utils';
import { computeXScale } from '../utils/scales';
import { BasicSeriesSpec, SeriesTypes } from '../utils/specs';
import { BasicSeriesSpec, SeriesType } from '../utils/specs';
import { getSnapPosition } from './crosshair_utils';

describe('Crosshair utils ordinal scales', () => {
Expand All @@ -36,7 +36,7 @@ describe('Crosshair utils ordinal scales', () => {
specType: SpecType.Series,
id: barSeries1SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Bar,
seriesType: SeriesType.Bar,
data: [
['a', 0],
['b', 0],
Expand All @@ -52,7 +52,7 @@ describe('Crosshair utils ordinal scales', () => {
specType: SpecType.Series,
id: barSeries2SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Bar,
seriesType: SeriesType.Bar,
data: [
['a', 2],
['b', 2],
Expand All @@ -68,7 +68,7 @@ describe('Crosshair utils ordinal scales', () => {
specType: SpecType.Series,
id: lineSeries1SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Line,
seriesType: SeriesType.Line,
data: [
['a', 0],
['b', 0],
Expand All @@ -84,7 +84,7 @@ describe('Crosshair utils ordinal scales', () => {
specType: SpecType.Series,
id: lineSeries2SpecId,
groupId: 'group1',
seriesType: SeriesTypes.Line,
seriesType: SeriesType.Line,
data: [
['a', 2],
['b', 2],
Expand Down
Loading

0 comments on commit ff37e2b

Please sign in to comment.