@toptal/picasso-charts
Advanced tools
Comparing version 0.5.2-alpha-feat-top-669-adjust-subheader.1836 to 0.5.2-alpha-fix-yarn.1863
@@ -7,3 +7,3 @@ import { ReactElement, ReactNode } from 'react'; | ||
}; | ||
export declare type ChartDataPoint = Record<string, string | number>; | ||
export declare type ChartDataPoint = Record<string, string | number | boolean>; | ||
export declare type TooltipInstance = Tooltip & { | ||
@@ -10,0 +10,0 @@ wrapperNode: HTMLDivElement; |
import React, { useRef } from 'react'; | ||
import { palette } from '@toptal/picasso/utils'; | ||
import { ComposedChart, XAxis, YAxis, CartesianGrid, ReferenceArea, ReferenceLine, Area, Line, ResponsiveContainer, Tooltip } from 'recharts'; | ||
import { ChartDot } from './ChartDot'; | ||
import calculateTooltipPosition from '../utils/calculate-tooltip-position'; | ||
@@ -44,3 +45,3 @@ import { findTopDomain, getChartTicks, toRechartsHighlightFormat, orderData } from '../utils'; | ||
const isReferenceLine = line.variant === 'reference'; | ||
return (React.createElement(Line, { key: `line-${index}`, data: orderedData, dataKey: name, stroke: line.color, dot: isReferenceLine ? false : { fill: line.color }, isAnimationActive: IS_ANIMATION_ACTIVE, strokeDasharray: isReferenceLine ? '3 3' : 'none' })); | ||
return (React.createElement(Line, { key: `line-${index}`, data: orderedData, dataKey: name, stroke: line.color, dot: isReferenceLine ? false : React.createElement(ChartDot, { color: line.color }), isAnimationActive: IS_ANIMATION_ACTIVE, strokeDasharray: isReferenceLine ? '3 3' : 'none' })); | ||
}); | ||
@@ -47,0 +48,0 @@ const positionOverride = { x: 0, y: 0 }; |
{ | ||
"name": "@toptal/picasso-charts", | ||
"version": "0.5.2-alpha-feat-top-669-adjust-subheader.1836+d2c556ab", | ||
"version": "0.5.2-alpha-fix-yarn.1863+4e5bd138", | ||
"description": "Charts components of Picasso", | ||
@@ -27,6 +27,6 @@ "author": "Toptal", | ||
"dependencies": { | ||
"@types/recharts": "^1.8.7", | ||
"@types/recharts": "^1.8.15", | ||
"recharts": "^2.0.0-beta.2" | ||
}, | ||
"gitHead": "d2c556abc68607bbfd943d798fd6cd412f612568" | ||
"gitHead": "4e5bd1389584a3387c9fac2a470c3ac0baab0a63" | ||
} |
@@ -6,3 +6,3 @@ declare const chartConstants: { | ||
HIGHLIGHT_TOP_FILL_OPACITY: number; | ||
HIGHLIGHT_TOP_HEIGHT: number; | ||
HIGHLIGHT_TOP_HEIGHT_RATIO: number; | ||
TOP_DOMAIN_OFFSET: number; | ||
@@ -9,0 +9,0 @@ TICK_MARGIN: number; |
@@ -6,3 +6,3 @@ const chartConstants = { | ||
HIGHLIGHT_TOP_FILL_OPACITY: 0.1, | ||
HIGHLIGHT_TOP_HEIGHT: 0.1, | ||
HIGHLIGHT_TOP_HEIGHT_RATIO: 0.02, | ||
TOP_DOMAIN_OFFSET: 1, | ||
@@ -9,0 +9,0 @@ TICK_MARGIN: 16, |
@@ -26,3 +26,3 @@ import toRechartsHighlightFormat from './'; | ||
x2: 7.5, | ||
y1: 1.9, | ||
y1: 1.96, | ||
y2: 2 | ||
@@ -29,0 +29,0 @@ } |
import CHART_CONSTANTS from '../constants'; | ||
const { HIGHLIGHT_BOTTOM_START_POINT, HIGHLIGHT_BOTTOM_FILL_OPACITY, HIGHLIGHT_TOP_HEIGHT, HIGHLIGHT_TOP_FILL_OPACITY } = CHART_CONSTANTS; | ||
const { HIGHLIGHT_BOTTOM_START_POINT, HIGHLIGHT_BOTTOM_FILL_OPACITY, HIGHLIGHT_TOP_HEIGHT_RATIO, HIGHLIGHT_TOP_FILL_OPACITY } = CHART_CONSTANTS; | ||
const OFFSET = 0.5; | ||
@@ -21,3 +21,3 @@ const toRechartsHighlightFormat = (topDomain, dataPointCount, data) => data.map(({ from, to, color }) => { | ||
x2, | ||
y1: topDomain - HIGHLIGHT_TOP_HEIGHT, | ||
y1: topDomain - topDomain * HIGHLIGHT_TOP_HEIGHT_RATIO, | ||
y2: topDomain, | ||
@@ -24,0 +24,0 @@ fillOpacity: HIGHLIGHT_TOP_FILL_OPACITY, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
42932
68
553
1046
167
Updated@types/recharts@^1.8.15