@artsy/palette-charts 39.2.0 → 39.2.1
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/package.json +7 -8
- package/LICENSE +0 -21
- package/dist/elements/BarChart/Bar.d.ts +0 -24
- package/dist/elements/BarChart/BarChart.d.ts +0 -21
- package/dist/elements/BarChart/BarChart.story.d.ts +0 -6
- package/dist/elements/BarChart/index.d.ts +0 -2
- package/dist/elements/DataVis/ChartHoverTooltip.d.ts +0 -13
- package/dist/elements/DataVis/ChartTooltip.d.ts +0 -23
- package/dist/elements/DataVis/MousePositionContext.d.ts +0 -6
- package/dist/elements/DataVis/useIntersectionObserver.d.ts +0 -16
- package/dist/elements/DataVis/utils/SharedTypes.d.ts +0 -10
- package/dist/elements/DataVis/utils/useWrapperWidth.d.ts +0 -5
- package/dist/elements/DonutChart/DonutChart.d.ts +0 -10
- package/dist/elements/DonutChart/DonutChart.story.d.ts +0 -6
- package/dist/elements/DonutChart/index.d.ts +0 -1
- package/dist/elements/LineChart/Line.d.ts +0 -8
- package/dist/elements/LineChart/LineChart.d.ts +0 -14
- package/dist/elements/LineChart/LineChartSVG.d.ts +0 -15
- package/dist/elements/LineChart/Point.d.ts +0 -11
- package/dist/elements/LineChart/index.d.ts +0 -1
- package/dist/elements/index.d.ts +0 -3
- package/dist/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artsy/palette-charts",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "39.2.
|
|
4
|
+
"version": "39.2.1",
|
|
5
5
|
"description": "Design system library for react components",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"publishConfig": {
|
|
@@ -40,9 +40,12 @@
|
|
|
40
40
|
"colors": "1.4.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
+
"@artsy/palette": "^40",
|
|
44
|
+
"@styled-system/theme-get": "^5",
|
|
43
45
|
"react": "^18",
|
|
44
46
|
"react-dom": "^18",
|
|
45
|
-
"styled-components": "^
|
|
47
|
+
"styled-components": "^6",
|
|
48
|
+
"styled-system": "^5"
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
|
48
51
|
"@artsy/auto-config": "1.2.0",
|
|
@@ -114,12 +117,9 @@
|
|
|
114
117
|
"typescript-styled-plugin": "0.10.0"
|
|
115
118
|
},
|
|
116
119
|
"dependencies": {
|
|
117
|
-
"@artsy/palette": "^40.2.0",
|
|
118
120
|
"@seznam/compose-react-refs": "^1.0.6",
|
|
119
|
-
"@styled-system/theme-get": "^5.1.2",
|
|
120
121
|
"d3-interpolate": "^1.3.2",
|
|
121
|
-
"d3-shape": "^1.3.5"
|
|
122
|
-
"styled-system": "^5.1.5"
|
|
122
|
+
"d3-shape": "^1.3.5"
|
|
123
123
|
},
|
|
124
124
|
"husky": {
|
|
125
125
|
"hooks": {
|
|
@@ -178,6 +178,5 @@
|
|
|
178
178
|
"testEnvironmentOptions": {
|
|
179
179
|
"url": "http://localhost"
|
|
180
180
|
}
|
|
181
|
-
}
|
|
182
|
-
"gitHead": "ac61a49fefdec3156f58534ce36469e5c277f650"
|
|
181
|
+
}
|
|
183
182
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 Artsy Inc. <dev@artsymail.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Bar is the main component responsible for rendering an individual bar
|
|
4
|
-
* in a bar chart.
|
|
5
|
-
*
|
|
6
|
-
* It not publically usable
|
|
7
|
-
*
|
|
8
|
-
* It is responsible for rendering a visible bar of a specific height and 0-2 labels.
|
|
9
|
-
*
|
|
10
|
-
* If a 'highlight' label is given, the bar will measure itself to help it's parent
|
|
11
|
-
* container set an appropriate min-height property. This prevents the highlight
|
|
12
|
-
* label from obscuring content above the bar chart.
|
|
13
|
-
*/
|
|
14
|
-
export declare const Bar: ({ heightPercent, label, highlightLabel, hasEnteredViewport, onMeasureHeight, highlightLabelRef, onClick, onHover, }: {
|
|
15
|
-
heightPercent: number;
|
|
16
|
-
label: React.ReactNode;
|
|
17
|
-
axisLabelX: React.ReactNode;
|
|
18
|
-
highlightLabel?: React.ReactNode;
|
|
19
|
-
hasEnteredViewport: boolean;
|
|
20
|
-
onMeasureHeight?: (height: number) => void;
|
|
21
|
-
highlightLabelRef?: React.RefObject<HTMLDivElement>;
|
|
22
|
-
onClick?: any;
|
|
23
|
-
onHover?: any;
|
|
24
|
-
}) => React.JSX.Element;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ChartTooltipProps } from "../DataVis/ChartTooltip";
|
|
3
|
-
export interface BarDescriptor {
|
|
4
|
-
value: number;
|
|
5
|
-
label?: React.ReactNode | ChartTooltipProps;
|
|
6
|
-
axisLabelX?: React.ReactNode;
|
|
7
|
-
highlightLabel?: React.ReactNode | ChartTooltipProps;
|
|
8
|
-
onClick?: any;
|
|
9
|
-
onHover?: any;
|
|
10
|
-
}
|
|
11
|
-
export interface BarChartProps {
|
|
12
|
-
bars: BarDescriptor[];
|
|
13
|
-
minLabel: React.ReactNode;
|
|
14
|
-
maxLabel: React.ReactNode;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* BarChart is a component which displays some bars of varying heights in a row.
|
|
18
|
-
* Useful for histograms etc.
|
|
19
|
-
* @param props props
|
|
20
|
-
*/
|
|
21
|
-
export declare const BarChart: ({ bars, minLabel, maxLabel }: BarChartProps) => React.JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Tooltip for bar and line charts
|
|
4
|
-
*/
|
|
5
|
-
export declare const ChartHoverTooltip: ({ children }: {
|
|
6
|
-
children: any;
|
|
7
|
-
}) => React.JSX.Element;
|
|
8
|
-
/**
|
|
9
|
-
* Base component for positioning tooltips
|
|
10
|
-
*/
|
|
11
|
-
export declare const BaseTooltipPositioner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@artsy/palette").BoxProps> & import("@artsy/palette").BoxProps, "ref"> & {
|
|
12
|
-
ref?: ((instance: HTMLDivElement) => void) | React.RefObject<HTMLDivElement>;
|
|
13
|
-
}, keyof import("@artsy/palette").BoxProps> & import("@artsy/palette").BoxProps, never>> & string;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { FlexProps } from "@artsy/palette";
|
|
2
|
-
import React from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Returns tooltip component based on the type of tooltip param passed to it
|
|
5
|
-
* @param tooltip either a component or hash containing `title` and `description`
|
|
6
|
-
*/
|
|
7
|
-
export declare const coerceTooltip: (tooltip: React.ReactNode | ChartTooltipProps) => string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
|
|
8
|
-
/**
|
|
9
|
-
* Similart to `coerceTooltip` but without padding
|
|
10
|
-
* @param tooltip
|
|
11
|
-
*/
|
|
12
|
-
export declare const coerceTooltipWithoutPadding: (tooltip: React.ReactNode | ChartTooltipProps) => string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
|
|
13
|
-
export interface ChartTooltipProps extends FlexProps {
|
|
14
|
-
title: React.ReactNode;
|
|
15
|
-
description: React.ReactNode;
|
|
16
|
-
noPadding?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare function isChartTooltipProps(obj: any): obj is ChartTooltipProps;
|
|
19
|
-
/**
|
|
20
|
-
* ChartTooltip is the default content format for a label on a BarChart.
|
|
21
|
-
* @param props
|
|
22
|
-
*/
|
|
23
|
-
export declare const ChartTooltip: ({ title, description, noPadding, ...others }: ChartTooltipProps) => React.JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
interface UseIntersectionObserverProperties {
|
|
3
|
-
ref?: RefObject<Element> | null;
|
|
4
|
-
once?: boolean;
|
|
5
|
-
options?: {
|
|
6
|
-
threshold: number | number[];
|
|
7
|
-
root?: Element;
|
|
8
|
-
rootMargin?: string;
|
|
9
|
-
};
|
|
10
|
-
onIntersection?: (entries: IntersectionObserverEntry[]) => void;
|
|
11
|
-
onOffIntersection?: (entries: IntersectionObserverEntry[]) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const useIntersectionObserver: ({ once, options, onIntersection, onOffIntersection, }: UseIntersectionObserverProperties) => {
|
|
14
|
-
ref: import("react").MutableRefObject<HTMLElement>;
|
|
15
|
-
};
|
|
16
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ChartTooltipProps } from "../ChartTooltip";
|
|
3
|
-
export interface PointDescriptor {
|
|
4
|
-
value: number;
|
|
5
|
-
axisLabelX?: React.ReactNode | ChartTooltipProps;
|
|
6
|
-
tooltip?: React.ReactNode | ChartTooltipProps;
|
|
7
|
-
}
|
|
8
|
-
export interface ChartProps {
|
|
9
|
-
points: PointDescriptor[];
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ChartProps } from "../DataVis/utils/SharedTypes";
|
|
3
|
-
export interface DonutChartProps extends ChartProps {
|
|
4
|
-
margin?: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* DonutChart is a component that displays data points with donut shaped arcs.
|
|
8
|
-
* Good for illustrating numerical proportions.
|
|
9
|
-
*/
|
|
10
|
-
export declare const DonutChart: React.FC<React.PropsWithChildren<DonutChartProps>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DonutChart";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ChartProps } from "../DataVis/utils/SharedTypes";
|
|
3
|
-
export interface LineChartProps extends ChartProps {
|
|
4
|
-
height?: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* LineChart is a component that displays some data points connected by lines.
|
|
8
|
-
* Useful for visualizing a time series, etc.
|
|
9
|
-
*/
|
|
10
|
-
export declare const LineChart: React.FC<React.PropsWithChildren<LineChartProps>>;
|
|
11
|
-
/**
|
|
12
|
-
* The rectangle area around Dots which triggers mouseover for tooltip
|
|
13
|
-
*/
|
|
14
|
-
export declare const PointHoverArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PointDescriptor } from "../DataVis/utils/SharedTypes";
|
|
3
|
-
interface LineChartSVGProps {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
margin: number;
|
|
7
|
-
points: PointDescriptor[];
|
|
8
|
-
hoverIndex: number;
|
|
9
|
-
hasEnteredViewport?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Component rendering the SVG part of the line chart (e.g line and points)
|
|
13
|
-
*/
|
|
14
|
-
export declare const LineChartSVG: React.FC<React.PropsWithChildren<LineChartSVGProps>>;
|
|
15
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Point is the component responsible for rendering a data point
|
|
4
|
-
* in a line chart.
|
|
5
|
-
*/
|
|
6
|
-
export declare const Point: ({ cx, cy, opacity, hovered, }: {
|
|
7
|
-
cx: number;
|
|
8
|
-
cy: number;
|
|
9
|
-
opacity: number;
|
|
10
|
-
hovered: boolean;
|
|
11
|
-
}) => React.JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./LineChart";
|
package/dist/elements/index.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./elements";
|