UNPKG

@neo4j-ndl/react-charts

Version:

React implementation of charts from Neo4j Design System

166 lines 6.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ndlEchartsTheme = void 0; /** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ const base_1 = require("@neo4j-ndl/base"); const axisCommon = (theme) => ({ axisLine: { lineStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.strong, width: 2, cap: 'square', }, }, axisTick: { length: 8, lineStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.strong, width: 1, }, show: true, }, axisLabel: { fontFamily: base_1.tokens.font['font-family']['body-small'], fontSize: base_1.tokens.font.size['body-small'], color: base_1.tokens.theme[theme].palette.neutral.text.weaker, }, splitLine: { lineStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.weak, }, }, splitArea: { areaStyle: { color: [base_1.tokens.theme[theme].palette.neutral.hover, 'transparent'], }, }, minorSplitLine: { lineStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.weak, }, }, }); const ndlEchartsTheme = (theme) => { return { darkMode: theme === 'dark', color: Object.values(base_1.tokens.palette.categorical), backgroundColor: 'transparent', axisPointer: { lineStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.strong, }, crossStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.strong, }, label: { color: base_1.tokens.theme[theme].palette.neutral.text.weaker, }, }, // We use a custom legend so this does not affect anything legend: {}, textStyle: { color: base_1.tokens.theme[theme].palette.neutral.text.weaker, }, // We are not using the echarts title so this does not affect anything title: {}, toolbox: {}, dataZoom: { borderColor: base_1.tokens.theme[theme].palette.neutral.border.weak, backgroundColor: 'transparent', fillerColor: `rgb( from ${base_1.tokens.theme[theme].palette.neutral.hover} r g b / 0.1)`, borderRadius: parseInt(base_1.tokens.borderRadius.sm.replace('px', '')), textStyle: { color: base_1.tokens.theme[theme].palette.neutral.text.weaker, }, handleStyle: { color: base_1.tokens.theme[theme].palette.neutral.bg.weak, borderColor: base_1.tokens.theme[theme].palette.neutral.border.strong, // borderRadius: 0, // Doesn't work }, handleSize: '80%', handleIcon: 'M2 0.5h4s1.5 0 1.5 1.5v16s0 1.5 -1.5 1.5h-4s-1.5 0 -1.5 -1.5v-16s0 -1.5 1.5 -1.5', moveHandleSize: 6, moveHandleStyle: { color: base_1.tokens.theme[theme].palette.neutral.bg.strong, backgroundColor: base_1.tokens.theme[theme].palette.neutral.bg.strong, opacity: 1, // 0.3, }, dataBackground: { areaStyle: { color: base_1.tokens.theme[theme].palette.neutral.bg.default, opacity: 1, }, lineStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.weak, opacity: 1, width: 1, }, }, selectedDataBackground: { areaStyle: { color: base_1.tokens.theme[theme].palette.neutral.bg['on-bg-weak'], opacity: 1, shadowBlur: 0, }, lineStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.strong, opacity: 1, width: 1, }, }, emphasis: { handleStyle: { color: base_1.tokens.theme[theme].palette.neutral.bg.strong, opacity: 1, borderColor: base_1.tokens.theme[theme].palette.neutral.border.strong, }, moveHandleStyle: { color: base_1.tokens.theme[theme].palette.neutral.border.strong, opacity: 1, borderColor: base_1.tokens.theme[theme].palette.neutral.border.strong, }, handleLabel: {}, }, }, // Not implemented visualMap: {}, // Not implemented timeline: {}, // Not implemented calendar: {}, timeAxis: axisCommon(theme), logAxis: axisCommon(theme), valueAxis: axisCommon(theme), categoryAxis: axisCommon(theme), line: { symbol: 'circle', }, // Not implemented graph: {}, // Not implemented gauge: {}, // Not implemented candlestick: {}, }; }; exports.ndlEchartsTheme = ndlEchartsTheme; //# sourceMappingURL=ndl-echarts-theme.js.map