@redsift/charts 11.6.0 → 11.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_internal/Axis2.js +15 -18
- package/_internal/Axis2.js.map +1 -1
- package/_internal/BarChart.js +1 -1
- package/_internal/BarChart2.js +165 -32
- package/_internal/BarChart2.js.map +1 -1
- package/index.d.ts +15 -1
- package/index.js +1 -1
- package/package.json +4 -4
package/_internal/Axis2.js
CHANGED
|
@@ -337,23 +337,7 @@ const Axis = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
337
337
|
transform: `translate(${x},${y})${axis === 'x' ? '' : ',rotate(180)'}`,
|
|
338
338
|
ref: axisRef,
|
|
339
339
|
$color: textColor
|
|
340
|
-
}),
|
|
341
|
-
className: `${Axis.className}__grid`
|
|
342
|
-
}, ticks.map((tick, i) => /*#__PURE__*/React__default.createElement("line", {
|
|
343
|
-
key: `grid-${tick.key}-${i}`,
|
|
344
|
-
className: `${Axis.className}-grid__line`,
|
|
345
|
-
x1: axis === 'x' ? tick.x : 0,
|
|
346
|
-
x2: axis === 'x' ? tick.x : gridLength * -1,
|
|
347
|
-
y1: axis === 'x' ? 0 : tick.y,
|
|
348
|
-
y2: axis === 'x' ? gridLength * -1 : tick.y,
|
|
349
|
-
style: _objectSpread2(_objectSpread2({
|
|
350
|
-
strokeDasharray: '4,4',
|
|
351
|
-
opacity: 0.2,
|
|
352
|
-
strokeWidth: 0.5
|
|
353
|
-
}, gridStyle), {}, {
|
|
354
|
-
stroke: 'currentColor'
|
|
355
|
-
})
|
|
356
|
-
}))) : null, variant === AxisVariant.default || variant === AxisVariant.tick || variant === AxisVariant.lineTick || variant === AxisVariant.tickValue ? transition((transitionProps, tick, _state, tickIndex) => {
|
|
340
|
+
}), variant === AxisVariant.default || variant === AxisVariant.tick || variant === AxisVariant.lineTick || variant === AxisVariant.tickValue ? transition((transitionProps, tick, _state, tickIndex) => {
|
|
357
341
|
return /*#__PURE__*/React__default.createElement(it.g, {
|
|
358
342
|
className: `${Axis.className}__tick`,
|
|
359
343
|
key: tickIndex,
|
|
@@ -361,7 +345,20 @@ const Axis = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
361
345
|
style: {
|
|
362
346
|
opacity: transitionProps.opacity
|
|
363
347
|
}
|
|
364
|
-
}, /*#__PURE__*/React__default.createElement("line", {
|
|
348
|
+
}, gridLength ? /*#__PURE__*/React__default.createElement("line", {
|
|
349
|
+
className: `${Axis.className}-grid__line`,
|
|
350
|
+
x1: axis === 'x' ? tick.lineX : 0,
|
|
351
|
+
x2: axis === 'x' ? tick.lineX : gridLength * (position === 'right' ? -1 : 1),
|
|
352
|
+
y1: axis === 'x' ? 0 : tick.lineY,
|
|
353
|
+
y2: axis === 'x' ? gridLength * (position === 'bottom' ? -1 : 1) : tick.lineY,
|
|
354
|
+
style: _objectSpread2(_objectSpread2({
|
|
355
|
+
strokeDasharray: '4,4',
|
|
356
|
+
opacity: 0.2,
|
|
357
|
+
strokeWidth: 0.5
|
|
358
|
+
}, gridStyle), {}, {
|
|
359
|
+
stroke: 'currentColor'
|
|
360
|
+
})
|
|
361
|
+
}) : null, /*#__PURE__*/React__default.createElement("line", {
|
|
365
362
|
className: `${Axis.className}-tick__line`,
|
|
366
363
|
x1: 0,
|
|
367
364
|
x2: tick.lineX,
|
package/_internal/Axis2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Axis2.js","sources":["../../src/components/Axis/types.ts","../../src/components/Axis/styles.ts","../../src/components/Axis/computeTicks.ts","../../src/components/Axis/Axis.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { ValueOf, Theme } from '@redsift/design-system';\nimport { AnyScale, NumericValue, ScaleValue, StringValue, TicksSpec } from '../../types';\n\n/**\n * Component variant.\n */\nexport const AxisVariant = {\n none: 'none',\n line: 'line',\n lineTick: 'lineTick',\n tick: 'tick',\n tickValue: 'tickValue',\n default: 'default',\n} as const;\nexport type AxisVariant = ValueOf<typeof AxisVariant>;\n\nexport const AxisPosition = {\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n left: 'left',\n};\nexport type AxisPosition = ValueOf<typeof AxisPosition>;\n\n/**\n * Component props.\n */\nexport interface AxisProps extends Omit<ComponentProps<'g'>, 'scale'> {\n /** Disable animations. */\n disableAnimations?: boolean;\n format?: string;\n /** Whether to display grid or not. The length is mandatory and should usually be the length of the other axis. */\n grid?:\n | boolean\n | {\n length?: number;\n stroke?: string;\n strokeWidth?: number;\n strokeDasharray?: string;\n opacity?: number;\n };\n legend?: string;\n legendOffset?: number;\n legendPosition?: 'start' | 'middle' | 'end';\n legendX?: number;\n legendY?: number;\n legendRotation?: number;\n legendStyle?: React.CSSProperties;\n /** Length of the axis. */\n length?: number;\n /** Position of axis. top|bottom means this is an x axis, right|left means this is an y axis. */\n position?: AxisPosition;\n /** Scale (d3.js) used to generate the axis. */\n scale?: AnyScale;\n tickFormat?:\n | ((d: NumericValue) => string)\n | ((d: StringValue) => string)\n | ((d: Date) => string)\n | ((d: ScaleValue) => string);\n tickPadding?: number;\n tickRotation?: number;\n tickSize?: number;\n tickValues?: TicksSpec;\n tickRemodelling?: (tickValues: any[]) => any[];\n /** Variant. */\n variant?: AxisVariant;\n /** X position. */\n x?: number;\n /** Y position. */\n y?: number;\n /** Chart width, used for horizontal grid. */\n chartWidth?: number;\n /** Chart height, used for horizontal grid. */\n chartHeight?: number;\n /** Section height, used for horizontal grid within a section. */\n sectionHeight?: number;\n /** Color used for tick values. */\n textColor?: string;\n /** Custom method to choose which tick value to color if not all. */\n tickToColor?: (\n tick?: {\n textX: number;\n textY: number;\n lineX: number;\n lineY: number;\n x: number;\n y: number;\n key: string;\n value: ScaleValue;\n },\n index?: number\n ) => boolean;\n}\n\nexport type StyledAxisProps = Omit<AxisProps, 'areXLabelsRotated' | 'size' | 'scale'> & {\n $theme: Theme;\n $color?: string;\n};\n","import styled, { css } from 'styled-components';\nimport { StyledAxisProps } from './types';\nimport { animated } from '@react-spring/web';\nimport { Theme } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledAxis = styled(animated.g)<StyledAxisProps>`\n .redsift-axis__line,\n .redsift-axis-tick__line {\n fill: none;\n ${({ $theme }) => css`\n stroke: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n shape-rendering: crispEdges;\n }\n\n text {\n font-family: var(--redsift-typography-font-family-poppins);\n ${({ $theme }) => css`\n fill: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n font-size: 10px;\n user-select: none;\n }\n\n text.colored {\n ${({ $theme, $color }) => css`\n fill: ${$color === 'green'\n ? '#029B57'\n : $color === 'red'\n ? '#CB0E0E'\n : `var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'})`};\n `}\n }\n`;\n","import { AnyScale, Coordinates, ScaleValue, ScaleWithBandwidth, TicksSpec } from '../../types';\n\nconst getScaleTicks = (scale: AnyScale, spec?: TicksSpec) => {\n // specific values\n if (Array.isArray(spec)) {\n return spec;\n }\n\n // continuous scales\n if ('ticks' in scale) {\n // default behaviour\n if (spec === undefined) {\n return scale.ticks();\n }\n\n // specific tick count\n if (typeof spec === 'number' && isFinite(spec) && Math.floor(spec) === spec) {\n return scale.ticks(spec);\n }\n\n if (typeof spec === 'function') {\n return scale.ticks();\n }\n }\n\n // non linear scale default\n return scale.domain();\n};\n\nexport const centerScale = (scale: ScaleWithBandwidth) => {\n const bandwidth = scale.bandwidth();\n\n if (bandwidth === 0) return scale;\n\n let offset = bandwidth / 2;\n if (scale.round()) {\n offset = Math.round(offset);\n }\n\n return <T extends ScaleValue>(d: T) => (scale(d) ?? 0) + offset;\n};\n\nexport const computeTicks = ({\n axis,\n scale,\n ticksPosition,\n tickValues,\n tickSize,\n tickPadding,\n tickRotation,\n tickRemodelling,\n}: {\n axis: 'x' | 'y';\n scale: AnyScale;\n ticksPosition?: 'after' | 'before';\n tickValues?: TicksSpec;\n tickSize: number;\n tickPadding: number;\n tickRotation: number;\n tickRemodelling?: (tickValues: any[]) => any[];\n}) => {\n const values = tickRemodelling ? tickRemodelling(getScaleTicks(scale, tickValues)) : getScaleTicks(scale, tickValues);\n\n const position = 'bandwidth' in scale ? centerScale(scale) : scale;\n const line = { lineX: 0, lineY: 0 };\n const text = { textX: 0, textY: 0 };\n\n const isRTL = typeof document === 'object' ? document.dir === 'rtl' : false;\n let translate: (value: ScaleValue) => Coordinates;\n let textAlign = 'middle';\n let textBaseline = 'central';\n\n if (axis === 'x') {\n translate = (d) => ({ x: position(d) ?? 0, y: 0 });\n\n line.lineY = tickSize * (ticksPosition === 'after' ? 1 : -1);\n text.textY = (tickSize + tickPadding) * (ticksPosition === 'after' ? 1 : -1);\n\n if (ticksPosition === 'after') {\n textBaseline = 'text-before-edge';\n } else {\n textBaseline = 'alphabetic';\n }\n\n if (tickRotation === 0) {\n textAlign = 'middle';\n } else if ((ticksPosition === 'after' && tickRotation < 0) || (ticksPosition === 'before' && tickRotation > 0)) {\n textAlign = isRTL ? 'start' : 'end';\n textBaseline = 'middle';\n } else if ((ticksPosition === 'after' && tickRotation > 0) || (ticksPosition === 'before' && tickRotation < 0)) {\n textAlign = isRTL ? 'end' : 'start';\n textBaseline = 'middle';\n }\n } else {\n translate = (d) => ({ x: 0, y: position(d) ?? 0 });\n\n line.lineX = tickSize * (ticksPosition === 'after' ? 1 : -1);\n text.textX = (tickSize + tickPadding) * (ticksPosition === 'after' ? 1 : -1);\n\n if (ticksPosition === 'after') {\n textAlign = 'start';\n } else {\n textAlign = 'end';\n }\n }\n\n const ticks = values.map((value: ScaleValue) => ({\n key: value instanceof Date ? `${value.valueOf()}` : `${value}`,\n value,\n ...translate(value),\n ...line,\n ...text,\n }));\n\n return {\n ticks,\n textAlign,\n textBaseline,\n };\n};\n","import React, { forwardRef, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp, useTheme } from '@redsift/design-system';\n\nimport { AxisProps, AxisPosition, AxisVariant } from './types';\nimport { StyledAxis } from './styles';\nimport { animated, useSpring, useTransition } from '@react-spring/web';\nimport { computeTicks } from './computeTicks';\nimport { config } from '../../config';\nimport { AnyScale } from '@redsift/charts/types';\n\nconst COMPONENT_NAME = 'Axis';\nconst CLASSNAME = 'redsift-axis';\n\nexport const getAxisType = (position: AxisPosition) =>\n [AxisPosition.top, AxisPosition.bottom].includes(position) ? 'x' : 'y';\n\nexport const Axis: Comp<AxisProps, SVGGElement> = forwardRef((props, ref) => {\n const {\n className,\n disableAnimations,\n grid,\n length,\n legend,\n legendOffset = -32,\n legendPosition = 'end',\n legendX: propsLegendX,\n legendY: propsLegendY,\n legendRotation: propsLegendRotation,\n legendStyle,\n position = AxisPosition.bottom,\n scale,\n tickPadding = 5,\n tickRotation = 0,\n tickSize = 5,\n tickValues,\n tickFormat,\n tickRemodelling,\n variant = AxisVariant.default,\n x = 0,\n y = 0,\n chartWidth,\n chartHeight,\n sectionHeight,\n textColor,\n tickToColor = () => true,\n ...forwardedProps\n } = props;\n const theme = useTheme();\n const axis = getAxisType(position!);\n const { length: gridLength, ...gridStyle } =\n typeof grid === 'object'\n ? { length: axis === 'x' ? sectionHeight ?? chartHeight : chartWidth, ...grid }\n : grid === true\n ? {\n length: axis === 'x' ? sectionHeight ?? chartHeight : chartWidth,\n }\n : { length: 0 };\n\n const axisRef = (ref || useRef<SVGGElement>()) as RefObject<SVGGElement>;\n\n const animatedProps = useSpring({\n ...config,\n to: async (next: (props?: object) => Promise<void>) => {\n await next({\n lineX2: axis === 'x' ? length : 0,\n lineY2: axis === 'x' ? 0 : length,\n });\n },\n from: { lineX2: 0, lineY2: 0 },\n reset: false,\n });\n\n let legendNode = null;\n if (legend !== undefined) {\n let legendX = 0;\n let legendY = 0;\n let legendRotation = 0;\n let textAnchor;\n\n if (axis === 'y') {\n legendRotation = propsLegendRotation ?? 90;\n legendX = propsLegendX ?? legendOffset!;\n if (legendPosition === 'start') {\n textAnchor = 'start';\n legendY = propsLegendY ?? length!;\n } else if (legendPosition === 'middle') {\n textAnchor = 'middle';\n legendY = propsLegendY ?? length! / 2;\n } else if (legendPosition === 'end') {\n textAnchor = 'end';\n legendY = propsLegendY ?? legendY;\n }\n } else {\n legendY = propsLegendY ?? legendOffset!;\n if (legendPosition === 'start') {\n textAnchor = 'start';\n legendX = propsLegendX ?? legendX;\n } else if (legendPosition === 'middle') {\n textAnchor = 'middle';\n legendX = propsLegendX ?? length! / 2;\n } else if (legendPosition === 'end') {\n textAnchor = 'end';\n legendX = propsLegendX ?? length!;\n }\n }\n\n legendNode = (\n <>\n <text\n transform={`translate(${legendX}, ${legendY}) rotate(${legendRotation})`}\n textAnchor={textAnchor}\n style={{\n dominantBaseline: 'central',\n ...legendStyle,\n }}\n >\n {legend}\n </text>\n </>\n );\n }\n\n const { ticks, textAlign, textBaseline } = computeTicks({\n axis,\n scale: scale as AnyScale,\n ticksPosition: [AxisPosition.top, AxisPosition.left].includes(position!) ? 'before' : 'after',\n tickValues,\n tickSize: tickSize!,\n tickPadding: tickPadding!,\n tickRotation: tickRotation!,\n tickRemodelling,\n });\n\n const transition = useTransition<(typeof ticks)[0], { opacity: number; transform: string; textTransform: string }>(\n ticks,\n {\n ...config,\n keys: (tick) => tick.key,\n initial: (tick) => ({\n opacity: 1,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n from: (tick) => ({\n opacity: 0,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n enter: (tick) => ({\n opacity: 1,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n update: (tick) => ({\n opacity: 1,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n leave: {\n opacity: 0,\n },\n }\n );\n\n return (\n <StyledAxis\n aria-hidden=\"true\"\n className={classNames(Axis.className, className)}\n $theme={theme}\n {...forwardedProps}\n transform={`translate(${x},${y})${axis === 'x' ? '' : ',rotate(180)'}`}\n ref={axisRef}\n $color={textColor}\n >\n {gridLength ? (\n <g className={`${Axis.className}__grid`}>\n {ticks.map((tick, i) => (\n <line\n key={`grid-${tick.key}-${i}`}\n className={`${Axis.className}-grid__line`}\n x1={axis === 'x' ? tick.x : 0}\n x2={axis === 'x' ? tick.x : gridLength! * -1}\n y1={axis === 'x' ? 0 : tick.y}\n y2={axis === 'x' ? gridLength! * -1 : tick.y}\n style={{\n strokeDasharray: '4,4',\n opacity: 0.2,\n strokeWidth: 0.5,\n ...gridStyle,\n stroke: 'currentColor',\n }}\n />\n ))}\n </g>\n ) : null}\n\n {variant === AxisVariant.default ||\n variant === AxisVariant.tick ||\n variant === AxisVariant.lineTick ||\n variant === AxisVariant.tickValue\n ? transition((transitionProps, tick, _state, tickIndex) => {\n return (\n <animated.g\n className={`${Axis.className}__tick`}\n key={tickIndex}\n transform={transitionProps.transform}\n style={{ opacity: transitionProps.opacity }}\n >\n <line className={`${Axis.className}-tick__line`} x1={0} x2={tick.lineX} y1={0} y2={tick.lineY} />\n {variant === AxisVariant.default || variant === AxisVariant.tickValue ? (\n <animated.text\n dominantBaseline={textBaseline}\n textAnchor={textAlign}\n transform={transitionProps.textTransform}\n className={!textColor ? '' : tickToColor(tick, tickIndex) ? 'colored' : ''}\n >\n {`${tickFormat ? tickFormat(tick.value as any) : tick.value}`}\n </animated.text>\n ) : null}\n </animated.g>\n );\n })\n : null}\n\n {variant === AxisVariant.default || variant === AxisVariant.line || variant === AxisVariant.lineTick ? (\n <animated.line\n className={`${Axis.className}__line`}\n x1={0}\n x2={config.immediate || disableAnimations ? (axis === 'x' ? length : 0) : animatedProps.lineX2}\n y1={0}\n y2={config.immediate || disableAnimations ? (axis === 'x' ? 0 : length) : animatedProps.lineY2}\n />\n ) : null}\n {legendNode}\n </StyledAxis>\n );\n});\nAxis.className = CLASSNAME;\nAxis.displayName = COMPONENT_NAME;\n"],"names":["AxisVariant","none","line","lineTick","tick","tickValue","default","AxisPosition","top","right","bottom","left","StyledAxis","styled","animated","g","_ref","$theme","css","Theme","dark","_ref2","_ref3","$color","getScaleTicks","scale","spec","Array","isArray","undefined","ticks","isFinite","Math","floor","domain","centerScale","bandwidth","offset","round","d","_scale","computeTicks","axis","ticksPosition","tickValues","tickSize","tickPadding","tickRotation","tickRemodelling","values","position","lineX","lineY","text","textX","textY","isRTL","document","dir","translate","textAlign","textBaseline","_position","x","y","_position2","map","value","_objectSpread","key","Date","valueOf","COMPONENT_NAME","CLASSNAME","getAxisType","includes","Axis","forwardRef","props","ref","className","disableAnimations","grid","length","legend","legendOffset","legendPosition","legendX","propsLegendX","legendY","propsLegendY","legendRotation","propsLegendRotation","legendStyle","tickFormat","variant","chartWidth","chartHeight","sectionHeight","textColor","tickToColor","forwardedProps","_objectWithoutProperties","_excluded","theme","useTheme","gridLength","gridStyle","_excluded2","axisRef","useRef","animatedProps","useSpring","config","to","next","lineX2","lineY2","from","reset","legendNode","textAnchor","React","createElement","Fragment","transform","style","dominantBaseline","transition","useTransition","keys","initial","opacity","textTransform","enter","update","leave","_extends","classNames","i","x1","x2","y1","y2","strokeDasharray","strokeWidth","stroke","transitionProps","_state","tickIndex","immediate","displayName"],"mappings":";;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,WAAW,GAAG;AACzBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,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ts","../../src/components/Axis/computeTicks.ts","../../src/components/Axis/Axis.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { ValueOf, Theme } from '@redsift/design-system';\nimport { AnyScale, NumericValue, ScaleValue, StringValue, TicksSpec } from '../../types';\n\n/**\n * Component variant.\n */\nexport const AxisVariant = {\n none: 'none',\n line: 'line',\n lineTick: 'lineTick',\n tick: 'tick',\n tickValue: 'tickValue',\n default: 'default',\n} as const;\nexport type AxisVariant = ValueOf<typeof AxisVariant>;\n\nexport const AxisPosition = {\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n left: 'left',\n};\nexport type AxisPosition = ValueOf<typeof AxisPosition>;\n\n/**\n * Component props.\n */\nexport interface AxisProps extends Omit<ComponentProps<'g'>, 'scale'> {\n /** Disable animations. */\n disableAnimations?: boolean;\n format?: string;\n /** Whether to display grid or not. The length is mandatory and should usually be the length of the other axis. */\n grid?:\n | boolean\n | {\n length?: number;\n stroke?: string;\n strokeWidth?: number;\n strokeDasharray?: string;\n opacity?: number;\n };\n legend?: string;\n legendOffset?: number;\n legendPosition?: 'start' | 'middle' | 'end';\n legendX?: number;\n legendY?: number;\n legendRotation?: number;\n legendStyle?: React.CSSProperties;\n /** Length of the axis. */\n length?: number;\n /** Position of axis. top|bottom means this is an x axis, right|left means this is an y axis. */\n position?: AxisPosition;\n /** Scale (d3.js) used to generate the axis. */\n scale?: AnyScale;\n tickFormat?:\n | ((d: NumericValue) => string)\n | ((d: StringValue) => string)\n | ((d: Date) => string)\n | ((d: ScaleValue) => string);\n tickPadding?: number;\n tickRotation?: number;\n tickSize?: number;\n tickValues?: TicksSpec;\n tickRemodelling?: (tickValues: any[]) => any[];\n /** Variant. */\n variant?: AxisVariant;\n /** X position. */\n x?: number;\n /** Y position. */\n y?: number;\n /** Chart width, used for horizontal grid. */\n chartWidth?: number;\n /** Chart height, used for horizontal grid. */\n chartHeight?: number;\n /** Section height, used for horizontal grid within a section. */\n sectionHeight?: number;\n /** Color used for tick values. */\n textColor?: string;\n /** Custom method to choose which tick value to color if not all. */\n tickToColor?: (\n tick?: {\n textX: number;\n textY: number;\n lineX: number;\n lineY: number;\n x: number;\n y: number;\n key: string;\n value: ScaleValue;\n },\n index?: number\n ) => boolean;\n}\n\nexport type StyledAxisProps = Omit<AxisProps, 'areXLabelsRotated' | 'size' | 'scale'> & {\n $theme: Theme;\n $color?: string;\n};\n","import styled, { css } from 'styled-components';\nimport { StyledAxisProps } from './types';\nimport { animated } from '@react-spring/web';\nimport { Theme } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledAxis = styled(animated.g)<StyledAxisProps>`\n .redsift-axis__line,\n .redsift-axis-tick__line {\n fill: none;\n ${({ $theme }) => css`\n stroke: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n shape-rendering: crispEdges;\n }\n\n text {\n font-family: var(--redsift-typography-font-family-poppins);\n ${({ $theme }) => css`\n fill: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n font-size: 10px;\n user-select: none;\n }\n\n text.colored {\n ${({ $theme, $color }) => css`\n fill: ${$color === 'green'\n ? '#029B57'\n : $color === 'red'\n ? '#CB0E0E'\n : `var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'})`};\n `}\n }\n`;\n","import { AnyScale, Coordinates, ScaleValue, ScaleWithBandwidth, TicksSpec } from '../../types';\n\nconst getScaleTicks = (scale: AnyScale, spec?: TicksSpec) => {\n // specific values\n if (Array.isArray(spec)) {\n return spec;\n }\n\n // continuous scales\n if ('ticks' in scale) {\n // default behaviour\n if (spec === undefined) {\n return scale.ticks();\n }\n\n // specific tick count\n if (typeof spec === 'number' && isFinite(spec) && Math.floor(spec) === spec) {\n return scale.ticks(spec);\n }\n\n if (typeof spec === 'function') {\n return scale.ticks();\n }\n }\n\n // non linear scale default\n return scale.domain();\n};\n\nexport const centerScale = (scale: ScaleWithBandwidth) => {\n const bandwidth = scale.bandwidth();\n\n if (bandwidth === 0) return scale;\n\n let offset = bandwidth / 2;\n if (scale.round()) {\n offset = Math.round(offset);\n }\n\n return <T extends ScaleValue>(d: T) => (scale(d) ?? 0) + offset;\n};\n\nexport const computeTicks = ({\n axis,\n scale,\n ticksPosition,\n tickValues,\n tickSize,\n tickPadding,\n tickRotation,\n tickRemodelling,\n}: {\n axis: 'x' | 'y';\n scale: AnyScale;\n ticksPosition?: 'after' | 'before';\n tickValues?: TicksSpec;\n tickSize: number;\n tickPadding: number;\n tickRotation: number;\n tickRemodelling?: (tickValues: any[]) => any[];\n}) => {\n const values = tickRemodelling ? tickRemodelling(getScaleTicks(scale, tickValues)) : getScaleTicks(scale, tickValues);\n\n const position = 'bandwidth' in scale ? centerScale(scale) : scale;\n const line = { lineX: 0, lineY: 0 };\n const text = { textX: 0, textY: 0 };\n\n const isRTL = typeof document === 'object' ? document.dir === 'rtl' : false;\n let translate: (value: ScaleValue) => Coordinates;\n let textAlign = 'middle';\n let textBaseline = 'central';\n\n if (axis === 'x') {\n translate = (d) => ({ x: position(d) ?? 0, y: 0 });\n\n line.lineY = tickSize * (ticksPosition === 'after' ? 1 : -1);\n text.textY = (tickSize + tickPadding) * (ticksPosition === 'after' ? 1 : -1);\n\n if (ticksPosition === 'after') {\n textBaseline = 'text-before-edge';\n } else {\n textBaseline = 'alphabetic';\n }\n\n if (tickRotation === 0) {\n textAlign = 'middle';\n } else if ((ticksPosition === 'after' && tickRotation < 0) || (ticksPosition === 'before' && tickRotation > 0)) {\n textAlign = isRTL ? 'start' : 'end';\n textBaseline = 'middle';\n } else if ((ticksPosition === 'after' && tickRotation > 0) || (ticksPosition === 'before' && tickRotation < 0)) {\n textAlign = isRTL ? 'end' : 'start';\n textBaseline = 'middle';\n }\n } else {\n translate = (d) => ({ x: 0, y: position(d) ?? 0 });\n\n line.lineX = tickSize * (ticksPosition === 'after' ? 1 : -1);\n text.textX = (tickSize + tickPadding) * (ticksPosition === 'after' ? 1 : -1);\n\n if (ticksPosition === 'after') {\n textAlign = 'start';\n } else {\n textAlign = 'end';\n }\n }\n\n const ticks = values.map((value: ScaleValue) => ({\n key: value instanceof Date ? `${value.valueOf()}` : `${value}`,\n value,\n ...translate(value),\n ...line,\n ...text,\n }));\n\n return {\n ticks,\n textAlign,\n textBaseline,\n };\n};\n","import React, { forwardRef, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport { Comp, useTheme } from '@redsift/design-system';\n\nimport { AxisProps, AxisPosition, AxisVariant } from './types';\nimport { StyledAxis } from './styles';\nimport { animated, useSpring, useTransition } from '@react-spring/web';\nimport { computeTicks } from './computeTicks';\nimport { config } from '../../config';\nimport { AnyScale } from '@redsift/charts/types';\n\nconst COMPONENT_NAME = 'Axis';\nconst CLASSNAME = 'redsift-axis';\n\nexport const getAxisType = (position: AxisPosition) =>\n [AxisPosition.top, AxisPosition.bottom].includes(position) ? 'x' : 'y';\n\nexport const Axis: Comp<AxisProps, SVGGElement> = forwardRef((props, ref) => {\n const {\n className,\n disableAnimations,\n grid,\n length,\n legend,\n legendOffset = -32,\n legendPosition = 'end',\n legendX: propsLegendX,\n legendY: propsLegendY,\n legendRotation: propsLegendRotation,\n legendStyle,\n position = AxisPosition.bottom,\n scale,\n tickPadding = 5,\n tickRotation = 0,\n tickSize = 5,\n tickValues,\n tickFormat,\n tickRemodelling,\n variant = AxisVariant.default,\n x = 0,\n y = 0,\n chartWidth,\n chartHeight,\n sectionHeight,\n textColor,\n tickToColor = () => true,\n ...forwardedProps\n } = props;\n const theme = useTheme();\n const axis = getAxisType(position!);\n const { length: gridLength, ...gridStyle } =\n typeof grid === 'object'\n ? { length: axis === 'x' ? sectionHeight ?? chartHeight : chartWidth, ...grid }\n : grid === true\n ? {\n length: axis === 'x' ? sectionHeight ?? chartHeight : chartWidth,\n }\n : { length: 0 };\n\n const axisRef = (ref || useRef<SVGGElement>()) as RefObject<SVGGElement>;\n\n const animatedProps = useSpring({\n ...config,\n to: async (next: (props?: object) => Promise<void>) => {\n await next({\n lineX2: axis === 'x' ? length : 0,\n lineY2: axis === 'x' ? 0 : length,\n });\n },\n from: { lineX2: 0, lineY2: 0 },\n reset: false,\n });\n\n let legendNode = null;\n if (legend !== undefined) {\n let legendX = 0;\n let legendY = 0;\n let legendRotation = 0;\n let textAnchor;\n\n if (axis === 'y') {\n legendRotation = propsLegendRotation ?? 90;\n legendX = propsLegendX ?? legendOffset!;\n if (legendPosition === 'start') {\n textAnchor = 'start';\n legendY = propsLegendY ?? length!;\n } else if (legendPosition === 'middle') {\n textAnchor = 'middle';\n legendY = propsLegendY ?? length! / 2;\n } else if (legendPosition === 'end') {\n textAnchor = 'end';\n legendY = propsLegendY ?? legendY;\n }\n } else {\n legendY = propsLegendY ?? legendOffset!;\n if (legendPosition === 'start') {\n textAnchor = 'start';\n legendX = propsLegendX ?? legendX;\n } else if (legendPosition === 'middle') {\n textAnchor = 'middle';\n legendX = propsLegendX ?? length! / 2;\n } else if (legendPosition === 'end') {\n textAnchor = 'end';\n legendX = propsLegendX ?? length!;\n }\n }\n\n legendNode = (\n <>\n <text\n transform={`translate(${legendX}, ${legendY}) rotate(${legendRotation})`}\n textAnchor={textAnchor}\n style={{\n dominantBaseline: 'central',\n ...legendStyle,\n }}\n >\n {legend}\n </text>\n </>\n );\n }\n\n const { ticks, textAlign, textBaseline } = computeTicks({\n axis,\n scale: scale as AnyScale,\n ticksPosition: [AxisPosition.top, AxisPosition.left].includes(position!) ? 'before' : 'after',\n tickValues,\n tickSize: tickSize!,\n tickPadding: tickPadding!,\n tickRotation: tickRotation!,\n tickRemodelling,\n });\n\n const transition = useTransition<(typeof ticks)[0], { opacity: number; transform: string; textTransform: string }>(\n ticks,\n {\n ...config,\n keys: (tick) => tick.key,\n initial: (tick) => ({\n opacity: 1,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n from: (tick) => ({\n opacity: 0,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n enter: (tick) => ({\n opacity: 1,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n update: (tick) => ({\n opacity: 1,\n transform: `translate(${tick.x},${axis === 'x' ? tick.y : (y || 0) - tick.y}),rotate(${\n axis === 'x' ? 0 : 180\n })`,\n textTransform: `translate(${tick.textX},${tick.textY}),rotate(${tickRotation})`,\n }),\n leave: {\n opacity: 0,\n },\n }\n );\n\n return (\n <StyledAxis\n aria-hidden=\"true\"\n className={classNames(Axis.className, className)}\n $theme={theme}\n {...forwardedProps}\n transform={`translate(${x},${y})${axis === 'x' ? '' : ',rotate(180)'}`}\n ref={axisRef}\n $color={textColor}\n >\n {variant === AxisVariant.default ||\n variant === AxisVariant.tick ||\n variant === AxisVariant.lineTick ||\n variant === AxisVariant.tickValue\n ? transition((transitionProps, tick, _state, tickIndex) => {\n return (\n <animated.g\n className={`${Axis.className}__tick`}\n key={tickIndex}\n transform={transitionProps.transform}\n style={{ opacity: transitionProps.opacity }}\n >\n {gridLength ? (\n <line\n className={`${Axis.className}-grid__line`}\n x1={axis === 'x' ? tick.lineX : 0}\n x2={axis === 'x' ? tick.lineX : gridLength! * (position === 'right' ? -1 : 1)}\n y1={axis === 'x' ? 0 : tick.lineY}\n y2={axis === 'x' ? gridLength! * (position === 'bottom' ? -1 : 1) : tick.lineY}\n style={{\n strokeDasharray: '4,4',\n opacity: 0.2,\n strokeWidth: 0.5,\n ...gridStyle,\n stroke: 'currentColor',\n }}\n />\n ) : null}\n <line className={`${Axis.className}-tick__line`} x1={0} x2={tick.lineX} y1={0} y2={tick.lineY} />\n {variant === AxisVariant.default || variant === AxisVariant.tickValue ? (\n <animated.text\n dominantBaseline={textBaseline}\n textAnchor={textAlign}\n transform={transitionProps.textTransform}\n className={!textColor ? '' : tickToColor(tick, tickIndex) ? 'colored' : ''}\n >\n {`${tickFormat ? tickFormat(tick.value as any) : tick.value}`}\n </animated.text>\n ) : null}\n </animated.g>\n );\n })\n : null}\n\n {variant === AxisVariant.default || variant === AxisVariant.line || variant === AxisVariant.lineTick ? (\n <animated.line\n className={`${Axis.className}__line`}\n x1={0}\n x2={config.immediate || disableAnimations ? (axis === 'x' ? length : 0) : animatedProps.lineX2}\n y1={0}\n y2={config.immediate || disableAnimations ? (axis === 'x' ? 0 : length) : animatedProps.lineY2}\n />\n ) : null}\n {legendNode}\n </StyledAxis>\n );\n});\nAxis.className = CLASSNAME;\nAxis.displayName = COMPONENT_NAME;\n"],"names":["AxisVariant","none","line","lineTick","tick","tickValue","default","AxisPosition","top","right","bottom","left","StyledAxis","styled","animated","g","_ref","$theme","css","Theme","dark","_ref2","_ref3","$color","getScaleTicks","scale","spec","Array","isArray","undefined","ticks","isFinite","Math","floor","domain","centerScale","bandwidth","offset","round","d","_scale","computeTicks","axis","ticksPosition","tickValues","tickSize","tickPadding","tickRotation","tickRemodelling","values","position","lineX","lineY","text","textX","textY","isRTL","document","dir","translate","textAlign","textBaseline","_position","x","y","_position2","map","value","_objectSpread","key","Date","valueOf","COMPONENT_NAME","CLASSNAME","getAxisType","includes","Axis","forwardRef","props","ref","className","disableAnimations","grid","length","legend","legendOffset","legendPosition","legendX","propsLegendX","legendY","propsLegendY","legendRotation","propsLegendRotation","legendStyle","tickFormat","variant","chartWidth","chartHeight","sectionHeight","textColor","tickToColor","forwardedProps","_objectWithoutProperties","_excluded","theme","useTheme","gridLength","gridStyle","_excluded2","axisRef","useRef","animatedProps","useSpring","config","to","next","lineX2","lineY2","from","reset","legendNode","textAnchor","React","createElement","Fragment","transform","style","dominantBaseline","transition","useTransition","keys","initial","opacity","textTransform","enter","update","leave","_extends","classNames","transitionProps","_state","tickIndex","x1","x2","y1","y2","strokeDasharray","strokeWidth","stroke","immediate","displayName"],"mappings":";;;;;;;;AAIA;AACA;AACA;AACO,MAAMA,WAAW,GAAG;AACzBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,OAAO,EAAE,SAAA;AACX,EAAU;AAGH,MAAMC,YAAY,GAAG;AAC1BC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,IAAI,EAAE,MAAA;AACR,EAAC;;AAGD;AACA;AACA;;ACtBA;AACA;AACA;AACO,MAAMC,UAAU,GAAGC,MAAM,CAACC,EAAQ,CAACC,CAAC,CAAmB,CAAA;AAC9D;AACA;AACA;AACA,IAAA,EAAMC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,IAAA,CAAA;AAAA,EAAA,OAAKE,GAAI,CAAA;AAC1B,0CAA4CD,EAAAA,MAAM,KAAKE,KAAK,CAACC,IAAI,GAAG,OAAO,GAAG,aAAc,CAAA;AAC5F,IAAK,CAAA,CAAA;AAAA,CAAC,CAAA;AACN;AACA;AACA;AACA;AACA;AACA,IAAA,EAAMC,KAAA,IAAA;EAAA,IAAC;AAAEJ,IAAAA,MAAAA;AAAO,GAAC,GAAAI,KAAA,CAAA;AAAA,EAAA,OAAKH,GAAI,CAAA;AAC1B,wCAA0CD,EAAAA,MAAM,KAAKE,KAAK,CAACC,IAAI,GAAG,OAAO,GAAG,aAAc,CAAA;AAC1F,IAAK,CAAA,CAAA;AAAA,CAAC,CAAA;AACN;AACA;AACA;AACA;AACA;AACA,IAAA,EAAME,KAAA,IAAA;EAAA,IA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|
1
|
-
export { a as BarChart, b as BarChartLegendVariant, B as BaseBarChart, S as StyledBarChart, d as StyledBarChartBars,
|
|
1
|
+
export { a as BarChart, b as BarChartLegendVariant, B as BaseBarChart, S as StyledBarChart, d as StyledBarChartBars, f as StyledBarChartEmptyText, e as StyledBarChartOverlay, c as StyledBarChartSection } from './BarChart2.js';
|
|
2
2
|
//# sourceMappingURL=BarChart.js.map
|
package/_internal/BarChart2.js
CHANGED
|
@@ -50,6 +50,11 @@ const StyledBarChartSection = styled.g`
|
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
52
52
|
const StyledBarChartBars = styled.g``;
|
|
53
|
+
const StyledBarChartOverlay = styled.g`
|
|
54
|
+
.redsift-overlay-bar:hover rect {
|
|
55
|
+
fill: rgba(0, 0, 0, 0.1);
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
53
58
|
const StyledBarChartEmptyText = styled.div`
|
|
54
59
|
position: absolute;
|
|
55
60
|
top: 0;
|
|
@@ -158,7 +163,7 @@ const statsBy = (arr, sortingMethod) => {
|
|
|
158
163
|
})).sort(getSortingMethod(sortingMethod));
|
|
159
164
|
};
|
|
160
165
|
|
|
161
|
-
const _excluded$
|
|
166
|
+
const _excluded$7 = ["className", "emptyComponent", "size", "localeText"];
|
|
162
167
|
const EmptyBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
163
168
|
const {
|
|
164
169
|
className,
|
|
@@ -166,7 +171,7 @@ const EmptyBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
166
171
|
size,
|
|
167
172
|
localeText
|
|
168
173
|
} = props,
|
|
169
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
174
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$7);
|
|
170
175
|
const theme = useTheme();
|
|
171
176
|
const chartDimensions = sizeToDimension(size);
|
|
172
177
|
const width = chartDimensions.width;
|
|
@@ -205,18 +210,19 @@ const EmptyBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
205
210
|
})))));
|
|
206
211
|
});
|
|
207
212
|
|
|
208
|
-
const _excluded$
|
|
213
|
+
const _excluded$6 = ["className"];
|
|
209
214
|
const LoadingBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
210
215
|
const {
|
|
211
216
|
className
|
|
212
217
|
} = props,
|
|
213
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
218
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$6);
|
|
214
219
|
return /*#__PURE__*/React__default.createElement(StyledBarChart, _extends({}, forwardedProps, {
|
|
215
220
|
className: className,
|
|
216
221
|
ref: ref
|
|
217
222
|
}), "Loading...");
|
|
218
223
|
});
|
|
219
224
|
|
|
225
|
+
var total$1 = "Total:";
|
|
220
226
|
var enUS = {
|
|
221
227
|
"interactive-chart": "Interactive Bar Chart",
|
|
222
228
|
"static-chart": "Static Bar Chart",
|
|
@@ -229,9 +235,11 @@ var enUS = {
|
|
|
229
235
|
"y-axis-dates-definition": "The chart has {numAxis, plural, =0 {0 Y axis} =1 {1 Y axis} other {# Y axes}} displaying dates from {start} to {end}.",
|
|
230
236
|
"x-axis-categories-definition": "The chart has {numAxis, plural, =0 {0 X axis} =1 {1 X axis} other {# X axes}} displaying categories.",
|
|
231
237
|
"y-axis-categories-definition": "The chart has {numAxis, plural, =0 {0 Y axis} =1 {1 Y axis} other {# Y axes}} displaying categories.",
|
|
232
|
-
"series-legend": "{category}, category {categoryIndex} of {categoryLength} with {barLength} bars"
|
|
238
|
+
"series-legend": "{category}, category {categoryIndex} of {categoryLength} with {barLength} bars",
|
|
239
|
+
total: total$1
|
|
233
240
|
};
|
|
234
241
|
|
|
242
|
+
var total = "Total:";
|
|
235
243
|
var frFR = {
|
|
236
244
|
"interactive-chart": "Diagrammes à bandes interactif",
|
|
237
245
|
"static-chart": "Diagrammes à bandes statique",
|
|
@@ -244,7 +252,8 @@ var frFR = {
|
|
|
244
252
|
"y-axis-dates-definition": "Le graphique a {numAxis, plural, =0 {0 axe Y} =1 {1 axe Y} other {# axes Y}} affichant des dates allant de {start} à {end}.",
|
|
245
253
|
"x-axis-categories-definition": "Le graphique a {numAxis, plural, =0 {0 axe X} =1 {1 axe X} other {# axes X}} affichant des categories.",
|
|
246
254
|
"y-axis-categories-definition": "Le graphique a {numAxis, plural, =0 {0 axe Y} =1 {1 axe Y} other {# axes Y}} affichant des categories.",
|
|
247
|
-
"series-legend": "{category}, catégorie {categoryIndex} sur {categoryLength} contenant {barLength} bandes"
|
|
255
|
+
"series-legend": "{category}, catégorie {categoryIndex} sur {categoryLength} contenant {barLength} bandes",
|
|
256
|
+
total: total
|
|
248
257
|
};
|
|
249
258
|
|
|
250
259
|
var intlMessages = {
|
|
@@ -263,7 +272,7 @@ function useBarChartContext() {
|
|
|
263
272
|
|
|
264
273
|
const ChartTypeContext = /*#__PURE__*/React__default.createContext(undefined);
|
|
265
274
|
|
|
266
|
-
const _excluded$
|
|
275
|
+
const _excluded$5 = ["areXLabelsRotated", "barProps", "caping", "className", "data", "disableAnimations", "id", "isBarSelected", "getBarAnchorProps", "labelDecorator", "margins", "onBarClick", "orientation", "others", "size", "sortingMethod", "barRole", "colorTheme", "tooltipVariant", "xAxisVariant", "xAxisPlacement", "xAxisTickFormat", "xAxisTickPadding", "xAxisTickRotation", "xAxisTickSize", "xAxisTickValues", "yAxisVariant", "yAxisPlacement", "yAxisTickFormat", "yAxisTickPadding", "yAxisTickRotation", "yAxisTickSize", "yAxisTickValues"];
|
|
267
276
|
const RenderedOrdinalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
268
277
|
const {
|
|
269
278
|
areXLabelsRotated,
|
|
@@ -300,7 +309,7 @@ const RenderedOrdinalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
300
309
|
yAxisTickSize,
|
|
301
310
|
yAxisTickValues
|
|
302
311
|
} = props,
|
|
303
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
312
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$5);
|
|
304
313
|
const cache = useRef();
|
|
305
314
|
const theme = useTheme();
|
|
306
315
|
const format = useMessageFormatter(intlMessages);
|
|
@@ -482,14 +491,14 @@ const RenderedOrdinalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
482
491
|
}))))));
|
|
483
492
|
});
|
|
484
493
|
|
|
485
|
-
const _excluded$
|
|
486
|
-
const COMPONENT_NAME$
|
|
487
|
-
const CLASSNAME$
|
|
494
|
+
const _excluded$4 = ["category"];
|
|
495
|
+
const COMPONENT_NAME$3 = 'BarChartBars';
|
|
496
|
+
const CLASSNAME$3 = 'redsift-barchart-bars';
|
|
488
497
|
const BarChartBars = /*#__PURE__*/forwardRef((props, ref) => {
|
|
489
498
|
const {
|
|
490
499
|
category = 'default'
|
|
491
500
|
} = props,
|
|
492
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
501
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$4);
|
|
493
502
|
const {
|
|
494
503
|
barProps,
|
|
495
504
|
barRole,
|
|
@@ -541,7 +550,7 @@ const BarChartBars = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
541
550
|
const groupedBars = bars.filter(b => {
|
|
542
551
|
return xScaleType === 'Date' || xScaleType === 'dateString' ? b.key.getTime() === bar.key.getTime() : b.key === bar.key;
|
|
543
552
|
});
|
|
544
|
-
return /*#__PURE__*/React__default.createElement(Bar, _extends({
|
|
553
|
+
return [/*#__PURE__*/React__default.createElement(Bar, _extends({
|
|
545
554
|
color: colorScale === null || colorScale === void 0 ? void 0 : colorScale(to.data.category),
|
|
546
555
|
data: to,
|
|
547
556
|
dataset: bars,
|
|
@@ -567,11 +576,11 @@ const BarChartBars = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
567
576
|
width: barProps !== null && barProps !== void 0 && barProps.width && typeof barProps.width === 'number' ? barProps.width : barWidth,
|
|
568
577
|
height: undefined,
|
|
569
578
|
role: barRole
|
|
570
|
-
}));
|
|
579
|
+
}))];
|
|
571
580
|
}));
|
|
572
581
|
});
|
|
573
|
-
BarChartBars.className = CLASSNAME$
|
|
574
|
-
BarChartBars.displayName = COMPONENT_NAME$
|
|
582
|
+
BarChartBars.className = CLASSNAME$3;
|
|
583
|
+
BarChartBars.displayName = COMPONENT_NAME$3;
|
|
575
584
|
const BarChartGroupedTooltip = _ref => {
|
|
576
585
|
let {
|
|
577
586
|
dateFormatter,
|
|
@@ -581,6 +590,9 @@ const BarChartGroupedTooltip = _ref => {
|
|
|
581
590
|
datum,
|
|
582
591
|
groupedData
|
|
583
592
|
} = _ref;
|
|
593
|
+
const {
|
|
594
|
+
format
|
|
595
|
+
} = useBarChartContext();
|
|
584
596
|
return /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
585
597
|
flexDirection: "column",
|
|
586
598
|
margin: "16px",
|
|
@@ -589,9 +601,6 @@ const BarChartGroupedTooltip = _ref => {
|
|
|
589
601
|
flexDirection: "row",
|
|
590
602
|
gap: "8px"
|
|
591
603
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
592
|
-
fontWeight: "400",
|
|
593
|
-
fontSize: "14px"
|
|
594
|
-
}, "Date:"), /*#__PURE__*/React__default.createElement(Text, {
|
|
595
604
|
fontWeight: "700",
|
|
596
605
|
fontSize: "14px"
|
|
597
606
|
}, dateFormatter(datum.data.key))), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -607,7 +616,7 @@ const BarChartGroupedTooltip = _ref => {
|
|
|
607
616
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
608
617
|
fontWeight: "400",
|
|
609
618
|
fontSize: "14px"
|
|
610
|
-
},
|
|
619
|
+
}, format('total')), /*#__PURE__*/React__default.createElement(Text, {
|
|
611
620
|
fontWeight: "600",
|
|
612
621
|
fontSize: "14px"
|
|
613
622
|
}, groupedData === null || groupedData === void 0 ? void 0 : groupedData.reduce((acc, d) => acc + d.value, 0))), /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
@@ -640,11 +649,12 @@ const BarChartGroupedTooltip = _ref => {
|
|
|
640
649
|
})));
|
|
641
650
|
};
|
|
642
651
|
|
|
643
|
-
const _excluded$
|
|
652
|
+
const _excluded$3 = ["barProps", "children", "className", "data", "direction", "disableAnimations", "id", "getBarAnchorProps", "isBarSelected", "labelDecorator", "legendDecorator", "legendVariant", "legendProps", "margins", "onBarClick", "size", "sortingMethod", "barRole", "colorTheme", "tooltipVariant", "tooltipDecorator", "xAxisVariant", "xAxisPlacement", "xAxisTickFormat", "xAxisTickPadding", "xAxisTickRotation", "xAxisTickSize", "xAxisTickValues", "xAxisMinValue", "xAxisMaxValue", "xAxisTickRemodelling", "xAxisStartDateOffset", "xAxisEndDateOffset", "yAxisVariant", "yAxisPlacement", "yAxisTickFormat", "yAxisTickPadding", "yAxisTickRotation", "yAxisTickSize", "yAxisTickValues", "yAxisMinValue", "yAxisMaxValue", "yAxisTickRemodelling", "xScaleType", "yScaleLogBase", "dateParser"],
|
|
644
653
|
_excluded2 = ["extraLegendItems"];
|
|
645
654
|
const COMPONENT_TYPES = {
|
|
646
655
|
AXES: 'Axis',
|
|
647
656
|
SECTIONS: 'BarChartSection',
|
|
657
|
+
OVERLAY: 'BarChartOverlay',
|
|
648
658
|
BARS: 'BarChartBars',
|
|
649
659
|
LEGENDS: 'Legend'
|
|
650
660
|
};
|
|
@@ -654,6 +664,7 @@ const getComponentPosition = child => {
|
|
|
654
664
|
const displayName = (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName;
|
|
655
665
|
if (COMPONENT_TYPES.AXES === displayName) return 'axes';
|
|
656
666
|
if (COMPONENT_TYPES.SECTIONS === displayName) return 'sections';
|
|
667
|
+
if (COMPONENT_TYPES.OVERLAY === displayName) return 'columns';
|
|
657
668
|
if (COMPONENT_TYPES.BARS === displayName) return 'bars';
|
|
658
669
|
if (COMPONENT_TYPES.LEGENDS === displayName) return 'legend';
|
|
659
670
|
return null;
|
|
@@ -722,7 +733,7 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
722
733
|
yScaleLogBase,
|
|
723
734
|
dateParser
|
|
724
735
|
} = props,
|
|
725
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
736
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$3);
|
|
726
737
|
const cache = useRef();
|
|
727
738
|
const theme = useTheme();
|
|
728
739
|
const format = useMessageFormatter(intlMessages);
|
|
@@ -889,6 +900,7 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
889
900
|
const {
|
|
890
901
|
axisComponents,
|
|
891
902
|
sectionComponents,
|
|
903
|
+
overlayComponents,
|
|
892
904
|
barsComponents,
|
|
893
905
|
legendComponents,
|
|
894
906
|
titleComponent,
|
|
@@ -897,6 +909,7 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
897
909
|
} = useMemo(() => {
|
|
898
910
|
const axisComponents = [];
|
|
899
911
|
const sectionComponents = [];
|
|
912
|
+
const overlayComponents = [];
|
|
900
913
|
const barsComponents = [];
|
|
901
914
|
const legendComponents = [];
|
|
902
915
|
let titleComponent;
|
|
@@ -943,6 +956,13 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
943
956
|
variant: isX ? xAxisVariant : yAxisVariant
|
|
944
957
|
}, child.props));
|
|
945
958
|
}
|
|
959
|
+
if (isComponent('BarChartOverlay')(child)) {
|
|
960
|
+
enhancedChild = /*#__PURE__*/React__default.cloneElement(child, _objectSpread2({
|
|
961
|
+
key: child.key || `overlay-${0}-${1}`,
|
|
962
|
+
from: 0,
|
|
963
|
+
to: 1
|
|
964
|
+
}, child.props));
|
|
965
|
+
}
|
|
946
966
|
if (isComponent('Legend')(child)) {
|
|
947
967
|
enhancedChild = /*#__PURE__*/React__default.cloneElement(child, _objectSpread2({
|
|
948
968
|
key: child.key || `legend-${index}`,
|
|
@@ -958,6 +978,9 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
958
978
|
case 'sections':
|
|
959
979
|
sectionComponents.push(enhancedChild);
|
|
960
980
|
break;
|
|
981
|
+
case 'columns':
|
|
982
|
+
overlayComponents.push(enhancedChild);
|
|
983
|
+
break;
|
|
961
984
|
case 'bars':
|
|
962
985
|
barsComponents.push(enhancedChild);
|
|
963
986
|
break;
|
|
@@ -969,6 +992,7 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
969
992
|
return {
|
|
970
993
|
axisComponents,
|
|
971
994
|
sectionComponents,
|
|
995
|
+
overlayComponents,
|
|
972
996
|
barsComponents,
|
|
973
997
|
legendComponents,
|
|
974
998
|
titleComponent,
|
|
@@ -1150,7 +1174,7 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1150
1174
|
}) : null) : /*#__PURE__*/React__default.createElement("g", {
|
|
1151
1175
|
transform: `translate(${margins.left},${margins.top})`,
|
|
1152
1176
|
"aria-hidden": "true"
|
|
1153
|
-
}, axisComponents), sectionComponents, barsComponents.length === 0 && sectionComponents.length === 0 ? /*#__PURE__*/React__default.createElement("g", {
|
|
1177
|
+
}, axisComponents), sectionComponents, overlayComponents, barsComponents.length === 0 && sectionComponents.length === 0 ? /*#__PURE__*/React__default.createElement("g", {
|
|
1154
1178
|
transform: `translate(${margins.left},${margins.top})`,
|
|
1155
1179
|
"aria-hidden": "true"
|
|
1156
1180
|
}, (hasSections ? sections : [categories]).map(section => section.map(category => /*#__PURE__*/React__default.createElement(BarChartBars, {
|
|
@@ -1168,9 +1192,9 @@ const RenderedLinearBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1168
1192
|
}, forwardedLegendProps)) : legendComponents)));
|
|
1169
1193
|
});
|
|
1170
1194
|
|
|
1171
|
-
const _excluded$
|
|
1172
|
-
const COMPONENT_NAME$
|
|
1173
|
-
const CLASSNAME$
|
|
1195
|
+
const _excluded$2 = ["className", "from", "to", "color", "title", "titlePosition", "scaleX", "scaleY", "children", "direction", "regions"];
|
|
1196
|
+
const COMPONENT_NAME$2 = 'BarChartSection';
|
|
1197
|
+
const CLASSNAME$2 = 'redsift-barchart-section';
|
|
1174
1198
|
const BarChartSection = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1175
1199
|
const {
|
|
1176
1200
|
className,
|
|
@@ -1182,9 +1206,10 @@ const BarChartSection = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1182
1206
|
scaleX,
|
|
1183
1207
|
scaleY,
|
|
1184
1208
|
children: propsChildren,
|
|
1185
|
-
direction
|
|
1209
|
+
direction,
|
|
1210
|
+
regions
|
|
1186
1211
|
} = props,
|
|
1187
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
1212
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$2);
|
|
1188
1213
|
const {
|
|
1189
1214
|
textColor,
|
|
1190
1215
|
backgroundColor
|
|
@@ -1242,7 +1267,7 @@ const BarChartSection = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1242
1267
|
if (isComponent('Axis')(child)) {
|
|
1243
1268
|
var _ref;
|
|
1244
1269
|
enhancedChild = /*#__PURE__*/React__default.cloneElement(child, _objectSpread2({
|
|
1245
|
-
key: child.key || `axis-${child.props.position}`,
|
|
1270
|
+
key: child.key || `axis-${from}-${to}-${child.props.position}`,
|
|
1246
1271
|
chartWidth,
|
|
1247
1272
|
chartHeight,
|
|
1248
1273
|
sectionHeight,
|
|
@@ -1262,6 +1287,13 @@ const BarChartSection = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1262
1287
|
tickToColor: (_, index) => index !== 0
|
|
1263
1288
|
}, child.props));
|
|
1264
1289
|
}
|
|
1290
|
+
if (isComponent('BarChartOverlay')(child)) {
|
|
1291
|
+
enhancedChild = /*#__PURE__*/React__default.cloneElement(child, _objectSpread2({
|
|
1292
|
+
key: child.key || `overlay-${from}-${to}`,
|
|
1293
|
+
from,
|
|
1294
|
+
to
|
|
1295
|
+
}, child.props));
|
|
1296
|
+
}
|
|
1265
1297
|
renderedChildren.push(enhancedChild);
|
|
1266
1298
|
});
|
|
1267
1299
|
return renderedChildren;
|
|
@@ -1285,6 +1317,32 @@ const BarChartSection = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1285
1317
|
width: chartWidth,
|
|
1286
1318
|
height: sectionHeight,
|
|
1287
1319
|
fill: backgroundColor
|
|
1320
|
+
}) : null, regions ? regions.map((region, index) => {
|
|
1321
|
+
// Calculate previous and next day in ms
|
|
1322
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
1323
|
+
const fromTime = Date.parse(region.from);
|
|
1324
|
+
const toTime = Date.parse(region.to);
|
|
1325
|
+
const prevTime = fromTime - DAY_MS;
|
|
1326
|
+
const nextTime = toTime + DAY_MS;
|
|
1327
|
+
// Midpoints
|
|
1328
|
+
const midFrom = (fromTime + prevTime) / 2;
|
|
1329
|
+
const midTo = (toTime + nextTime) / 2;
|
|
1330
|
+
const regionFrom = typeof region.from === 'number' ? region.from : scaleX === null || scaleX === void 0 ? void 0 : scaleX(midFrom);
|
|
1331
|
+
const regionTo = typeof region.to === 'number' ? region.to : scaleX === null || scaleX === void 0 ? void 0 : scaleX(midTo);
|
|
1332
|
+
if (regionFrom === undefined || regionTo === undefined) {
|
|
1333
|
+
return null;
|
|
1334
|
+
}
|
|
1335
|
+
const x = Math.min(regionFrom, regionTo);
|
|
1336
|
+
const width = Math.abs(regionTo - regionFrom);
|
|
1337
|
+
return /*#__PURE__*/React__default.createElement("rect", {
|
|
1338
|
+
key: `region-${index}`,
|
|
1339
|
+
x: x,
|
|
1340
|
+
y: 0,
|
|
1341
|
+
width: width,
|
|
1342
|
+
height: sectionHeight,
|
|
1343
|
+
fill: region.color,
|
|
1344
|
+
opacity: region.opacity || 0.05
|
|
1345
|
+
});
|
|
1288
1346
|
}) : null, title && /*#__PURE__*/React__default.createElement("text", {
|
|
1289
1347
|
className: "title colored",
|
|
1290
1348
|
x: titleX,
|
|
@@ -1294,8 +1352,82 @@ const BarChartSection = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
1294
1352
|
dominantBaseline: direction === 'up' ? 'hanging' : direction === 'down' ? 'auto' : 'middle'
|
|
1295
1353
|
}, title), children));
|
|
1296
1354
|
});
|
|
1297
|
-
BarChartSection.className = CLASSNAME$
|
|
1298
|
-
BarChartSection.displayName = COMPONENT_NAME$
|
|
1355
|
+
BarChartSection.className = CLASSNAME$2;
|
|
1356
|
+
BarChartSection.displayName = COMPONENT_NAME$2;
|
|
1357
|
+
|
|
1358
|
+
const _excluded$1 = ["from", "to"];
|
|
1359
|
+
const COMPONENT_NAME$1 = 'BarChartOverlay';
|
|
1360
|
+
const CLASSNAME$1 = 'redsift-barchart-overlay';
|
|
1361
|
+
const BarChartOverlay = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1362
|
+
const {
|
|
1363
|
+
from,
|
|
1364
|
+
to
|
|
1365
|
+
} = props,
|
|
1366
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1);
|
|
1367
|
+
const {
|
|
1368
|
+
barProps,
|
|
1369
|
+
barRole,
|
|
1370
|
+
bars,
|
|
1371
|
+
barWidth,
|
|
1372
|
+
chartHeight,
|
|
1373
|
+
disableAnimations,
|
|
1374
|
+
gap,
|
|
1375
|
+
id,
|
|
1376
|
+
labelDecorator,
|
|
1377
|
+
margins,
|
|
1378
|
+
onBarClick,
|
|
1379
|
+
scaleX,
|
|
1380
|
+
scaleY,
|
|
1381
|
+
tooltipVariant,
|
|
1382
|
+
tooltipDecorator,
|
|
1383
|
+
xScaleType
|
|
1384
|
+
} = useBarChartContext();
|
|
1385
|
+
const filteredBarChartBars = bars.filter(bar => bar.category === bars[0].category && bar.value > 0);
|
|
1386
|
+
const sectionHeight = Math.max(0, Math.min(1, to - from)) * chartHeight;
|
|
1387
|
+
const sectionY = Math.max(0, Math.min(1, from)) * chartHeight;
|
|
1388
|
+
const constantY = scaleLinear().domain(scaleY.domain()).range([sectionHeight, sectionHeight]);
|
|
1389
|
+
return /*#__PURE__*/React__default.createElement(StyledBarChartOverlay, _extends({
|
|
1390
|
+
key: `${id}-series-overlay`,
|
|
1391
|
+
"aria-hidden": "false",
|
|
1392
|
+
role: "region"
|
|
1393
|
+
}, forwardedProps, {
|
|
1394
|
+
ref: ref,
|
|
1395
|
+
transform: from === 0 && to === 1 ? `translate(${margins.left},${(margins.top || 0) + sectionY})` : undefined
|
|
1396
|
+
}), filteredBarChartBars.map((bar, index) => {
|
|
1397
|
+
const groupedBars = bars.filter(b => {
|
|
1398
|
+
return xScaleType === 'Date' || xScaleType === 'dateString' ? b.key.getTime() === bar.key.getTime() : b.key === bar.key;
|
|
1399
|
+
});
|
|
1400
|
+
return /*#__PURE__*/React__default.createElement(Bar, _extends({
|
|
1401
|
+
color: "transparent",
|
|
1402
|
+
data: {
|
|
1403
|
+
data: bar
|
|
1404
|
+
},
|
|
1405
|
+
className: "redsift-overlay-bar",
|
|
1406
|
+
dataset: bars,
|
|
1407
|
+
groupedData: groupedBars,
|
|
1408
|
+
disableAnimations: disableAnimations,
|
|
1409
|
+
gap: gap,
|
|
1410
|
+
id: `id${id}__bar-${index}`,
|
|
1411
|
+
index: index,
|
|
1412
|
+
key: `bar _.${index}`,
|
|
1413
|
+
labelDecorator: labelDecorator,
|
|
1414
|
+
maxHeight: 0,
|
|
1415
|
+
onClick: onBarClick,
|
|
1416
|
+
orientation: BarOrientation.vertical,
|
|
1417
|
+
direction: "down",
|
|
1418
|
+
scale: constantY,
|
|
1419
|
+
scalePosition: scaleX,
|
|
1420
|
+
tooltipVariant: tooltipVariant,
|
|
1421
|
+
tooltipDecorator: tooltipDecorator
|
|
1422
|
+
}, barProps, {
|
|
1423
|
+
width: barProps !== null && barProps !== void 0 && barProps.width && typeof barProps.width === 'number' ? barProps.width : barWidth,
|
|
1424
|
+
height: undefined,
|
|
1425
|
+
role: barRole
|
|
1426
|
+
}));
|
|
1427
|
+
}));
|
|
1428
|
+
});
|
|
1429
|
+
BarChartOverlay.className = CLASSNAME$1;
|
|
1430
|
+
BarChartOverlay.displayName = COMPONENT_NAME$1;
|
|
1299
1431
|
|
|
1300
1432
|
const _excluded = ["barRole", "caping", "chartRef", "className", "colorTheme", "data", "dataType", "emptyComponent", "id", "isBarSelected", "labelDecorator", "legendDecorator", "legendVariant", "localeText", "onBarClick", "orientation", "others", "size", "sortingMethod", "theme", "tooltipDecorator", "tooltipVariant", "xAxisPlacement", "yAxisPlacement"];
|
|
1301
1433
|
const COMPONENT_NAME = 'BarChart';
|
|
@@ -1407,6 +1539,7 @@ BaseBarChart.displayName = COMPONENT_NAME;
|
|
|
1407
1539
|
const BarChart = Object.assign(BaseBarChart, {
|
|
1408
1540
|
Section: BarChartSection,
|
|
1409
1541
|
Bars: BarChartBars,
|
|
1542
|
+
Overlay: BarChartOverlay,
|
|
1410
1543
|
Axis: Axis,
|
|
1411
1544
|
GroupedTooltip: BarChartGroupedTooltip,
|
|
1412
1545
|
Legend: Legend,
|
|
@@ -1415,5 +1548,5 @@ const BarChart = Object.assign(BaseBarChart, {
|
|
|
1415
1548
|
Description: ChartContainerDescription
|
|
1416
1549
|
});
|
|
1417
1550
|
|
|
1418
|
-
export { BaseBarChart as B, StyledBarChart as S, BarChart as a, BarChartLegendVariant as b, StyledBarChartSection as c, StyledBarChartBars as d,
|
|
1551
|
+
export { BaseBarChart as B, StyledBarChart as S, BarChart as a, BarChartLegendVariant as b, StyledBarChartSection as c, StyledBarChartBars as d, StyledBarChartOverlay as e, StyledBarChartEmptyText as f };
|
|
1419
1552
|
//# sourceMappingURL=BarChart2.js.map
|