@superset-ui/core
Version:
270 lines (144 loc) • 4.74 kB
JavaScript
/*
* 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.
*/
/** Type checking is disabled for this file due to reselect only supporting
* TS declarations for selectors with up to 12 arguments. */
// @ts-nocheck
import { createSelector } from 'reselect';
import {
convertKeysToCamelCase } from
'../..';
// TODO: more specific typing for these fields of ChartProps
/** Optional field for event handlers, renderers */
/**
* Preferred format for ChartProps config
*/
const DEFAULT_WIDTH = 800;
const DEFAULT_HEIGHT = 600;
export default class ChartProps {
constructor(config = {}) {this.annotationData = void 0;this.datasource = void 0;this.rawDatasource = void 0;this.initialValues = void 0;this.formData = void 0;this.rawFormData = void 0;this.height = void 0;this.hooks = void 0;this.ownState = void 0;this.filterState = void 0;this.legendState = void 0;this.queriesData = void 0;this.width = void 0;this.behaviors = void 0;this.displaySettings = void 0;this.appSection = void 0;this.isRefreshing = void 0;this.inputRef = void 0;this.inContextMenu = void 0;this.emitCrossFilters = void 0;this.theme = void 0;
const {
annotationData = {},
datasource = {},
formData = {},
hooks = {},
ownState = {},
filterState = {},
legendState,
initialValues = {},
queriesData = [],
behaviors = [],
displaySettings = {},
width = DEFAULT_WIDTH,
height = DEFAULT_HEIGHT,
appSection,
isRefreshing,
inputRef,
inContextMenu = false,
emitCrossFilters = false,
theme
} = config;
this.width = width;
this.height = height;
this.annotationData = annotationData;
this.datasource = convertKeysToCamelCase(datasource);
this.rawDatasource = datasource;
this.formData = convertKeysToCamelCase(formData);
this.rawFormData = formData;
this.hooks = hooks;
this.initialValues = initialValues;
this.queriesData = queriesData;
this.ownState = ownState;
this.filterState = filterState;
this.legendState = legendState;
this.behaviors = behaviors;
this.displaySettings = displaySettings;
this.appSection = appSection;
this.isRefreshing = isRefreshing;
this.inputRef = inputRef;
this.inContextMenu = inContextMenu;
this.emitCrossFilters = emitCrossFilters;
this.theme = theme;
}
}
// eslint-disable-next-line func-name-matching
ChartProps.createSelector = void 0;ChartProps.createSelector = function create() {
return createSelector(
(input) => input.annotationData,
(input) => input.datasource,
(input) => input.formData,
(input) => input.height,
(input) => input.hooks,
(input) => input.initialValues,
(input) => input.queriesData,
(input) => input.width,
(input) => input.ownState,
(input) => input.filterState,
(input) => input.legendState,
(input) => input.behaviors,
(input) => input.displaySettings,
(input) => input.appSection,
(input) => input.isRefreshing,
(input) => input.inputRef,
(input) => input.inContextMenu,
(input) => input.emitCrossFilters,
(input) => input.theme,
(
annotationData,
datasource,
formData,
height,
hooks,
initialValues,
queriesData,
width,
ownState,
filterState,
legendState,
behaviors,
displaySettings,
appSection,
isRefreshing,
inputRef,
inContextMenu,
emitCrossFilters,
theme) =>
new ChartProps({
annotationData,
datasource,
formData,
height,
hooks,
initialValues,
queriesData,
ownState,
filterState,
legendState,
width,
behaviors,
displaySettings,
appSection,
isRefreshing,
inputRef,
inContextMenu,
emitCrossFilters,
theme
})
);
};
//# sourceMappingURL=ChartProps.js.map