UNPKG

@patternfly/react-charts

Version:

This library provides a set of React chart components for use with the PatternFly reference implementation.

248 lines • 15.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseTheme = void 0; const tslib_1 = require("tslib"); const chart_echarts_bar_item_style_BarBorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_bar_item_style_BarBorderColor')); const chart_echarts_boxplot_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_boxplot_item_style_BorderWidth')); const chart_echarts_candlestick_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_candlestick_item_style_BorderWidth')); const chart_echarts_datazoom_HandleSize_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_datazoom_HandleSize')); const chart_echarts_funnel_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_funnel_item_style_BorderWidth')); const chart_echarts_gauge_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_gauge_item_style_BorderWidth')); const chart_echarts_gauge_item_style_BorderWidth_2 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_gauge_item_style_BorderWidth')); const chart_echarts_gauge_item_style_BorderWidth_3 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_gauge_item_style_BorderWidth')); const chart_echarts_global_axis_BoundaryGap_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_BoundaryGap')); const chart_echarts_global_axis_axis_label_Show_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_axis_label_Show')); const chart_echarts_global_axis_axis_line_Show_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_axis_line_Show')); const chart_echarts_global_axis_axis_tick_Show_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_axis_tick_Show')); const chart_echarts_global_axis_split_area_Show_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_split_area_Show')); const chart_echarts_global_axis_split_line_Show_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_split_line_Show')); const chart_echarts_graph_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_graph_item_style_BorderWidth')); const chart_echarts_graph_line_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_graph_line_style_BorderWidth')); const chart_echarts_graph_Smooth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_graph_Smooth')); const chart_echarts_graph_Symbol_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_graph_Symbol')); const chart_echarts_graph_SymbolSize_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_graph_SymbolSize')); const chart_echarts_line_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_line_item_style_BorderWidth')); const chart_echarts_line_line_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_line_line_style_BorderWidth')); const chart_echarts_line_Smooth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_line_Smooth')); const chart_echarts_line_Symbol_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_line_Symbol')); const chart_echarts_line_SymbolSize_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_line_SymbolSize')); const chart_echarts_map_emphasis_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_map_emphasis_item_style_BorderWidth')); const chart_echarts_map_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_map_item_style_BorderWidth')); const chart_echarts_parallel_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_parallel_item_style_BorderWidth')); const chart_echarts_pie_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_pie_item_style_BorderWidth')); const chart_echarts_radar_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_radar_item_style_BorderWidth')); const chart_echarts_radar_line_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_radar_line_style_BorderWidth')); const chart_echarts_radar_Smooth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_radar_Smooth')); const chart_echarts_radar_Symbol_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_radar_Symbol')); const chart_echarts_radar_SymbolSize_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_radar_SymbolSize')); const chart_echarts_sankey_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_sankey_item_style_BorderWidth')); const chart_echarts_scatter_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_scatter_item_style_BorderWidth')); const chart_echarts_timeline_control_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_control_style_BorderWidth')); const chart_echarts_timeline_emphasis_control_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_emphasis_control_style_BorderWidth')); const chart_echarts_timeline_item_style_BorderWidth_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_item_style_BorderWidth')); const chart_echarts_timeline_line_style_Width_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_line_style_Width')); const chart_echarts_tooltip_axis_pointer_cross_style_Width_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_tooltip_axis_pointer_cross_style_Width')); const chart_echarts_tooltip_axis_pointer_line_style_Width_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_tooltip_axis_pointer_line_style_Width')); const chart_global_FontFamily_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_global_FontFamily')); const chart_global_FontSize_sm_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_global_FontSize_sm')); const styles_1 = require("../utils/styles"); /** * Base theme containing EChart properties only * * @private Not intended as public API and subject to change */ const BaseTheme = () => { const textProps = { fontFamily: chart_global_FontFamily_1.default.var.replace(/"/g, "'"), // Well-formed XML fontSize: chart_global_FontSize_sm_1.default.value }; const axisProps = { boundaryGap: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_BoundaryGap_1.default), axisLabel: Object.assign(Object.assign({}, textProps), { show: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_axis_label_Show_1.default) }), axisLine: { lineStyle: {}, show: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_axis_line_Show_1.default) }, axisTick: { lineStyle: {}, show: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_axis_tick_Show_1.default) }, splitArea: { areaStyle: {}, show: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_split_area_Show_1.default) }, splitLine: { lineStyle: {}, show: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_split_line_Show_1.default) // Grid } }; return { bar: { itemStyle: { barBorderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_bar_item_style_BarBorderColor_1.default) } }, boxplot: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_boxplot_item_style_BorderWidth_1.default) } }, candlestick: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_candlestick_item_style_BorderWidth_1.default) } }, categoryAxis: Object.assign({}, axisProps), dataZoom: { handleSize: (0, styles_1.getComputedStyleValue)(chart_echarts_datazoom_HandleSize_1.default), textStyle: Object.assign({}, textProps) }, funnel: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_funnel_item_style_BorderWidth_1.default) } }, gauge: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_gauge_item_style_BorderWidth_1.default) } }, geo: { emphasis: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_gauge_item_style_BorderWidth_2.default) }, label: {} }, itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_gauge_item_style_BorderWidth_3.default) }, label: {} }, graph: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_graph_item_style_BorderWidth_1.default) }, label: {}, lineStyle: { width: (0, styles_1.getComputedStyleValue)(chart_echarts_graph_line_style_BorderWidth_1.default) }, smooth: (0, styles_1.getComputedStyleValue)(chart_echarts_graph_Smooth_1.default), symbolSize: (0, styles_1.getComputedStyleValue)(chart_echarts_graph_SymbolSize_1.default), symbol: (0, styles_1.getComputedStyleValue)(chart_echarts_graph_Symbol_1.default) }, label: Object.assign({}, textProps), legend: { textStyle: Object.assign({}, textProps) }, line: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_line_item_style_BorderWidth_1.default) }, lineStyle: { width: (0, styles_1.getComputedStyleValue)(chart_echarts_line_line_style_BorderWidth_1.default) }, smooth: (0, styles_1.getComputedStyleValue)(chart_echarts_line_Smooth_1.default), symbolSize: (0, styles_1.getComputedStyleValue)(chart_echarts_line_SymbolSize_1.default), symbol: (0, styles_1.getComputedStyleValue)(chart_echarts_line_Symbol_1.default) }, logAxis: Object.assign({}, axisProps), map: { emphasis: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_map_emphasis_item_style_BorderWidth_1.default) }, label: {} }, itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_map_item_style_BorderWidth_1.default) }, label: { label: {} } }, markPoint: { emphasis: { label: {} }, label: {} }, parallel: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_parallel_item_style_BorderWidth_1.default) } }, pie: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_pie_item_style_BorderWidth_1.default) } }, radar: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_radar_item_style_BorderWidth_1.default) }, lineStyle: { width: (0, styles_1.getComputedStyleValue)(chart_echarts_radar_line_style_BorderWidth_1.default) }, smooth: (0, styles_1.getComputedStyleValue)(chart_echarts_radar_Smooth_1.default), symbolSize: (0, styles_1.getComputedStyleValue)(chart_echarts_radar_SymbolSize_1.default), symbol: (0, styles_1.getComputedStyleValue)(chart_echarts_radar_Symbol_1.default) }, sankey: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_sankey_item_style_BorderWidth_1.default) } }, scatter: { itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_scatter_item_style_BorderWidth_1.default) } }, textStyle: Object.assign({}, textProps), timeAxis: Object.assign({}, axisProps), timeline: { emphasis: { controlStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_emphasis_control_style_BorderWidth_1.default) }, itemStyle: {}, label: {} }, checkpointStyle: {}, controlStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_control_style_BorderWidth_1.default) }, itemStyle: { borderWidth: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_item_style_BorderWidth_1.default) }, label: {}, lineStyle: { width: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_line_style_Width_1.default) } }, title: { subtextStyle: Object.assign({}, textProps), textStyle: Object.assign({}, textProps) }, toolbox: { emphasis: { iconStyle: {} }, iconStyle: {} }, tooltip: { axisPointer: { crossStyle: { width: (0, styles_1.getComputedStyleValue)(chart_echarts_tooltip_axis_pointer_cross_style_Width_1.default) }, lineStyle: { width: (0, styles_1.getComputedStyleValue)(chart_echarts_tooltip_axis_pointer_line_style_Width_1.default) } } }, valueAxis: Object.assign({}, axisProps), visualMap: {} }; }; exports.BaseTheme = BaseTheme; //# sourceMappingURL=base-theme.js.map