UNPKG

@hackoregon/component-library

Version:

Official repo for Hack Oregon React component library

269 lines (263 loc) 6.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _lodash = require("lodash"); var _VisualizationColors = _interopRequireDefault(require("../VisualizationColors")); var _BrandColors = _interopRequireDefault(require("../Brand/BrandColors")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var categoricalColors = _VisualizationColors["default"].categorical; var civicPrimary = _BrandColors["default"].primary.hex; var civicSecondary = _BrandColors["default"].secondary.hex; var civicTertiary = _BrandColors["default"].tertiary.hex; var civicSecondaryLighter = _BrandColors["default"].medium.hex; var civicSecondaryLightest = _BrandColors["default"].subdued.hex; var civicCategoricalColor1 = categoricalColors.pink.hex; var civicCategoricalColor2 = categoricalColors.green.hex; var civicCategoricalColor3 = categoricalColors.blue.hex; var civicCategoricalColor4 = categoricalColors.purple.hex; var civicCategoricalColor5 = categoricalColors.yellow.hex; var colors = [civicCategoricalColor1, civicCategoricalColor2, civicCategoricalColor3, civicCategoricalColor4, civicCategoricalColor5, civicTertiary]; var sansSerif = "'Roboto Condensed', 'Helvetica Neue', Helvetica, sans-serif"; var letterSpacing = "normal"; var fontSize = 12; var fontWeight = "normal"; var padding = 8; var horizontalBarPadding = 2; var baseProps = { width: 650, height: 350, padding: 50 }; var tooltipProps = { x: 325, y: 0, orientation: "bottom", pointerLength: 0, cornerRadius: 0 }; var baseLabelStyles = { fontFamily: sansSerif, fontSize: fontSize, fontWeight: fontWeight, letterSpacing: letterSpacing, padding: padding, fill: civicPrimary }; var centeredLabelStyles = (0, _lodash.assign)({ textAnchor: "middle" }, baseLabelStyles); var pieLabelStyles = { fontFamily: sansSerif, fontSize: "16px", fontWeight: "bold" }; var axisLabelStyles = { fontFamily: sansSerif, fontSize: "14px", fontWeight: "bold" }; var strokeDasharray = "10, 5"; var strokeLinecap = "round"; var strokeLinejoin = "round"; var _default = { area: (0, _lodash.assign)({ style: { data: { fill: "white", stroke: civicPrimary, strokeWidth: 1 }, labels: centeredLabelStyles } }, baseProps), areaScatter: (0, _lodash.assign)({ style: { data: { fill: "white", stroke: civicPrimary, strokeWidth: 1 } } }, baseProps), axis: (0, _lodash.assign)({ style: { axis: { fill: "transparent", stroke: civicSecondaryLighter, strokeWidth: 2, strokeLinecap: strokeLinecap, strokeLinejoin: strokeLinejoin }, axisLabel: (0, _lodash.assign)({}, centeredLabelStyles, { padding: padding, stroke: "transparent" }), grid: { fill: "transparent", stroke: civicSecondaryLightest, strokeDasharray: strokeDasharray, strokeLinecap: strokeLinecap, strokeLinejoin: strokeLinejoin }, ticks: { fill: "transparent", padding: padding, size: 5, stroke: civicSecondaryLighter, strokeWidth: 1, strokeLinecap: strokeLinecap, strokeLinejoin: strokeLinejoin }, tickLabels: (0, _lodash.assign)({}, baseLabelStyles, { fill: civicPrimary, stroke: "transparent" }) } }, baseProps), axisLabel: (0, _lodash.assign)({ style: axisLabelStyles }, baseProps), bar: (0, _lodash.assign)({ style: { data: { fill: civicTertiary, padding: horizontalBarPadding, stroke: "transparent", strokeWidth: 0, width: 20 }, labels: baseLabelStyles } }, baseProps), candlestick: (0, _lodash.assign)({ style: { data: { stroke: civicSecondaryLighter }, labels: centeredLabelStyles }, candleColors: { positive: "#ffffff", negative: civicSecondaryLighter } }, baseProps), chart: (0, _lodash.assign)({ animate: { duration: 1000 } }, baseProps), errorbar: (0, _lodash.assign)({ style: { data: { fill: "transparent", opacity: 1, stroke: civicSecondaryLighter, strokeWidth: 2 }, labels: (0, _lodash.assign)({}, centeredLabelStyles, { stroke: "transparent", strokeWidth: 0 }) } }, baseProps), group: (0, _lodash.assign)({ colorScale: colors }, baseProps), legend: { colorScale: colors, gutter: 10, orientation: "vertical", titleOrientation: "top", style: { data: { type: "circle" }, labels: baseLabelStyles, title: (0, _lodash.assign)({}, baseLabelStyles, { padding: 5 }) } }, line: (0, _lodash.assign)({ style: { data: { fill: "transparent", opacity: 1, stroke: civicSecondaryLighter, strokeWidth: 2 }, labels: (0, _lodash.assign)({}, baseLabelStyles, { stroke: "transparent", strokeWidth: 0, textAnchor: "start" }) } }, baseProps), pie: (0, _lodash.assign)({ colorScale: colors, style: { data: { padding: padding, stroke: "white", strokeWidth: 2 }, labels: (0, _lodash.assign)({}, baseLabelStyles, { padding: 20, stroke: "transparent", strokeWidth: 0 }) } }, baseProps), pieLabel: (0, _lodash.assign)({ style: pieLabelStyles }, baseProps), scatter: (0, _lodash.assign)({ style: { data: { fill: civicSecondaryLighter, opacity: 1, stroke: "transparent", strokeWidth: 0 }, labels: (0, _lodash.assign)({}, centeredLabelStyles, { stroke: "transparent" }) } }, baseProps), stack: (0, _lodash.assign)({ colorScale: colors }, baseProps), tooltip: (0, _lodash.assign)({ style: { data: { fill: "transparent", stroke: "transparent", strokeWidth: 0 }, labels: centeredLabelStyles, customHoverColor: civicSecondary }, flyoutStyle: { stroke: "transparent", strokeWidth: 1, fill: civicSecondaryLightest }, flyoutProps: { cornerRadius: 10, pointerLength: 10 } }, tooltipProps), voronoi: (0, _lodash.assign)({ style: { data: { fill: "transparent", stroke: "transparent", strokeWidth: 0 }, labels: centeredLabelStyles } }, baseProps) }; exports["default"] = _default;