UNPKG

@patternfly/react-charts

Version:

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

248 lines • 15.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ColorTheme = void 0; const tslib_1 = require("tslib"); const chart_echarts_BackgroundColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_BackgroundColor')); 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_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_boxplot_item_style_BorderColor')); const chart_echarts_candlestick_item_style_positive_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_candlestick_item_style_positive_BorderColor')); const chart_echarts_candlestick_item_style_positive_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_candlestick_item_style_positive_Color')); const chart_echarts_candlestick_item_style_negative_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_candlestick_item_style_negative_Color')); const chart_echarts_candlestick_item_style_negative_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_candlestick_item_style_negative_BorderColor')); const chart_echarts_funnel_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_funnel_item_style_BorderColor')); const chart_echarts_gauge_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_gauge_item_style_BorderColor')); const chart_echarts_geo_emphasis_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_geo_emphasis_item_style_BorderColor')); const chart_echarts_geo_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_geo_item_style_BorderColor')); const chart_echarts_global_axis_axis_line_item_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_axis_line_item_style_Color')); const chart_echarts_global_axis_axis_tick_item_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_axis_tick_item_style_Color')); const chart_echarts_global_axis_split_area_area_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_axis_split_area_area_style_Color')); const chart_echarts_global_label_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_global_label_Color')); const chart_echarts_graph_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_graph_item_style_BorderColor')); const chart_echarts_graph_line_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_graph_line_style_Color')); const chart_echarts_map_emphasis_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_map_emphasis_item_style_BorderColor')); const chart_echarts_map_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_map_item_style_BorderColor')); const chart_echarts_parallel_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_parallel_item_style_BorderColor')); const chart_echarts_pie_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_pie_item_style_BorderColor')); const chart_echarts_sankey_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_sankey_item_style_BorderColor')); const chart_echarts_scatter_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_scatter_item_style_BorderColor')); const chart_echarts_tooltip_axis_pointer_cross_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_tooltip_axis_pointer_cross_style_Color')); const chart_echarts_tooltip_axis_pointer_line_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_tooltip_axis_pointer_line_style_Color')); const chart_echarts_toolbox_emphasis_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_toolbox_emphasis_item_style_BorderColor')); const chart_echarts_toolbox_item_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_toolbox_item_style_BorderColor')); const chart_echarts_timeline_emphasis_control_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_emphasis_control_style_Color')); const chart_echarts_timeline_emphasis_item_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_emphasis_item_style_Color')); const chart_echarts_timeline_emphasis_control_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_emphasis_control_style_BorderColor')); const chart_echarts_timeline_checkpoint_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_checkpoint_style_Color')); const chart_echarts_timeline_checkpoint_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_checkpoint_style_BorderColor')); const chart_echarts_timeline_control_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_control_style_Color')); const chart_echarts_timeline_control_style_BorderColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_control_style_BorderColor')); const chart_echarts_timeline_item_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_item_style_Color')); const chart_echarts_timeline_line_style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_timeline_line_style_Color')); const chart_echarts_tooltip_backgroundColor_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_tooltip_backgroundColor')); const chart_echarts_tooltip_text_Style_Color_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/chart_echarts_tooltip_text_Style_Color')); const styles_1 = require("../utils/styles"); /** * ECharts color theme * * @private Not intended as public API and subject to change * @beta */ const ColorTheme = (props) => { const { COLOR_SCALE } = props; const labelProps = { color: (0, styles_1.getComputedStyleValue)(chart_echarts_global_label_Color_1.default) }; const axisProps = { axisLabel: Object.assign({}, labelProps), axisLine: { lineStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_axis_line_item_style_Color_1.default) } }, axisTick: { lineStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_axis_tick_item_style_Color_1.default) } }, splitArea: { areaStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_split_area_area_style_Color_1.default) } }, splitLine: { lineStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_global_axis_axis_tick_item_style_Color_1.default) // Grid } } }; return { color: COLOR_SCALE, // See https://echarts.apache.org/en/option.html#color backgroundColor: (0, styles_1.getComputedStyleValue)(chart_echarts_BackgroundColor_1.default), // See https://echarts.apache.org/en/option.html#backgroundColor bar: { itemStyle: { barBorderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_bar_item_style_BarBorderColor_1.default) } }, boxplot: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_boxplot_item_style_BorderColor_1.default) } }, candlestick: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_candlestick_item_style_negative_BorderColor_1.default), borderColor0: (0, styles_1.getComputedStyleValue)(chart_echarts_candlestick_item_style_positive_BorderColor_1.default), color: (0, styles_1.getComputedStyleValue)(chart_echarts_candlestick_item_style_negative_Color_1.default), color0: (0, styles_1.getComputedStyleValue)(chart_echarts_candlestick_item_style_positive_Color_1.default) } }, categoryAxis: Object.assign({}, axisProps), dataZoom: {}, funnel: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_funnel_item_style_BorderColor_1.default) } }, gauge: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_gauge_item_style_BorderColor_1.default) } }, geo: { emphasis: { itemStyle: { areaColor: COLOR_SCALE[1], borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_geo_emphasis_item_style_BorderColor_1.default) }, label: Object.assign({}, labelProps) }, itemStyle: { areaColor: COLOR_SCALE[0], borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_geo_item_style_BorderColor_1.default) }, label: Object.assign({}, labelProps) }, graph: { color: COLOR_SCALE, itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_graph_item_style_BorderColor_1.default) }, label: Object.assign({}, labelProps), lineStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_graph_line_style_Color_1.default) } }, label: Object.assign({}, labelProps), legend: { textStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_global_label_Color_1.default) } }, line: {}, logAxis: Object.assign({}, axisProps), map: { emphasis: { itemStyle: { areaColor: COLOR_SCALE[1], borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_map_emphasis_item_style_BorderColor_1.default) }, label: Object.assign({}, labelProps) }, itemStyle: { areaColor: COLOR_SCALE[0], borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_map_item_style_BorderColor_1.default) }, label: Object.assign({}, labelProps) }, markPoint: { emphasis: { label: Object.assign({}, labelProps) }, label: Object.assign({}, labelProps) }, parallel: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_parallel_item_style_BorderColor_1.default) } }, pie: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_pie_item_style_BorderColor_1.default) } }, radar: {}, sankey: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_sankey_item_style_BorderColor_1.default) } }, scatter: { itemStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_scatter_item_style_BorderColor_1.default) } }, textStyle: {}, timeAxis: Object.assign({}, axisProps), timeline: { emphasis: { controlStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_emphasis_control_style_Color_1.default), borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_emphasis_control_style_BorderColor_1.default) }, itemStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_emphasis_item_style_Color_1.default) }, label: Object.assign({}, labelProps) }, checkpointStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_checkpoint_style_Color_1.default), borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_checkpoint_style_BorderColor_1.default) }, controlStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_control_style_Color_1.default), borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_control_style_BorderColor_1.default) }, itemStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_item_style_Color_1.default) }, label: Object.assign({}, labelProps), lineStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_timeline_line_style_Color_1.default) } }, title: { subtextStyle: Object.assign({}, labelProps), textStyle: Object.assign({}, labelProps) }, toolbox: { emphasis: { iconStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_toolbox_emphasis_item_style_BorderColor_1.default) } }, iconStyle: { borderColor: (0, styles_1.getComputedStyleValue)(chart_echarts_toolbox_item_style_BorderColor_1.default) } }, tooltip: { backgroundColor: (0, styles_1.getComputedStyleValue)(chart_echarts_tooltip_backgroundColor_1.default), axisPointer: { crossStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_tooltip_axis_pointer_cross_style_Color_1.default) }, lineStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_tooltip_axis_pointer_line_style_Color_1.default) } }, textStyle: { color: (0, styles_1.getComputedStyleValue)(chart_echarts_tooltip_text_Style_Color_1.default) } }, valueAxis: Object.assign({}, axisProps), visualMap: { color: COLOR_SCALE } }; }; exports.ColorTheme = ColorTheme; //# sourceMappingURL=color-theme.js.map