-
Notifications
You must be signed in to change notification settings - Fork 18.2k
Expand file tree
/
Copy pathconstants.ts
More file actions
97 lines (95 loc) · 3.37 KB
/
Copy pathconstants.ts
File metadata and controls
97 lines (95 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import {
DEFAULT_SORT_SERIES_DATA,
sections,
} from '@superset-ui/chart-controls';
import { t } from '@apache-superset/core/translation';
import { LegendOrientation, LegendType } from '../types';
import {
OrientationType,
EchartsTimeseriesSeriesType,
EchartsTimeseriesFormData,
} from './types';
// import {
// DEFAULT_LEGEND_FORM_DATA,
// DEFAULT_TITLE_FORM_DATA,
// } from '../constants';
import { defaultXAxis } from '../defaults';
// @ts-expect-error
export const DEFAULT_FORM_DATA: EchartsTimeseriesFormData = {
// ...DEFAULT_LEGEND_FORM_DATA, // TODO: figure out why these break things for stories (e.g. Bubble Chart)
// Here are the contents of DEFAULT_LEGEND_FORM_DATA:
legendMargin: null,
legendOrientation: LegendOrientation.Top,
legendType: LegendType.Scroll,
showLegend: true,
// ...DEFAULT_TITLE_FORM_DATA, // TODO: figure out why these break things for stories (e.g. Bubble Chart)
// here are the contents of DEFAULT_TITLE_FORM_DATA:
xAxisTitle: '',
xAxisTitleMargin: 40,
yAxisTitle: '',
yAxisTitleMargin: 50,
yAxisTitlePosition: 'Top',
// Now that the weird bug workaround is over, here's the rest...
...DEFAULT_SORT_SERIES_DATA,
annotationLayers: sections.annotationLayers,
area: false,
forecastEnabled: sections.FORECAST_DEFAULT_DATA.forecastEnabled,
forecastInterval: sections.FORECAST_DEFAULT_DATA.forecastInterval,
forecastPeriods: sections.FORECAST_DEFAULT_DATA.forecastPeriods,
forecastSeasonalityDaily:
sections.FORECAST_DEFAULT_DATA.forecastSeasonalityDaily,
forecastSeasonalityWeekly:
sections.FORECAST_DEFAULT_DATA.forecastSeasonalityWeekly,
forecastSeasonalityYearly:
sections.FORECAST_DEFAULT_DATA.forecastSeasonalityYearly,
logAxis: false,
markerEnabled: false,
markerSize: 6,
maxMarkerSize: 30,
minMarkerSize: 5,
minorSplitLine: false,
opacity: 0.2,
orderDesc: true,
rowLimit: 10000,
seriesType: EchartsTimeseriesSeriesType.Line,
stack: false,
tooltipTimeFormat: 'smart_date',
xAxisTimeFormat: 'smart_date',
xAxisNumberFormat: 'SMART_NUMBER',
truncateXAxis: true,
truncateYAxis: false,
yAxisBounds: [null, null],
zoomable: false,
richTooltip: true,
xAxisForceCategorical: false,
xAxisLabelRotation: defaultXAxis.xAxisLabelRotation,
xAxisLabelInterval: defaultXAxis.xAxisLabelInterval,
groupby: [],
showValue: false,
onlyTotal: false,
percentageThreshold: 0,
orientation: OrientationType.Vertical,
sort_series_type: 'sum',
sort_series_ascending: false,
};
export const TIME_SERIES_DESCRIPTION_TEXT: string = t(
'When using other than adaptive formatting, labels may overlap',
);