mirror of
https://github.com/apache/superset.git
synced 2026-04-17 23:25:05 +00:00
chore: make TS enums strictly PascalCase (#26875)
This commit is contained in:
@@ -25,13 +25,13 @@ import {
|
||||
AnnotationLayer,
|
||||
AnnotationOpacity,
|
||||
AnnotationType,
|
||||
AxisType,
|
||||
DataRecord,
|
||||
evalExpression,
|
||||
FormulaAnnotationLayer,
|
||||
isRecordAnnotationResult,
|
||||
isTableAnnotationLayer,
|
||||
isTimeseriesAnnotationResult,
|
||||
AxisType,
|
||||
} from '@superset-ui/core';
|
||||
import { EchartsTimeseriesChartProps } from '../types';
|
||||
import { EchartsMixedTimeseriesProps } from '../MixedTimeseries/types';
|
||||
@@ -46,7 +46,7 @@ export function evalFormula(
|
||||
|
||||
return data.map(row => {
|
||||
let value = row[xAxis];
|
||||
if (xAxisType === 'time') {
|
||||
if (xAxisType === AxisType.Time) {
|
||||
value = new Date(value as string).getTime();
|
||||
}
|
||||
return [value, evalExpression(expression, (value || 0) as number)];
|
||||
|
||||
@@ -364,7 +364,7 @@ export function formatSeriesName(
|
||||
if (typeof name === 'boolean') {
|
||||
return name.toString();
|
||||
}
|
||||
if (name instanceof Date || coltype === GenericDataType.TEMPORAL) {
|
||||
if (name instanceof Date || coltype === GenericDataType.Temporal) {
|
||||
const normalizedName =
|
||||
typeof name === 'string' ? normalizeTimestamp(name) : name;
|
||||
const d =
|
||||
@@ -535,15 +535,15 @@ export function getAxisType(
|
||||
dataType?: GenericDataType,
|
||||
): AxisType {
|
||||
if (forceCategorical) {
|
||||
return AxisType.category;
|
||||
return AxisType.Category;
|
||||
}
|
||||
if (dataType === GenericDataType.TEMPORAL) {
|
||||
return AxisType.time;
|
||||
if (dataType === GenericDataType.Temporal) {
|
||||
return AxisType.Time;
|
||||
}
|
||||
if (dataType === GenericDataType.NUMERIC && !stack) {
|
||||
return AxisType.value;
|
||||
if (dataType === GenericDataType.Numeric && !stack) {
|
||||
return AxisType.Value;
|
||||
}
|
||||
return AxisType.category;
|
||||
return AxisType.Category;
|
||||
}
|
||||
|
||||
export function getOverMaxHiddenFormatter(
|
||||
@@ -585,7 +585,7 @@ export function getMinAndMaxFromBounds(
|
||||
max?: number,
|
||||
seriesType?: EchartsTimeseriesSeriesType,
|
||||
): BoundsType | {} {
|
||||
if (axisType === AxisType.value && truncateAxis) {
|
||||
if (axisType === AxisType.Value && truncateAxis) {
|
||||
const ret: BoundsType = {};
|
||||
if (seriesType === EchartsTimeseriesSeriesType.Bar) {
|
||||
ret.scale = true;
|
||||
|
||||
Reference in New Issue
Block a user