@patternfly/react-docs 7.6.0-prerelease.7 → 7.6.0-prerelease.8
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 +12 -13
- package/patternfly-docs/generated/components/about-modal/react.js +149 -0
- package/patternfly-docs/generated/components/accordion/react.js +262 -0
- package/patternfly-docs/generated/components/action-list/react.js +144 -0
- package/patternfly-docs/generated/components/alert/react-demos.js +56 -0
- package/patternfly-docs/generated/components/alert/react.js +1433 -0
- package/patternfly-docs/generated/components/avatar/react.js +166 -0
- package/patternfly-docs/generated/components/back-to-top/react-demos.js +60 -0
- package/patternfly-docs/generated/components/back-to-top/react.js +77 -0
- package/patternfly-docs/generated/components/backdrop/react.js +64 -0
- package/patternfly-docs/generated/components/background-image/react.js +62 -0
- package/patternfly-docs/generated/components/badge/react.js +97 -0
- package/patternfly-docs/generated/components/banner/react-demos.js +57 -0
- package/patternfly-docs/generated/components/banner/react.js +148 -0
- package/patternfly-docs/generated/components/brand/react.js +142 -0
- package/patternfly-docs/generated/components/breadcrumb/react.js +206 -0
- package/patternfly-docs/generated/components/button/react-demos.js +57 -0
- package/patternfly-docs/generated/components/button/react.js +826 -0
- package/patternfly-docs/generated/components/card/react-demos.js +201 -0
- package/patternfly-docs/generated/components/card/react.js +1015 -0
- package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +1350 -0
- package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +1334 -0
- package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +1282 -0
- package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +848 -0
- package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +192 -0
- package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +426 -0
- package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +804 -0
- package/patternfly-docs/generated/components/charts/legends/-Victory.js +3230 -0
- package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +1178 -0
- package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +525 -0
- package/patternfly-docs/generated/components/charts/patterns/-Victory.js +3382 -0
- package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +377 -0
- package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +2475 -0
- package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +538 -0
- package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +1551 -0
- package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +4115 -0
- package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +955 -0
- package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +1173 -0
- package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +1166 -0
- package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +413 -0
- package/patternfly-docs/generated/components/chip/react-deprecated.js +323 -0
- package/patternfly-docs/generated/components/clipboard-copy/react.js +373 -0
- package/patternfly-docs/generated/components/code-block/react.js +148 -0
- package/patternfly-docs/generated/components/code-editor/react.js +659 -0
- package/patternfly-docs/generated/components/compass/react-demos.js +147 -0
- package/patternfly-docs/generated/components/compass/react.js +440 -0
- package/patternfly-docs/generated/components/content/react.js +248 -0
- package/patternfly-docs/generated/components/data-list/react-demos.js +90 -0
- package/patternfly-docs/generated/components/data-list/react.js +709 -0
- package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +283 -0
- package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +64 -0
- package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +83 -0
- package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +395 -0
- package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +241 -0
- package/patternfly-docs/generated/components/description-list/react-demos.js +58 -0
- package/patternfly-docs/generated/components/description-list/react.js +743 -0
- package/patternfly-docs/generated/components/divider/react.js +126 -0
- package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +351 -0
- package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +184 -0
- package/patternfly-docs/generated/components/drag-and-drop/react.js +137 -0
- package/patternfly-docs/generated/components/drawer/react.js +598 -0
- package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +772 -0
- package/patternfly-docs/generated/components/dual-list-selector/react.js +594 -0
- package/patternfly-docs/generated/components/empty-state/react.js +199 -0
- package/patternfly-docs/generated/components/expandable-section/react-demos.js +65 -0
- package/patternfly-docs/generated/components/expandable-section/react.js +408 -0
- package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +52 -0
- package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +398 -0
- package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +749 -0
- package/patternfly-docs/generated/components/forms/checkbox/react.js +222 -0
- package/patternfly-docs/generated/components/forms/form/react.js +1106 -0
- package/patternfly-docs/generated/components/forms/form-select/react.js +208 -0
- package/patternfly-docs/generated/components/forms/radio/react.js +212 -0
- package/patternfly-docs/generated/components/forms/text-area/react.js +160 -0
- package/patternfly-docs/generated/components/forms/text-input/react.js +216 -0
- package/patternfly-docs/generated/components/helper-text/react-demos.js +180 -0
- package/patternfly-docs/generated/components/helper-text/react.js +164 -0
- package/patternfly-docs/generated/components/hero/react.js +88 -0
- package/patternfly-docs/generated/components/hint/react.js +169 -0
- package/patternfly-docs/generated/components/icon/react.js +215 -0
- package/patternfly-docs/generated/components/input-group/react.js +182 -0
- package/patternfly-docs/generated/components/jump-links/react-demos.js +154 -0
- package/patternfly-docs/generated/components/jump-links/react.js +212 -0
- package/patternfly-docs/generated/components/label/react-demos.js +57 -0
- package/patternfly-docs/generated/components/label/react.js +417 -0
- package/patternfly-docs/generated/components/list/react.js +175 -0
- package/patternfly-docs/generated/components/login-page/react.js +587 -0
- package/patternfly-docs/generated/components/masthead/react-demos.js +79 -0
- package/patternfly-docs/generated/components/masthead/react.js +291 -0
- package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +769 -0
- package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +665 -0
- package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +187 -0
- package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +163 -0
- package/patternfly-docs/generated/components/menus/dropdown/react.js +998 -0
- package/patternfly-docs/generated/components/menus/menu/react.js +1540 -0
- package/patternfly-docs/generated/components/menus/menu-toggle/react.js +747 -0
- package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +508 -0
- package/patternfly-docs/generated/components/menus/select/react-templates.js +257 -0
- package/patternfly-docs/generated/components/menus/select/react.js +998 -0
- package/patternfly-docs/generated/components/modal/react-deprecated.js +554 -0
- package/patternfly-docs/generated/components/modal/react.js +597 -0
- package/patternfly-docs/generated/components/navigation/react-demos.js +356 -0
- package/patternfly-docs/generated/components/navigation/react.js +409 -0
- package/patternfly-docs/generated/components/notification-badge/react.js +196 -0
- package/patternfly-docs/generated/components/notification-drawer/react-demos.js +107 -0
- package/patternfly-docs/generated/components/notification-drawer/react.js +394 -0
- package/patternfly-docs/generated/components/number-input/react.js +210 -0
- package/patternfly-docs/generated/components/overflow-menu/react.js +274 -0
- package/patternfly-docs/generated/components/page/react-demos.js +149 -0
- package/patternfly-docs/generated/components/page/react.js +1352 -0
- package/patternfly-docs/generated/components/pagination/react.js +492 -0
- package/patternfly-docs/generated/components/panel/react.js +236 -0
- package/patternfly-docs/generated/components/popover/react.js +390 -0
- package/patternfly-docs/generated/components/progress/react-demos.js +59 -0
- package/patternfly-docs/generated/components/progress/react.js +283 -0
- package/patternfly-docs/generated/components/progress-stepper/react-demos.js +45 -0
- package/patternfly-docs/generated/components/progress-stepper/react.js +219 -0
- package/patternfly-docs/generated/components/search-input/react-demos.js +113 -0
- package/patternfly-docs/generated/components/search-input/react.js +263 -0
- package/patternfly-docs/generated/components/sidebar/react.js +236 -0
- package/patternfly-docs/generated/components/simple-list/react.js +200 -0
- package/patternfly-docs/generated/components/skeleton/react-demos.js +44 -0
- package/patternfly-docs/generated/components/skeleton/react.js +122 -0
- package/patternfly-docs/generated/components/skip-to-content/react.js +73 -0
- package/patternfly-docs/generated/components/slider/react.js +309 -0
- package/patternfly-docs/generated/components/spinner/react.js +111 -0
- package/patternfly-docs/generated/components/switch/react.js +163 -0
- package/patternfly-docs/generated/components/table/react-demos.js +355 -0
- package/patternfly-docs/generated/components/table/react-deprecated.js +1350 -0
- package/patternfly-docs/generated/components/table/react.js +3241 -0
- package/patternfly-docs/generated/components/tabs/react-demos.js +108 -0
- package/patternfly-docs/generated/components/tabs/react.js +1359 -0
- package/patternfly-docs/generated/components/text-input-group/react-demos.js +152 -0
- package/patternfly-docs/generated/components/text-input-group/react.js +278 -0
- package/patternfly-docs/generated/components/tile/react-deprecated.js +242 -0
- package/patternfly-docs/generated/components/timestamp/react.js +283 -0
- package/patternfly-docs/generated/components/title/react.js +94 -0
- package/patternfly-docs/generated/components/toggle-group/react.js +299 -0
- package/patternfly-docs/generated/components/toolbar/react-demos.js +66 -0
- package/patternfly-docs/generated/components/toolbar/react.js +932 -0
- package/patternfly-docs/generated/components/tooltip/react.js +241 -0
- package/patternfly-docs/generated/components/tree-view/react.js +429 -0
- package/patternfly-docs/generated/components/truncate/react.js +211 -0
- package/patternfly-docs/generated/components/wizard/react-demos.js +87 -0
- package/patternfly-docs/generated/components/wizard/react-deprecated.js +788 -0
- package/patternfly-docs/generated/components/wizard/react.js +986 -0
- package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +285 -0
- package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +70 -0
- package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +506 -0
- package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +94 -0
- package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +272 -0
- package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +87 -0
- package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +124 -0
- package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +112 -0
- package/patternfly-docs/generated/index.js +1769 -0
- package/patternfly-docs/generated/patterns/card-view/react-demos.js +78 -0
- package/patternfly-docs/generated/patterns/filters/react-demos.js +141 -0
- package/patternfly-docs/generated/patterns/password-generator/react-demos.js +51 -0
- package/patternfly-docs/generated/patterns/password-strength/react-demos.js +61 -0
- package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +124 -0
- package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +81 -0
- package/LICENSE +0 -21
|
@@ -0,0 +1,1282 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
|
|
3
|
+
import { Chart, ChartAxis, ChartBoxPlot, ChartCursorFlyout, ChartCursorTooltip, ChartLegendTooltip, ChartThemeColor, ChartThreshold, ChartVoronoiContainer, createContainer } from '@patternfly/react-charts/victory';
|
|
4
|
+
import { VictoryZoomContainer } from 'victory-zoom-container';
|
|
5
|
+
import chart_color_orange_300 from '@patternfly/react-tokens/dist/esm/chart_color_orange_300';
|
|
6
|
+
const pageData = {
|
|
7
|
+
"id": "Box plot chart",
|
|
8
|
+
"section": "components",
|
|
9
|
+
"subsection": "charts",
|
|
10
|
+
"deprecated": false,
|
|
11
|
+
"template": false,
|
|
12
|
+
"beta": false,
|
|
13
|
+
"demo": false,
|
|
14
|
+
"newImplementationLink": false,
|
|
15
|
+
"source": "-Victory",
|
|
16
|
+
"tabName": null,
|
|
17
|
+
"slug": "/components/charts/box-plot-chart/-Victory",
|
|
18
|
+
"sourceLink": "https://github.com/patternfly/patternfly-org/blob/main/packages/react-charts/src/victory/components/ChartBoxPlot/examples/ChartBoxPlot.md",
|
|
19
|
+
"relPath": "packages/react-charts/src/victory/components/ChartBoxPlot/examples/ChartBoxPlot.md",
|
|
20
|
+
"propComponents": [
|
|
21
|
+
{
|
|
22
|
+
"name": "Chart",
|
|
23
|
+
"description": "Chart is a wrapper component that reconciles the domain for all its children, controls the layout of the chart,\nand coordinates animations and shared events.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-chart/src/victory-chart.tsx",
|
|
24
|
+
"props": [
|
|
25
|
+
{
|
|
26
|
+
"name": "animate",
|
|
27
|
+
"type": "boolean | object",
|
|
28
|
+
"description": "The animate prop specifies props for VictoryAnimation to use.\nThe animate prop should also be used to specify enter and exit\ntransition configurations with the `onExit` and `onEnter` namespaces respectively.\n\n\n@example {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})}"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "ariaDesc",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ariaDesc prop specifies the description of the chart/SVG to assist with\naccessibility for screen readers.\n\nNote: Overridden by the desc prop of containerComponent"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "ariaTitle",
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The ariaTitle prop specifies the title to be applied to the SVG to assist\naccessibility for screen readers.\n\nNote: Overridden by the title prop of containerComponent"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "backgroundComponent",
|
|
42
|
+
"type": "React.ReactElement<any>",
|
|
43
|
+
"description": "The backgroundComponent prop takes a component instance which will be responsible for rendering a background if the\nChart's style component includes background styles. The new element created from the passed backgroundComponent\nwill be provided with the following properties calculated by Chart: height, polar, scale, style, x, y, width.\nAll of these props on Background should take precedence over what VictoryChart is trying to set."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "children",
|
|
47
|
+
"type": "React.ReactNode | React.ReactNode[]",
|
|
48
|
+
"description": "The children to render with the chart"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "containerComponent",
|
|
52
|
+
"type": "React.ReactElement<any>",
|
|
53
|
+
"description": "The containerComponent prop takes an entire component which will be used to\ncreate a container element for standalone charts.\nThe new element created from the passed containerComponent wil be provided with\nthese props from ChartArea: height, width, children\n(the chart itself) and style. Props that are not provided by the\nchild chart component include title and desc, both of which\nare intended to add accessibility to Victory components. The more descriptive these props\nare, the more accessible your data will be for people using screen readers.\nAny of these props may be overridden by passing in props to the supplied component,\nor modified or ignored within the custom component itself. If a dataComponent is\nnot provided, ChartArea will use the default ChartContainer component.\n\n@example <ChartContainer title=\"Chart of Dog Breeds\" desc=\"This chart shows ...\" />",
|
|
54
|
+
"defaultValue": "<ChartContainer />"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "domain",
|
|
58
|
+
"type": "number[] | { x: number[], y: number[] }",
|
|
59
|
+
"description": "The domain prop describes the range of values your chart will include. This prop can be\ngiven as a array of the minimum and maximum expected values for your chart,\nor as an object that specifies separate arrays for x and y.\nIf this prop is not provided, a domain will be calculated from data, or other\navailable information.\n\n\n@example [low, high], { x: [low, high], y: [low, high] }\n\n[-1, 1], {x: [0, 100], y: [0, 1]}"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "domainPadding",
|
|
63
|
+
"type": "number | number[] | { x: number[], y: number[] }",
|
|
64
|
+
"description": "The domainPadding prop specifies a number of pixels of padding to add to the\nbeginning and end of a domain. This prop is useful for explicitly spacing ticks farther\nfrom the origin to prevent crowding. This prop should be given as an object with\nnumbers specified for x and y.\n\n\n@example [left, right], { x: [left, right], y: [bottom, top] }\n\n{x: [10, -10], y: 5}"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "endAngle",
|
|
68
|
+
"type": "number",
|
|
69
|
+
"description": "The endAngle props defines the overall end angle of a polar chart in degrees. This prop is used in conjunction with\nstartAngle to create polar chart that spans only a segment of a circle, or to change overall rotation of the chart.\nThis prop should be given as a number of degrees. Degrees are defined as starting at the 3 o'clock position, and\nproceeding counterclockwise."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "eventKey",
|
|
73
|
+
"type": "number | string | Function",
|
|
74
|
+
"description": "Similar to data accessor props `x` and `y`, this prop may be used to functionally\nassign eventKeys to data"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "events",
|
|
78
|
+
"type": "object[]",
|
|
79
|
+
"description": "The event prop takes an array of event objects. Event objects are composed of\na target, an eventKey, and eventHandlers. Targets may be any valid style namespace\nfor a given component, so \"data\" and \"labels\" are all valid targets for ChartPie\nevents. The eventKey may optionally be used to select a single element by index rather than\nan entire set. The eventHandlers object should be given as an object whose keys are standard\nevent names (i.e. onClick) and whose values are event callbacks. The return value\nof an event handler is used to modify elements. The return value should be given\nas an object or an array of objects with optional target and eventKey keys,\nand a mutation key whose value is a function. The target and eventKey keys\nwill default to those corresponding to the element the event handler was attached to.\nThe mutation function will be called with the calculated props for the individual selected\nelement (i.e. a single bar), and the object returned from the mutation function\nwill override the props of the selected element via object assignment.\n\n\n@example\nevents={[\n {\n target: \"data\",\n eventKey: 1,\n eventHandlers: {\n onClick: () => {\n return [\n {\n eventKey: 2,\n mutation: (props) => {\n return {style: merge({}, props.style, {fill: \"orange\"})};\n }\n }, {\n eventKey: 2,\n target: \"labels\",\n mutation: () => {\n return {text: \"hey\"};\n }\n }\n ];\n }\n }\n }\n]}"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "externalEventMutations",
|
|
83
|
+
"type": "object[]",
|
|
84
|
+
"description": "Chart uses the standard externalEventMutations prop."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "groupComponent",
|
|
88
|
+
"type": "React.ReactElement<any>",
|
|
89
|
+
"description": "The groupComponent prop takes an entire component which will be used to\ncreate group elements for use within container elements. This prop defaults\nto a <g> tag on web, and a react-native-svg <G> tag on mobile"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "hasPatterns",
|
|
93
|
+
"type": "boolean | boolean[]",
|
|
94
|
+
"description": "The hasPatterns prop is an optional prop that indicates whether a pattern is shown for a chart.\nSVG patterns are dynamically generated (unique to each chart) in order to apply colors from the selected\ncolor theme or custom color scale. Those generated patterns are applied in a specific order (via a URL), similar\nto the color theme ordering defined by PatternFly. If the multi-color theme was in use; for example, colorized\npatterns would be displayed in that same order. Create custom patterns via the patternScale prop.\n\nNote: Not all components are supported; for example, ChartLine, ChartBullet, ChartThreshold, etc.\n\n@example hasPatterns={ true }\n@example hasPatterns={[ true, true, false ]}"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "height",
|
|
98
|
+
"type": "number",
|
|
99
|
+
"description": "Specifies the height the svg viewBox of the chart container. This value should be given as a\nnumber of pixels.\n\nBecause Victory renders responsive containers, the width and height props do not determine the width and\nheight of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of\npixels will depend on the size of the container the chart is rendered into. Typically, the parent container is set\nto the same width in order to maintain the aspect ratio.",
|
|
100
|
+
"defaultValue": "theme.chart.height"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "horizontal",
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"description": "The horizontal prop determines whether data will be plotted horizontally. When this prop is set to true, the\nindependent variable will be plotted on the y axis and the dependent variable will be plotted on the x axis."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "innerRadius",
|
|
109
|
+
"type": "number | Function",
|
|
110
|
+
"description": "When the innerRadius prop is set, polar charts will be hollow rather than circular."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "legendAllowWrap",
|
|
114
|
+
"type": "boolean | ((extraHeight: number) => void)",
|
|
115
|
+
"description": "Allows legend items to wrap onto the next line if the chart is not wide enough.\n\nNote that the chart's SVG height and width are 100% by default, so it can be responsive itself. However, if you\ndefine the height and width of the chart's parent container, you must accommodate for extra legend height due to\nlegend items wrapping onto the next line. When the height of the chart's parent container is too small, some legend\nitems may not be visible.\n\nAlternatively, a callback function may be provided, which will be called after the legend's itemsPerRow property\nhas been calculated. The value provided can be used to increase the chart's parent container height as legend\nitems wrap onto the next line. If no adjustment is necessary, the value will be zero.\n\nNote: This is overridden by the legendItemsPerRow property"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "legendComponent",
|
|
119
|
+
"type": "React.ReactElement<any>",
|
|
120
|
+
"description": "The legend component to render with chart.\n\nNote: Use legendData so the legend width can be calculated and positioned properly.\nDefault legend properties may be applied",
|
|
121
|
+
"defaultValue": "<ChartLegend />"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "legendData",
|
|
125
|
+
"type": "{\n name?: string;\n symbol?: {\n fill?: string;\n type?: string;\n };\n}[]",
|
|
126
|
+
"description": "Specify data via the data prop. ChartLegend expects data as an\narray of objects with name (required), symbol, and labels properties.\nThe data prop must be given as an array.\n\n@example legendData={[{ name: `GBps capacity - 45%` }, { name: 'Unused' }]}"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "legendDirection",
|
|
130
|
+
"type": "'ltr' | 'rtl'",
|
|
131
|
+
"description": "Text direction of the legend labels.",
|
|
132
|
+
"defaultValue": "'ltr'"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "legendOrientation",
|
|
136
|
+
"type": "'horizontal' | 'vertical'",
|
|
137
|
+
"description": "The orientation prop takes a string that defines whether legend data\nare displayed in a row or column. When orientation is \"horizontal\",\nlegend items will be displayed in a single row. When orientation is\n\"vertical\", legend items will be displayed in a single column. Line\nand text-wrapping is not currently supported, so \"vertical\"\norientation is both the default setting and recommended for\ndisplaying many series of data.",
|
|
138
|
+
"defaultValue": "theme.legend.orientation"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "legendPosition",
|
|
142
|
+
"type": "'bottom' | 'bottom-left' | 'right'",
|
|
143
|
+
"description": "The legend position relation to the chart. Valid values are 'bottom', 'bottom-left', and 'right'\n\nNote: When adding a legend, padding may need to be adjusted in order to accommodate the extra legend. In some\ncases, the legend may not be visible until enough padding is applied.",
|
|
144
|
+
"defaultValue": "\"right\""
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "maxDomain",
|
|
148
|
+
"type": "number | { x?: number; y?: number }",
|
|
149
|
+
"description": "The maxDomain prop defines a maximum domain value for a chart. This prop is useful in situations where the maximum\ndomain of a chart is static, while the minimum value depends on data or other variable information. If the domain\nprop is set in addition to maximumDomain, domain will be used.\n\nNote: The x value supplied to the maxDomain prop refers to the independent variable, and the y value refers to the\ndependent variable. This may cause confusion in horizontal charts, as the independent variable will corresponds to\nthe y axis.\n\n@example\n\nmaxDomain={0}\nmaxDomain={{ y: 0 }}"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "minDomain",
|
|
153
|
+
"type": "number | { x?: number; y?: number }",
|
|
154
|
+
"description": "The minDomain prop defines a minimum domain value for a chart. This prop is useful in situations where the minimum\ndomain of a chart is static, while the maximum value depends on data or other variable information. If the domain\nprop is set in addition to minimumDomain, domain will be used.\n\nNote: The x value supplied to the minDomain prop refers to the independent variable, and the y value refers to the\ndependent variable. This may cause confusion in horizontal charts, as the independent variable will corresponds to\nthe y axis.\n\n@example\n\nminDomain={0}\nminDomain={{ y: 0 }}"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "name",
|
|
158
|
+
"type": "string",
|
|
159
|
+
"description": "The name prop is typically used to reference a component instance when defining shared events. However, this\noptional prop may also be applied to child elements as an ID prefix. This is a workaround to ensure Victory\nbased components output unique IDs when multiple charts appear in a page."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "padding",
|
|
163
|
+
"type": "number | { top: number, bottom: number, left: number, right: number }",
|
|
164
|
+
"description": "The padding props specifies the amount of padding in number of pixels between\nthe edge of the chart and any rendered child components. This prop can be given\nas a number or as an object with padding specified for top, bottom, left\nand right."
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "patternScale",
|
|
168
|
+
"type": "string[]",
|
|
169
|
+
"description": "The patternScale prop is an optional prop that defines patterns to apply, where applicable. This prop should be\ngiven as a string array of pattern URLs. Patterns will be assigned to children by index and will repeat when there\nare more children than patterns in the provided patternScale. Use null to omit the pattern for a given index.\n\nNote: Not all components are supported; for example, ChartLine, ChartBullet, ChartThreshold, etc.\n\n@example patternScale={[ 'url(\"#pattern1\")', 'url(\"#pattern2\")', null ]}"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "polar",
|
|
173
|
+
"type": "boolean",
|
|
174
|
+
"description": "Victory components can pass a boolean polar prop to specify whether a label is part of a polar chart."
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "range",
|
|
178
|
+
"type": "number[] | { x: number[], y: number[] }",
|
|
179
|
+
"description": "The range prop describes the dimensions over which data may be plotted. For cartesian coordinate systems, this\ncorresponds to minimum and maximum svg coordinates in the x and y dimension. In polar coordinate systems this\ncorresponds to a range of angles and radii. When this value is not given it will be calculated from the width,\nheight, and padding, or from the startAngle and endAngle in the case of polar charts. All components in a given\nchart must share the same range, so setting this prop on children nested within Chart, ChartStack, or\nChartGroup will have no effect. This prop is usually not set manually.\n\n\n@example [low, high] | { x: [low, high], y: [low, high] }\n\nCartesian: range={{ x: [50, 250], y: [50, 250] }}\nPolar: range={{ x: [0, 360], y: [0, 250] }}"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "scale",
|
|
183
|
+
"type": "string | { x: string, y: string }",
|
|
184
|
+
"description": "The scale prop determines which scales your chart should use. This prop can be\ngiven as a string specifying a supported scale (\"linear\", \"time\", \"log\", \"sqrt\"),\nas a d3 scale function, or as an object with scales specified for x and y\n\n\n@example d3Scale.time(), {x: \"linear\", y: \"log\"}"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "showAxis",
|
|
188
|
+
"type": "boolean",
|
|
189
|
+
"description": "Convenience prop to hide both x and y axis, which are shown by default. Alternatively, the axis can be hidden via\nchart styles.",
|
|
190
|
+
"defaultValue": "true"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "singleQuadrantDomainPadding",
|
|
194
|
+
"type": "boolean | { x?: boolean; y?: boolean }",
|
|
195
|
+
"description": "By default domainPadding is coerced to existing quadrants. This means that if a given domain only includes positive\nvalues, no amount of padding applied by domainPadding will result in a domain with negative values. This is the\ndesired behavior in most cases. For users that need to apply padding without regard to quadrant, the\nsingleQuadrantDomainPadding prop may be used. This prop may be given as a boolean or an object with boolean values\nspecified for \"x\" and/or \"y\". When this prop is false (or false for a given dimension), padding will be applied\nwithout regard to quadrant. If this prop is not specified, domainPadding will be coerced to existing quadrants.\n\nNote: The x value supplied to the singleQuadrantDomainPadding prop refers to the independent variable, and the y\nvalue refers to the dependent variable. This may cause confusion in horizontal charts, as the independent variable\nwill corresponds to the y axis.\n\n@example\n\nsingleQuadrantDomainPadding={false}\nsingleQuadrantDomainPadding={{ x: false }}"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "standalone",
|
|
199
|
+
"type": "boolean",
|
|
200
|
+
"description": "The standalone prop determines whether the component will render a standalone svg\nor a <g> tag that will be included in an external svg. Set standalone to false to\ncompose Chart with other components within an enclosing <svg> tag."
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "startAngle",
|
|
204
|
+
"type": "number",
|
|
205
|
+
"description": "The startAngle props defines the overall start angle of a polar chart in degrees. This prop is used in conjunction\nwith endAngle to create polar chart that spans only a segment of a circle, or to change overall rotation of the\nchart. This prop should be given as a number of degrees. Degrees are defined as starting at the 3 o'clock position,\nand proceeding counterclockwise."
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "style",
|
|
209
|
+
"type": "{ parent: object, background: object }",
|
|
210
|
+
"description": "The style prop defines the style of the component. The style prop should be given as an object with styles defined\nfor data, labels and parent. Any valid svg styles are supported, but width, height, and padding should be specified\nvia props as they determine relative layout for components in Chart.\n\n\n@propType { parent: object, background: object }"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "theme",
|
|
214
|
+
"type": "object",
|
|
215
|
+
"description": "The theme prop specifies a theme to use for determining styles and layout properties for a component. Any styles or\nprops defined in theme may be overwritten by props specified on the component instance.",
|
|
216
|
+
"defaultValue": "getChartTheme(themeColor, showAxis)"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "themeColor",
|
|
220
|
+
"type": "string",
|
|
221
|
+
"description": "Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc.\n\nNote: Not compatible with theme prop\n\n@example themeColor={ChartThemeColor.blue}"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "width",
|
|
225
|
+
"type": "number",
|
|
226
|
+
"description": "Specifies the width of the svg viewBox of the chart container. This value should be given as a\nnumber of pixels.\n\nBecause Victory renders responsive containers, the width and height props do not determine the width and\nheight of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of\npixels will depend on the size of the container the chart is rendered into. Typically, the parent container is set\nto the same width in order to maintain the aspect ratio.",
|
|
227
|
+
"defaultValue": "theme.chart.width"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "ChartAxis",
|
|
233
|
+
"description": "ChartAxis renders a single axis which can be used on its own or composed with Chart.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-axis/src/index.d.ts",
|
|
234
|
+
"props": [
|
|
235
|
+
{
|
|
236
|
+
"name": "animate",
|
|
237
|
+
"type": "boolean | object",
|
|
238
|
+
"description": "The animate prop specifies props for VictoryAnimation to use.\nThe animate prop should also be used to specify enter and exit\ntransition configurations with the `onExit` and `onEnter` namespaces respectively.\n\n\n@example {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})}"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "axisComponent",
|
|
242
|
+
"type": "React.ReactElement<any>",
|
|
243
|
+
"description": "The axisComponent prop takes in an entire component which will be used\nto create the axis line. The new element created from the passed axisComponent\nwill be supplied with the following properties: x1, y1, x2, y2, style and events.\nAny of these props may be overridden by passing in props to the supplied component,\nor modified or ignored within the custom component itself. If an axisComponent\nis not supplied, ChartAxis will render its default AxisLine component."
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "axisLabelComponent",
|
|
247
|
+
"type": "React.ReactElement<any>",
|
|
248
|
+
"description": "The axisLabelComponent prop takes in an entire component which will be used\nto create the axis label. The new element created from the passed axisLabelComponent\nwill be supplied with the following properties: x, y, verticalAnchor, textAnchor,\nangle, transform, style and events. Any of these props may be overridden by\npassing in props to the supplied component, or modified or ignored within\nthe custom component itself. If an axisLabelComponent is not supplied, a new\nChartLabel will be created with props described above",
|
|
249
|
+
"defaultValue": "<ChartLabel />"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "axisValue",
|
|
253
|
+
"type": "number | string | object | Date",
|
|
254
|
+
"description": "The axisValue prop may be used instead of axisAngle to position the dependent axis. Ths prop is useful when\ndependent axes should line up with values on the independent axis."
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "containerComponent",
|
|
258
|
+
"type": "React.ReactElement<any>",
|
|
259
|
+
"description": "The containerComponent prop takes an entire component which will be used to\ncreate a container element for standalone charts.\nThe new element created from the passed containerComponent wil be provided with\nthese props from ChartAxis: height, width, children\n(the chart itself) and style. Props that are not provided by the\nchild chart component include title and desc, both of which\nare intended to add accessibility to Victory components. The more descriptive these props\nare, the more accessible your data will be for people using screen readers.\nAny of these props may be overridden by passing in props to the supplied component,\nor modified or ignored within the custom component itself. If a dataComponent is\nnot provided, ChartAxis will use the default ChartContainer component.\n\n@example <ChartContainer title=\"Chart of Dog Breeds\" desc=\"This chart shows ...\" />",
|
|
260
|
+
"defaultValue": "<ChartContainer />"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "crossAxis",
|
|
264
|
+
"type": "boolean",
|
|
265
|
+
"description": "This prop specifies whether a given axis is intended to cross another axis."
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "dependentAxis",
|
|
269
|
+
"type": "boolean",
|
|
270
|
+
"description": "The dependentAxis prop specifies whether the axis corresponds to the\ndependent variable (usually y). This prop is useful when composing axis\nwith other components to form a chart."
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "domain",
|
|
274
|
+
"type": "number[] | { x: number[], y: number[] }",
|
|
275
|
+
"description": "The domain prop describes the range of values your axis will include. This prop should be\ngiven as a array of the minimum and maximum expected values for your axis.\nIf this value is not given it will be calculated based on the scale or tickValues.\n\n\n@example [low, high], { x: [low, high], y: [low, high] }\n\n[-1, 1], {x: [0, 100], y: [0, 1]}"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "domainPadding",
|
|
279
|
+
"type": "number | number[] | { x: number[], y: number[] }",
|
|
280
|
+
"description": "The domainPadding prop specifies a number of pixels of padding to add to the\nbeginning and end of a domain. This prop is useful for explicitly spacing ticks farther\nfrom the origin to prevent crowding. This prop should be given as an object with\nnumbers specified for x and y.\n\n\n@example [left, right], { x: [left, right], y: [bottom, top] }\n\n{x: [10, -10], y: 5}"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"name": "events",
|
|
284
|
+
"type": "object[]",
|
|
285
|
+
"description": "The event prop take an array of event objects. Event objects are composed of\na target, an eventKey, and eventHandlers. Targets may be any valid style namespace\nfor a given component, so \"axis\", \"axisLabel\", \"ticks\", \"tickLabels\", and \"grid\" are\nall valid targets for ChartAxis events. The eventKey may optionally be used to select a\nsingle element by index rather than an entire set. The eventHandlers object\nshould be given as an object whose keys are standard event names (i.e. onClick)\nand whose values are event callbacks. The return value of an event handler\nbe used to modify other elements. The return value should be given as an object or\nan array of objects with optional target and eventKey keys, and a mutation\nkey whose value is a function. The target and eventKey keys will default to those\ncorresponding to the element the event handler was attached to. The mutation\nfunction will be called with the calculated props for the individual selected\nelement (i.e. a single tick), and the object returned from the mutation function\nwill override the props of the selected element via object assignment.\n\n\n@example\nevents={[\n {\n target: \"grid\",\n eventKey: 2,\n eventHandlers: {\n onClick: () => {\n return [\n {\n mutation: (props) => {\n return {style: merge({}, props.style, {stroke: \"orange\"})};\n }\n }, {\n target: \"tickLabels\",\n mutation: () => {\n return {text: \"hey\"};\n }\n }\n ];\n }\n }\n }\n]}"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "externalEventMutations",
|
|
289
|
+
"type": "object[]",
|
|
290
|
+
"description": "ChartAxis uses the standard externalEventMutations prop."
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "fixAxisLabelHeight",
|
|
294
|
+
"type": "boolean",
|
|
295
|
+
"description": "When true, this prop adjusts the height between the axis label and bottom positioned legend"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"name": "fixLabelOverlap",
|
|
299
|
+
"type": "boolean",
|
|
300
|
+
"description": "When true, this prop reduces the number of tick labels to fit the length of the axis.\nLabels are removed at approximately even intervals from the original array of labels.\nThis feature only works well for labels that are approximately evenly spaced."
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "gridComponent",
|
|
304
|
+
"type": "React.ReactElement<any>",
|
|
305
|
+
"description": "The gridComponent prop takes in an entire component which will be used\nto create grid lines. The new element created from the passed gridComponent\nwill be supplied with the following properties: x1, y1, x2, y2, tick, style and events.\nAny of these props may be overridden by passing in props to the supplied component,\nor modified or ignored within the custom component itself. If a gridComponent\nis not supplied, ChartAxis will render its default GridLine component."
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "groupComponent",
|
|
309
|
+
"type": "React.ReactElement<any>",
|
|
310
|
+
"description": "The groupComponent prop takes an entire component which will be used to\ncreate group elements for use within container elements. This prop defaults\nto a <g> tag on web, and a react-native-svg <G> tag on mobile"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "height",
|
|
314
|
+
"type": "number",
|
|
315
|
+
"description": "Specifies the height the svg viewBox of the chart container. This value should be given as a\nnumber of pixels.\n\nBecause Victory renders responsive containers, the width and height props do not determine the width and\nheight of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of\npixels will depend on the size of the container the chart is rendered into."
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "invertAxis",
|
|
319
|
+
"type": "boolean",
|
|
320
|
+
"description": "If true, this value will flip the domain of a given axis."
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "label",
|
|
324
|
+
"type": "any",
|
|
325
|
+
"description": "The label prop defines the label that will appear along the axis. This\nprop should be given as a value or an entire, HTML-complete label\ncomponent. If a label component is given, it will be cloned. The new\nelement's properties x, y, textAnchor, verticalAnchor, and transform\nwill have defaults provided by the axis; styles filled out with\ndefaults provided by the axis, and overrides from the label component.\nIf a value is given, a new ChartLabel will be created with props and\nstyles from the axis."
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "maxDomain",
|
|
329
|
+
"type": "number | { x?: number; y?: number }",
|
|
330
|
+
"description": "The maxDomain prop defines a maximum domain value for a chart. This prop is useful in situations where the maximum\ndomain of a chart is static, while the minimum value depends on data or other variable information. If the domain\nprop is set in addition to maximumDomain, domain will be used.\n\nNote: The x value supplied to the maxDomain prop refers to the independent variable, and the y value refers to the\ndependent variable. This may cause confusion in horizontal charts, as the independent variable will corresponds to\nthe y axis.\n\n@example\n\nmaxDomain={0}\nmaxDomain={{ y: 0 }}"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "minDomain",
|
|
334
|
+
"type": "number | { x?: number; y?: number }",
|
|
335
|
+
"description": "The minDomain prop defines a minimum domain value for a chart. This prop is useful in situations where the minimum\ndomain of a chart is static, while the maximum value depends on data or other variable information. If the domain\nprop is set in addition to minimumDomain, domain will be used.\n\nNote: The x value supplied to the minDomain prop refers to the independent variable, and the y value refers to the\ndependent variable. This may cause confusion in horizontal charts, as the independent variable will corresponds to\nthe y axis.\n\n@example\n\nminDomain={0}\nminDomain={{ y: 0 }}"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "name",
|
|
339
|
+
"type": "string",
|
|
340
|
+
"description": "The name prop is typically used to reference a component instance when defining shared events. However, this\noptional prop may also be applied to child elements as an ID prefix. This is a workaround to ensure Victory\nbased components output unique IDs when multiple charts appear in a page."
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "offsetX",
|
|
344
|
+
"type": "number",
|
|
345
|
+
"description": "This value describes how far from the \"edge\" of its permitted area each axis\nwill be set back in the x-direction. If this prop is not given,\nthe offset is calculated based on font size, axis orientation, and label padding."
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "offsetY",
|
|
349
|
+
"type": "number",
|
|
350
|
+
"description": "This value describes how far from the \"edge\" of its permitted area each axis\nwill be set back in the y-direction. If this prop is not given,\nthe offset is calculated based on font size, axis orientation, and label padding."
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"name": "orientation",
|
|
354
|
+
"type": "string",
|
|
355
|
+
"description": "The orientation prop specifies the position and orientation of your axis.\nValid values are 'top', 'bottom', 'left' and 'right'."
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "padding",
|
|
359
|
+
"type": "number | { top: number, bottom: number, left: number, right: number }",
|
|
360
|
+
"description": "The padding props specifies the amount of padding in number of pixels between\nthe edge of the chart and any rendered child components. This prop can be given\nas a number or as an object with padding specified for top, bottom, left\nand right."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "range",
|
|
364
|
+
"type": "number[] | { x: number[], y: number[] }",
|
|
365
|
+
"description": "The range prop describes the dimensions over which data may be plotted. For cartesian coordinate systems, this\ncorresponds to minimum and maximum svg coordinates in the x and y dimension. In polar coordinate systems this\ncorresponds to a range of angles and radii. When this value is not given it will be calculated from the width,\nheight, and padding, or from the startAngle and endAngle in the case of polar charts. All components in a given\nchart must share the same range, so setting this prop on children nested within Chart, ChartStack, or\nChartGroup will have no effect. This prop is usually not set manually.\n\n\n@example [low, high] | { x: [low, high], y: [low, high] }\n\nCartesian: range={{ x: [50, 250], y: [50, 250] }}\nPolar: range={{ x: [0, 360], y: [0, 250] }}"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "scale",
|
|
369
|
+
"type": "string | { x: string, y: string }",
|
|
370
|
+
"description": "The scale prop determines which scales your chart should use. This prop can be\ngiven as a string specifying a supported scale (\"linear\", \"time\", \"log\", \"sqrt\"),\nas a d3 scale function, or as an object with scales specified for x and y\n\n\n@example d3Scale.time(), {x: \"linear\", y: \"log\"}"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"name": "showGrid",
|
|
374
|
+
"type": "boolean",
|
|
375
|
+
"description": "Show axis grid and ticks",
|
|
376
|
+
"defaultValue": "false"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "singleQuadrantDomainPadding",
|
|
380
|
+
"type": "boolean | { x?: boolean; y?: boolean }",
|
|
381
|
+
"description": "By default domainPadding is coerced to existing quadrants. This means that if a given domain only includes positive\nvalues, no amount of padding applied by domainPadding will result in a domain with negative values. This is the\ndesired behavior in most cases. For users that need to apply padding without regard to quadrant, the\nsingleQuadrantDomainPadding prop may be used. This prop may be given as a boolean or an object with boolean values\nspecified for \"x\" and/or \"y\". When this prop is false (or false for a given dimension), padding will be applied\nwithout regard to quadrant. If this prop is not specified, domainPadding will be coerced to existing quadrants.\n\nNote: The x value supplied to the singleQuadrantDomainPadding prop refers to the independent variable, and the y\nvalue refers to the dependent variable. This may cause confusion in horizontal charts, as the independent variable\nwill corresponds to the y axis.\n\n@example\n\nsingleQuadrantDomainPadding={false}\nsingleQuadrantDomainPadding={{ x: false }}"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"name": "standalone",
|
|
385
|
+
"type": "boolean",
|
|
386
|
+
"description": "The standalone prop determines whether the component will render a standalone svg\nor a <g> tag that will be included in an external svg. Set standalone to false to\ncompose ChartAxis with other components within an enclosing <svg> tag."
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"name": "style",
|
|
390
|
+
"type": "{ axis: object, axisLabel: object, grid: object, ticks: object, tickLabels: object }",
|
|
391
|
+
"description": "The style prop defines the style of the component. The style prop should be given as an object\nwith styles defined for parent, axis, axisLabel, grid, ticks, and tickLabels. Any valid svg\nstyles are supported, but width, height, and padding should be specified via props as they\ndetermine relative layout for components in Chart. Functional styles may be defined for\ngrid, tick, and tickLabel style properties, and they will be evaluated with each tick.\n\nNote: When a component is rendered as a child of another Victory component, or within a custom\n<svg> element with standalone={false} parent styles will be applied to the enclosing <g> tag.\nMany styles that can be applied to a parent <svg> will not be expressed when applied to a <g>.\n\nNote: custom angle and verticalAnchor properties may be included in labels styles."
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "theme",
|
|
395
|
+
"type": "object",
|
|
396
|
+
"description": "The theme prop takes a style object with nested data, labels, and parent objects.\nYou can create this object yourself, or you can use a theme provided by\nWhen using ChartAxis as a solo component, implement the theme directly on\nChartAxis. If you are wrapping ChartAxis in ChartChart or ChartGroup,\nplease call the theme on the outermost wrapper component instead.",
|
|
397
|
+
"defaultValue": "getTheme(themeColor)"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "themeColor",
|
|
401
|
+
"type": "string",
|
|
402
|
+
"description": "Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc.\n\nNote: Not compatible with theme prop\n\n@example themeColor={ChartThemeColor.blue}"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"name": "tickComponent",
|
|
406
|
+
"type": "React.ReactElement<any>",
|
|
407
|
+
"description": "The tickComponent prop takes in an entire component which will be used\nto create tick lines. The new element created from the passed tickComponent\nwill be supplied with the following properties: x1, y1, x2, y2, tick, style and events.\nAny of these props may be overridden by passing in props to the supplied component,\nor modified or ignored within the custom component itself. If a tickComponent\nis not supplied, ChartAxis will render its default Tick component."
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"name": "tickCount",
|
|
411
|
+
"type": "number",
|
|
412
|
+
"description": "The tickCount prop specifies approximately how many ticks should be drawn on the axis if\ntickValues are not explicitly provided. This value is calculated by d3 scale and\nprioritizes returning \"nice\" values and evenly spaced ticks over an exact number of ticks.\nIf you need an exact number of ticks, please specify them via the tickValues prop.\nThis prop must have a value greater than zero."
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"name": "tickFormat",
|
|
416
|
+
"type": "any[] | ((tick: any, index: number, ticks: any[]) => string | number)",
|
|
417
|
+
"description": "The tickFormat prop specifies how tick values should be expressed visually.\ntickFormat can be given as a function to be applied to every tickValue, or as\nan array of display values for each tickValue.\n\n@example d3.time.format(\"%Y\"), (x) => x.toPrecision(2), [\"first\", \"second\", \"third\"]"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "tickLabelComponent",
|
|
421
|
+
"type": "React.ReactElement<any>",
|
|
422
|
+
"description": "The tickLabelComponent prop takes in an entire component which will be used\nto create the tick labels. The new element created from the passed tickLabelComponent\nwill be supplied with the following properties: x, y, verticalAnchor, textAnchor,\nangle, tick, style and events. Any of these props may be overridden by\npassing in props to the supplied component, or modified or ignored within\nthe custom component itself. If an tickLabelComponent is not supplied, a new\nChartLabel will be created with props described above",
|
|
423
|
+
"defaultValue": "<ChartLabel />"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "tickValues",
|
|
427
|
+
"type": "any[]",
|
|
428
|
+
"description": "The tickValues prop explicitly specifies which tick values to draw on the axis.\n\n@example [\"apples\", \"bananas\", \"oranges\"], [2, 4, 6, 8]"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"name": "width",
|
|
432
|
+
"type": "number",
|
|
433
|
+
"description": "Specifies the width of the svg viewBox of the chart container. This value should be given as a\nnumber of pixels.\n\nBecause Victory renders responsive containers, the width and height props do not determine the width and\nheight of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of\npixels will depend on the size of the container the chart is rendered into.\n\nNote: innerRadius may need to be set when using this property."
|
|
434
|
+
}
|
|
435
|
+
]
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "ChartBoxPlot",
|
|
439
|
+
"description": "ChartBoxPlot renders a box plot to describe the distribution of a set of data. Data for ChartBoxPlot may be given\nwith summary statistics pre-calculated (min, median, max, q1, q3), or as an array of raw data. ChartBoxPlot can be\ncomposed with Chart to create box plot charts.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-bar/src/index.d.ts",
|
|
440
|
+
"props": [
|
|
441
|
+
{
|
|
442
|
+
"name": "animate",
|
|
443
|
+
"type": "boolean | object",
|
|
444
|
+
"description": "The animate prop specifies props for VictoryAnimation to use.\nThe animate prop should also be used to specify enter and exit\ntransition configurations with the `onExit` and `onEnter` namespaces respectively.\n\n\n@example {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})}"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "boxWidth",
|
|
448
|
+
"type": "number",
|
|
449
|
+
"description": "The boxWidth prop specifies how wide each box should be. If the whiskerWidth prop is not set, this prop will also\ndetermine the width of the whisker crosshair."
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "categories",
|
|
453
|
+
"type": "string[] | { x: string[], y: string[] }",
|
|
454
|
+
"description": "The categories prop specifies how categorical data for a chart should be ordered.\nThis prop should be given as an array of string values, or an object with\nthese arrays of values specified for x and y. If this prop is not set,\ncategorical data will be plotted in the order it was given in the data array\n\n\n@example [\"dogs\", \"cats\", \"mice\"]"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"name": "containerComponent",
|
|
458
|
+
"type": "React.ReactElement<any>",
|
|
459
|
+
"description": "The containerComponent prop takes an entire component which will be used to\ncreate a container element for standalone charts.\nThe new element created from the passed containerComponent wil be provided with\nthese props from ChartBoxPlot: height, width, children\n(the chart itself) and style. Props that are not provided by the\nchild chart component include title and desc, both of which\nare intended to add accessibility to Victory components. The more descriptive these props\nare, the more accessible your data will be for people using screen readers.\nAny of these props may be overridden by passing in props to the supplied component,\nor modified or ignored within the custom component itself. If a dataComponent is\nnot provided, ChartBoxPlot will use the default ChartContainer component.\n\n@example <ChartContainer title=\"Chart of Dog Breeds\" desc=\"This chart shows...\" />",
|
|
460
|
+
"defaultValue": "<ChartContainer />"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"name": "data",
|
|
464
|
+
"type": "any[]",
|
|
465
|
+
"description": "The data prop for ChartBoxPlot may be given in a variety of formats:\n\n@example\nAs an array of standard data objects with values specified for x and y When given in this format, repeated values\nfor x will be used for calculating summary statistics\n\ndata={[\n { x: 1, y: 2 },\n { x: 1, y: 3 },\n { x: 1, y: 5 },\n { x: 2, y: 1 },\n { x: 2, y: 4 },\n { x: 2, y: 5 },\n ...\n]}\n\n@example As an array of data objects where y is given as an array of values When given in this format, array values\nare used for calculating summary statistics.\n\ndata={[\n { x: 1, y: [1, 2, 3, 5] },\n { x: 2, y: [3, 2, 8, 10] },\n { x: 3, y: [2, 8, 6, 5] },\n { x: 4, y: [1, 3, 2, 9] }\n]}\n\n@example As an array of data objects with pre-calculated summary statistics(min, median, max, q1, q3) When given in\nthis format, ChartBoxPlot will not perform statistical analysis. Pre-calculating summary statistics for large\ndatasets will improve performance.\n\ndata={[\n { x: 1, min: 2, median: 5, max: 10, q1: 3, q3: 7 },\n { x: 2, min: 1, median: 4, max: 9, q1: 3, q3: 6 },\n { x: 3, min: 1, median: 6, max: 12, q1: 4, q3: 10 },\n]}\n\nUse the x, y, min, max, median, q1, and q3 data accessor props to specify custom data formats."
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "domain",
|
|
469
|
+
"type": "number[] | { x: number[], y: number[] }",
|
|
470
|
+
"description": "The domain prop describes the range of values your chart will cover. This prop can be\ngiven as a array of the minimum and maximum expected values for your bar chart,\nor as an object that specifies separate arrays for x and y.\nIf this prop is not provided, a domain will be calculated from data, or other\navailable information.\n\n\n@example [low, high], { x: [low, high], y: [low, high] }\n\n[-1, 1], {x: [0, 100], y: [0, 1]}"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "domainPadding",
|
|
474
|
+
"type": "number | number[] | { x: number[], y: number[] }",
|
|
475
|
+
"description": "The domainPadding prop specifies a number of pixels of padding to add to the\nbeginning and end of a domain. This prop is useful for explicitly spacing ticks farther\nfrom the origin to prevent crowding. This prop should be given as an object with\nnumbers specified for x and y.\n\n\n@example [left, right], { x: [left, right], y: [bottom, top] }\n\n{x: [10, -10], y: 5}"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"name": "eventKey",
|
|
479
|
+
"type": "number | string | Function",
|
|
480
|
+
"description": "Similar to data accessor props `x` and `y`, this prop may be used to functionally\nassign eventKeys to data"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"name": "events",
|
|
484
|
+
"type": "object[]",
|
|
485
|
+
"description": "The event prop take an array of event objects. Event objects are composed of\na target, an eventKey, and eventHandlers. Targets may be any valid style namespace\nfor a given component, so \"data\" and \"labels\" are all valid targets for ChartBoxPlot events.\nThe eventKey may optionally be used to select a single element by index rather than an entire\nset. The eventHandlers object should be given as an object whose keys are standard\nevent names (i.e. onClick) and whose values are event callbacks. The return value\nof an event handler is used to modify elements. The return value should be given\nas an object or an array of objects with optional target and eventKey keys,\nand a mutation key whose value is a function. The target and eventKey keys\nwill default to those corresponding to the element the event handler was attached to.\nThe mutation function will be called with the calculated props for the individual selected\nelement (i.e. a single bar), and the object returned from the mutation function\nwill override the props of the selected element via object assignment.\n\n\n@example\n\nevents={[\n {\n target: \"data\",\n eventKey: \"thisOne\",\n eventHandlers: {\n onClick: () => {\n return [\n {\n eventKey: \"theOtherOne\",\n mutation: (props) => {\n return {style: merge({}, props.style, {fill: \"orange\"})};\n }\n }, {\n eventKey: \"theOtherOne\",\n target: \"labels\",\n mutation: () => {\n return {text: \"hey\"};\n }\n }\n ];\n }\n }\n }\n]}"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"name": "externalEventMutations",
|
|
489
|
+
"type": "object[]",
|
|
490
|
+
"description": "ChartBoxPlot uses the standard externalEventMutations prop."
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "groupComponent",
|
|
494
|
+
"type": "React.ReactElement<any>",
|
|
495
|
+
"description": "The groupComponent prop takes an entire component which will be used to\ncreate group elements for use within container elements. This prop defaults\nto a <g> tag on web, and a react-native-svg <G> tag on mobile"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"name": "height",
|
|
499
|
+
"type": "number",
|
|
500
|
+
"description": "The height props specifies the height the svg viewBox of the chart container.\nThis value should be given as a number of pixels"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"name": "horizontal",
|
|
504
|
+
"type": "boolean",
|
|
505
|
+
"description": "The horizontal prop determines whether the bars will be laid vertically or\nhorizontally. The bars will be vertical if this prop is false or unspecified,\nor horizontal if the prop is set to true."
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"name": "labelOrientation",
|
|
509
|
+
"type": "OrientationTypes | VictoryBoxPlotLabelOrientationInterface",
|
|
510
|
+
"description": "The labelOrientation prop determines where labels are placed relative to their corresponding data. If this prop is\nnot set, it will be set to \"top\" for horizontal charts, and \"right\" for vertical charts."
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"name": "labels",
|
|
514
|
+
"type": "boolean",
|
|
515
|
+
"description": "When the boolean labels prop is set to true, the values for min, max, median, q1, and q3 will be displayed for\neach box. For more granular label control, use the individual minLabels, maxLabels, medianLabels, q1Labels, and\nq3Labels props."
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"name": "max",
|
|
519
|
+
"type": "string | array[string] | function",
|
|
520
|
+
"description": "Use the max data accessor prop to define the max value of a box plot.\n\n\n@example Specify which property in an array of data objects should be used as the max value\n\nmax=\"max_value\"\n\n@example Use a function to translate each element in a data array into a max value\n\nmax={() => 10}\n\n@example Specify which property in an array of nested data objects should be used as a max value\n\nmax=\"bonds.max\", max={[\"bonds\", \"max\"]}"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"name": "maxComponent",
|
|
524
|
+
"type": "React.ReactElement<any>",
|
|
525
|
+
"description": "The maxComponent prop takes a component instance which will be responsible for rendering an element to represent\nthe maximum value of the box plot. The new element created from the passed maxComponent will be provided with the\nfollowing props calculated by ChartBoxPlot: datum, index, scale, style, events, majorWhisker and minorWhisker.\nThe majorWhisker and minorWhisker props are given as objects with values for x1, y1, x2 and y2 that describes the\nlines that make up the major and minor whisker. Any of these props may be overridden by passing in props to the\nsupplied component, or modified or ignored within the custom component itself. If a maxComponent is not provided,\nChartBoxPlot will use its default Whisker component."
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"name": "maxDomain",
|
|
529
|
+
"type": "number | { x?: number; y?: number }",
|
|
530
|
+
"description": "The maxDomain prop defines a maximum domain value for a chart. This prop is useful in situations where the maximum\ndomain of a chart is static, while the minimum value depends on data or other variable information. If the domain\nprop is set in addition to maximumDomain, domain will be used.\n\nNote: The x value supplied to the maxDomain prop refers to the independent variable, and the y value refers to the\ndependent variable. This may cause confusion in horizontal charts, as the independent variable will corresponds to\nthe y axis.\n\n@example\n\nmaxDomain={0}\nmaxDomain={{ y: 0 }}"
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"name": "maxLabelComponent",
|
|
534
|
+
"type": "React.ReactElement<any>",
|
|
535
|
+
"description": "The maxLabelComponent prop takes a component instance which will be used to render the label corresponding to the\nmaximum value for each box. The new element created from the passed maxLabelComponent will be supplied with the\nfollowing props: x, y, datum, index, scale, verticalAnchor, textAnchor, angle, transform, style and events. Any of\nthese props may be overridden by passing in props to the supplied component, or modified or ignored within the\ncustom component itself. If maxLabelComponent is omitted, a new ChartLabel will be created with props described\nabove."
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"name": "maxLabels",
|
|
539
|
+
"type": "VictoryBoxPlotLabelType",
|
|
540
|
+
"description": "The maxLabels prop defines the labels that will appear above each point. This prop should be given as a boolean,\nan array or as a function of the props corresponding to that label. When given as a boolean value, the max value\nof each datum will be used for the label.\n\n@example\n\nmaxLabels={[\"first\", \"second\", \"third\"]}\nmaxLabels={({ datum }) => Math.round(datum.max)}"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"name": "median",
|
|
544
|
+
"type": "string | array[string] | function",
|
|
545
|
+
"description": "Use the median data accessor prop to define the median value of a box plot.\n\n\n@example Specify which property in an array of data objects should be used as the median value\n\nmedian=\"median_value\"\n\n@example Use a function to translate each element in a data array into a median value\n\nmedian={() => 10}\n\n@example Specify which property in an array of nested data objects should be used as a median value\n\nmedian=\"bonds.median\", median={[\"bonds\", \"median\"]}"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "medianComponent",
|
|
549
|
+
"type": "React.ReactElement<any>",
|
|
550
|
+
"description": "The medianComponent prop takes a component instance which will be responsible for rendering an element to represent\nthe median value of the box plot. The new element created from the passed medianComponent will be provided with the\nfollowing props calculated by ChartBoxPlot: datum, index, scale, style, events, x1, y1, x2 and y2 Any of these\nprops may be overridden by passing in props to the supplied component, or modified or ignored within the custom\ncomponent itself. If a medianComponent is not provided, ChartBoxPlot will use its default Line component."
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"name": "medianLabelComponent",
|
|
554
|
+
"type": "React.ReactElement<any>",
|
|
555
|
+
"description": "The medianLabelComponent prop takes a component instance which will be used to render the label corresponding to\nthe median value for each box. The new element created from the passed medianLabelComponent will be supplied with\nthe following props: x, y, datum, index, scale, verticalAnchor, textAnchor, angle, transform, style and events. Any\nof these props may be overridden by passing in props to the supplied component, or modified or ignored within the\ncustom component itself. If medianLabelComponent is omitted, a new ChartLabel will be created with props\ndescribed above."
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "medianLabels",
|
|
559
|
+
"type": "string | function | boolean",
|
|
560
|
+
"description": "The medianLabels prop defines the labels that will appear above each point. This prop should be given as a boolean,\nan array or as a function of the props corresponding to that label. When given as a boolean value, the median value\nof each datum will be used for the label.\n\n\n@example\n\nmedianLabels={[\"first\", \"second\", \"third\"]}\nmedianLabels={({ datum }) => Math.round(datum.median)}"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"name": "min",
|
|
564
|
+
"type": "string | array[string] | function",
|
|
565
|
+
"description": "Use the min data accessor prop to define the min value of a box plot.\n\n\n@example Specify which property in an array of data objects should be used as the min value\n\nmin=\"min_value\"\n\n@example Use a function to translate each element in a data array into a min value\n\nmin={() => 10}\n\n@example Specify which property in an array of nested data objects should be used as a min value\n\nmin=\"bonds.min\", min={[\"bonds\", \"min\"]}"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"name": "minComponent",
|
|
569
|
+
"type": "React.ReactElement<any>",
|
|
570
|
+
"description": "The minComponent prop takes a component instance which will be responsible for rendering an element to represent\nthe minimum value of the box plot. The new element created from the passed minComponent will be provided with the\nfollowing props calculated by ChartBoxPlot: datum, index, scale, style, events, majorWhisker and minorWhisker.\nThe majorWhisker and minorWhisker props are given as objects with values for x1, y1, x2 and y2 that describes the\nlines that make up the major and minor whisker. Any of these props may be overridden by passing in props to the\nsupplied component, or modified or ignored within the custom component itself. If a minComponent is not provided,\nChartBoxPlot will use its default Whisker component."
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"name": "minDomain",
|
|
574
|
+
"type": "number | { x?: number; y?: number }",
|
|
575
|
+
"description": "The minDomain prop defines a minimum domain value for a chart. This prop is useful in situations where the minimum\ndomain of a chart is static, while the maximum value depends on data or other variable information. If the domain\nprop is set in addition to minimumDomain, domain will be used.\n\nNote: The x value supplied to the minDomain prop refers to the independent variable, and the y value refers to the\ndependent variable. This may cause confusion in horizontal charts, as the independent variable will corresponds to\nthe y axis.\n\n@example\n\nminDomain={0}\nminDomain={{ y: 0 }}"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "minLabelComponent",
|
|
579
|
+
"type": "React.ReactElement<any>",
|
|
580
|
+
"description": "The minLabelComponent prop takes a component instance which will be used to render the label corresponding to the\nminimum value for each box. The new element created from the passed minLabelComponent will be supplied with the\nfollowing props: x, y, datum, index, scale, verticalAnchor, textAnchor, angle, transform, style and events. Any of\nthese props may be overridden by passing in props to the supplied component, or modified or ignored within the\ncustom component itself. If minLabelComponent is omitted, a new ChartLabel will be created with props described\nabove."
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
"name": "minLabels",
|
|
584
|
+
"type": "string | function | boolean",
|
|
585
|
+
"description": "The minLabels prop defines the labels that will appear above each point. This prop should be given as a boolean, an\narray or as a function of the props corresponding to that label. When given as a boolean value, the min value of\neach datum will be used for the label.\n\n\n@example\n\nminLabels={[\"first\", \"second\", \"third\"]}\nminLabels={({ datum }) => Math.round(datum.min)}"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "name",
|
|
589
|
+
"type": "string",
|
|
590
|
+
"description": "The name prop is used to reference a component instance when defining shared events."
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"name": "origin",
|
|
594
|
+
"type": "{ x: number, y: number }",
|
|
595
|
+
"description": "Victory components will pass an origin prop is to define the center point in svg coordinates for polar charts.\n\nNote: It will not typically be necessary to set an origin prop manually"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"name": "padding",
|
|
599
|
+
"type": "number | { top: number, bottom: number, left: number, right: number }",
|
|
600
|
+
"description": "The padding props specifies the amount of padding in number of pixels between\nthe edge of the chart and any rendered child components. This prop can be given\nas a number or as an object with padding specified for top, bottom, left\nand right."
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"name": "q1",
|
|
604
|
+
"type": "string | array[string] | function",
|
|
605
|
+
"description": "Use the q1 data accessor prop to define the q1 value of a box plot.\n\n\n@example Specify which property in an array of data objects should be used as the q1 value\n\nq1=\"q1_value\"\n\n@example Use a function to translate each element in a data array into a q1 value\n\nq1={() => 10}\n\n@example Specify which property in an array of nested data objects should be used as a q1 value\n\nq1=\"bonds.q1\", q1={[\"bonds\", \"q1\"]}"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "q1Component",
|
|
609
|
+
"type": "React.ReactElement<any>",
|
|
610
|
+
"description": "The q1Component prop takes a component instance which will be responsible for rendering an element to represent the\nq1 value of the box plot. The new element created from the passed q1Component will be provided with the following\nprops calculated by ChartBoxPlot: datum, index, scale, style, events, x, y, width and height Any of these props\nmay be overridden by passing in props to the supplied component, or modified or ignored within the custom component\nitself. If a q1Component is not provided, ChartBoxPlot will use its default Box component."
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"name": "q1LabelComponent",
|
|
614
|
+
"type": "React.ReactElement<any>",
|
|
615
|
+
"description": "The q1LabelComponent prop takes a component instance which will be used to render the label corresponding to the q1\nvalue for each box. The new element created from the passed q1LabelComponent will be supplied with the following\nprops: x, y, datum, index, scale, verticalAnchor, textAnchor, angle, transform, style and events. Any of these\nprops may be overridden by passing in props to the supplied component, or modified or ignored within the custom\ncomponent itself. If q1LabelComponent is omitted, a new ChartLabel will be created with props described above."
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "q1Labels",
|
|
619
|
+
"type": "string | function | boolean",
|
|
620
|
+
"description": "The q1Labels prop defines the labels that will appear above each point. This prop should be given as a boolean, an\narray or as a function of the props corresponding to that label. When given as a boolean value, the q1 value of\neach datum will be used for the label.\n\n\n@example\n\nq1Labels={[\"first\", \"second\", \"third\"]}\nq1Labels={({ datum }) => Math.round(datum.q1)}"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"name": "q3",
|
|
624
|
+
"type": "string | array[string] | function",
|
|
625
|
+
"description": "Use the q3 data accessor prop to define the q3 value of a box plot.\n\n\n@example Specify which property in an array of data objects should be used as the q3 value\n\nq3=\"q3_value\"\n\n@example Use a function to translate each element in a data array into a q3 value\n\nq3={() => 10}\n\n@example Specify which property in an array of nested data objects should be used as a q3 value\n\nq3=\"bonds.q3\", q3={[\"bonds\", \"q3\"]}"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"name": "q3Component",
|
|
629
|
+
"type": "React.ReactElement<any>",
|
|
630
|
+
"description": "The q3Component prop takes a component instance which will be responsible for rendering an element to represent the\nq3 value of the box plot. The new element created from the passed q3Component will be provided with the following\nprops calculated by ChartBoxPlot: datum, index, scale, style, events, x, y, width and height Any of these props\nmay be overridden by passing in props to the supplied component, or modified or ignored within the custom component\nitself. If a q3Component is not provided, ChartBoxPlot will use its default Box component."
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "q3LabelComponent",
|
|
634
|
+
"type": "React.ReactElement<any>",
|
|
635
|
+
"description": "The q3LabelComponent prop takes a component instance which will be used to render the label corresponding to the q3\nvalue for each box. The new element created from the passed q3LabelComponent will be supplied with the following\nprops: x, y, datum, index, scale, verticalAnchor, textAnchor, angle, transform, style and events. Any of these\nprops may be overridden by passing in props to the supplied component, or modified or ignored within the custom\ncomponent itself. If q3LabelComponent is omitted, a new ChartLabel will be created with props described above."
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"name": "q3Labels",
|
|
639
|
+
"type": "string | function | boolean",
|
|
640
|
+
"description": "The q3Labels prop defines the labels that will appear above each point. This prop should be given as a boolean, an\narray or as a function of the props corresponding to that label. When given as a boolean value, the q3 value of\neach datum will be used for the label.\n\n\n@example\n\nq3Labels={[\"first\", \"second\", \"third\"]}\nq3Labels={({ datum }) => Math.round(datum.q3)}"
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
"name": "range",
|
|
644
|
+
"type": "number[] | { x: number[], y: number[] }",
|
|
645
|
+
"description": "The range prop describes the dimensions over which data may be plotted. For cartesian coordinate systems, this\ncorresponds to minimum and maximum svg coordinates in the x and y dimension. In polar coordinate systems this\ncorresponds to a range of angles and radii. When this value is not given it will be calculated from the width,\nheight, and padding, or from the startAngle and endAngle in the case of polar charts. All components in a given\nchart must share the same range, so setting this prop on children nested within Chart or\nChartGroup will have no effect. This prop is usually not set manually.\n\n\n@example [low, high] | { x: [low, high], y: [low, high] }\n\nCartesian: range={{ x: [50, 250], y: [50, 250] }}\nPolar: range={{ x: [0, 360], y: [0, 250] }}"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"name": "samples",
|
|
649
|
+
"type": "number",
|
|
650
|
+
"description": "The samples prop specifies how many individual points to plot when plotting\ny as a function of x. Samples is ignored if x props are provided instead."
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"name": "scale",
|
|
654
|
+
"type": "string | { x: string, y: string }",
|
|
655
|
+
"description": "The scale prop determines which scales your chart should use. This prop can be\ngiven as a string specifying a supported scale (\"linear\", \"time\", \"log\", \"sqrt\"),\nas a d3 scale function, or as an object with scales specified for x and y\n\n\n@example d3Scale.time(), {x: \"linear\", y: \"log\"}"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"name": "singleQuadrantDomainPadding",
|
|
659
|
+
"type": "boolean | { x?: boolean; y?: boolean }",
|
|
660
|
+
"description": "By default domainPadding is coerced to existing quadrants. This means that if a given domain only includes positive\nvalues, no amount of padding applied by domainPadding will result in a domain with negative values. This is the\ndesired behavior in most cases. For users that need to apply padding without regard to quadrant, the\nsingleQuadrantDomainPadding prop may be used. This prop may be given as a boolean or an object with boolean values\nspecified for \"x\" and/or \"y\". When this prop is false (or false for a given dimension), padding will be applied\nwithout regard to quadrant. If this prop is not specified, domainPadding will be coerced to existing quadrants.\n\nNote: The x value supplied to the singleQuadrantDomainPadding prop refers to the independent variable, and the y\nvalue refers to the dependent variable. This may cause confusion in horizontal charts, as the independent variable\nwill corresponds to the y axis.\n\n@example\n\nsingleQuadrantDomainPadding={false}\nsingleQuadrantDomainPadding={{ x: false }}"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"name": "sortKey",
|
|
664
|
+
"type": "number | string | Function | string[]",
|
|
665
|
+
"description": "Use the sortKey prop to indicate how data should be sorted. This prop\nis given directly to the lodash sortBy function to be executed on the\nfinal dataset."
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"name": "sortOrder",
|
|
669
|
+
"type": "string",
|
|
670
|
+
"description": "The sortOrder prop specifies whether sorted data should be returned in 'ascending' or 'descending' order."
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"name": "standalone",
|
|
674
|
+
"type": "boolean",
|
|
675
|
+
"description": "The standalone prop determines whether the component will render a standalone svg\nor a <g> tag that will be included in an external svg. Set standalone to false to\ncompose ChartBoxPlot with other components within an enclosing <svg> tag."
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "style",
|
|
679
|
+
"type": "{ parent: object, data: object, labels: object }",
|
|
680
|
+
"description": "The style prop specifies styles for your ChartBoxPlot. Any valid inline style properties\nwill be applied. Height, width, and padding should be specified via the height,\nwidth, and padding props, as they are used to calculate the alignment of\ncomponents within chart.\n\n\n@example {data: {fill: \"red\"}, labels: {fontSize: 12}}"
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"name": "theme",
|
|
684
|
+
"type": "object",
|
|
685
|
+
"description": "The theme prop takes a style object with nested data, labels, and parent objects.\nYou can create this object yourself, or you can use a theme provided by\nWhen using ChartBoxPlot as a solo component, implement the theme directly on\nChartBoxPlot. If you are wrapping ChartBoxPlot in ChartChart or ChartGroup,\nplease call the theme on the outermost wrapper component instead.",
|
|
686
|
+
"defaultValue": "getTheme(themeColor)"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "themeColor",
|
|
690
|
+
"type": "string",
|
|
691
|
+
"description": "Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc.\n\nNote: Not compatible with theme prop\n\n@example themeColor={ChartThemeColor.blue}"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"name": "whiskerWidth",
|
|
695
|
+
"type": "number",
|
|
696
|
+
"description": "The whiskerWidth prop specifies how wide each whisker crosshair should be. If the whiskerWidth prop is not set, the\nwidth of the whisker crosshair will match the width of the box."
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
"name": "width",
|
|
700
|
+
"type": "number",
|
|
701
|
+
"description": "The width props specifies the width of the svg viewBox of the chart container\nThis value should be given as a number of pixels"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"name": "x",
|
|
705
|
+
"type": "number | string | Function | string[]",
|
|
706
|
+
"description": "The x prop specifies how to access the X value of each data point.\nIf given as a function, it will be run on each data point, and returned value will be used.\nIf given as an integer, it will be used as an array index for array-type data points.\nIf given as a string, it will be used as a property key for object-type data points.\nIf given as an array of strings, or a string containing dots or brackets,\nit will be used as a nested object property path (for details see Lodash docs for _.get).\nIf `null` or `undefined`, the data value will be used as is (identity function/pass-through).\n\n\n@example 0, 'x', 'x.value.nested.1.thing', 'x[2].also.nested', null, d => Math.sin(d)"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"name": "y",
|
|
710
|
+
"type": "number | string | Function | string[]",
|
|
711
|
+
"description": "The y prop specifies how to access the Y value of each data point.\nIf given as a function, it will be run on each data point, and returned value will be used.\nIf given as an integer, it will be used as an array index for array-type data points.\nIf given as a string, it will be used as a property key for object-type data points.\nIf given as an array of strings, or a string containing dots or brackets,\nit will be used as a nested object property path (for details see Lodash docs for _.get).\nIf `null` or `undefined`, the data value will be used as is (identity function/pass-through).\n\n\n@example 0, 'y', 'y.value.nested.1.thing', 'y[2].also.nested', null, d => Math.sin(d)"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"name": "y0",
|
|
715
|
+
"type": "number | string | Function | string[]",
|
|
716
|
+
"description": "Use y0 data accessor prop to determine how the component defines the baseline y0 data.\nThis prop is useful for defining custom baselines for components like ChartBoxPlot.\nThis prop may be given in a variety of formats.\n\n\n@example 'last_quarter_profit', () => 10, 1, 'employees.salary', [\"employees\", \"salary\"]"
|
|
717
|
+
}
|
|
718
|
+
]
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"name": "ChartCursorFlyout",
|
|
722
|
+
"description": "",
|
|
723
|
+
"props": [
|
|
724
|
+
{
|
|
725
|
+
"name": "center",
|
|
726
|
+
"type": "{\n x: number;\n y: number;\n}",
|
|
727
|
+
"description": ""
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "cornerRadius",
|
|
731
|
+
"type": "number",
|
|
732
|
+
"description": ""
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"name": "datum",
|
|
736
|
+
"type": "object",
|
|
737
|
+
"description": ""
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"name": "dx",
|
|
741
|
+
"type": "number",
|
|
742
|
+
"description": ""
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
"name": "dy",
|
|
746
|
+
"type": "number",
|
|
747
|
+
"description": ""
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"name": "height",
|
|
751
|
+
"type": "number",
|
|
752
|
+
"description": ""
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"name": "orientation",
|
|
756
|
+
"type": "OrientationTypes",
|
|
757
|
+
"description": ""
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"name": "pathComponent",
|
|
761
|
+
"type": "React.ReactElement<any>",
|
|
762
|
+
"description": ""
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"name": "pointerLength",
|
|
766
|
+
"type": "number",
|
|
767
|
+
"description": ""
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "pointerWidth",
|
|
771
|
+
"type": "number",
|
|
772
|
+
"description": ""
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "width",
|
|
776
|
+
"type": "number",
|
|
777
|
+
"description": ""
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"name": "x",
|
|
781
|
+
"type": "number",
|
|
782
|
+
"description": ""
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
"name": "y",
|
|
786
|
+
"type": "number",
|
|
787
|
+
"description": ""
|
|
788
|
+
}
|
|
789
|
+
]
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"name": "ChartCursorTooltip",
|
|
793
|
+
"description": "This tooltip has default values intended for use with a cursor container.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-tooltip/src/index.d.ts",
|
|
794
|
+
"props": [
|
|
795
|
+
{
|
|
796
|
+
"name": "activateData",
|
|
797
|
+
"type": "boolean",
|
|
798
|
+
"description": "When true, tooltip events will set the active prop on both data and label elements."
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"name": "active",
|
|
802
|
+
"type": "boolean",
|
|
803
|
+
"description": "The active prop specifies whether the tooltip component should be displayed."
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"name": "angle",
|
|
807
|
+
"type": "number",
|
|
808
|
+
"description": "The angle prop specifies the angle to rotate the tooltip around its origin point."
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"name": "center",
|
|
812
|
+
"type": "{ x: number; y: number }",
|
|
813
|
+
"description": "The center prop determines the position of the center of the tooltip flyout. This prop should be given as an object\nthat describes the desired x and y svg coordinates of the center of the tooltip. This prop is useful for\npositioning the flyout of a tooltip independent from the pointer. When ChartTooltip is used with\nChartVoronoiContainer, the center prop is what enables the mouseFollowTooltips option. When this prop is set,\nnon-zero pointerLength values will no longer be respected."
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"name": "centerOffset",
|
|
817
|
+
"type": "{ x: number | Function, y: number | Function }",
|
|
818
|
+
"description": "The centerOffset prop determines the position of the center of the tooltip flyout in relation to the flyout\npointer. This prop should be given as an object of x and y, where each is either a numeric offset value or a\nfunction that returns a numeric value. When this prop is set, non-zero pointerLength values will no longer be\nrespected.",
|
|
819
|
+
"defaultValue": "getCursorTooltipCenterOffset({ offsetCursorDimensionX: true, theme })"
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"name": "constrainToVisibleArea",
|
|
823
|
+
"type": "boolean",
|
|
824
|
+
"description": "The constrainToVisibleArea prop determines whether to coerce tooltips so that they fit within the visible area of\nthe chart. When this prop is set to true, tooltip pointers will still point to the correct data point, but the\ncenter of the tooltip will be shifted to fit within the overall width and height of the svg Victory renders.",
|
|
825
|
+
"defaultValue": "true"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"name": "cornerRadius",
|
|
829
|
+
"type": "number | Function",
|
|
830
|
+
"description": "The cornerRadius prop determines corner radius of the flyout container. This prop may be given as a positive number\nor a function of datum."
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"name": "data",
|
|
834
|
+
"type": "any[]",
|
|
835
|
+
"description": "Victory components can pass a data prop to their label component. This can be useful in custom components that need\nto make use of the entire dataset."
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"name": "datum",
|
|
839
|
+
"type": "{}",
|
|
840
|
+
"description": "Victory components can pass a datum prop to their label component. This can be used to calculate functional styles,\nand determine text."
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"name": "dx",
|
|
844
|
+
"type": "number | Function",
|
|
845
|
+
"description": "The dx prop defines a horizontal shift from the x coordinate."
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"name": "dy",
|
|
849
|
+
"type": "number | Function",
|
|
850
|
+
"description": "The dy prop defines a vertical shift from the y coordinate."
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
"name": "events",
|
|
854
|
+
"type": "object",
|
|
855
|
+
"description": "The events prop attaches arbitrary event handlers to the label component. This prop should be given as an object of\nevent names and corresponding event handlers. When events are provided via Victory’s event system, event handlers\nwill be called with the event, the props of the component is attached to, and an eventKey.\n\n\n@example events={{onClick: (evt) => alert(\"x: \" + evt.clientX)}}"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"name": "flyoutComponent",
|
|
859
|
+
"type": "React.ReactElement<any>",
|
|
860
|
+
"description": "The flyoutComponent prop takes a component instance which will be used to create the flyout path for each tooltip.\nThe new element created from the passed flyoutComponent will be supplied with the following properties: x, y, dx, dy,\nindex, datum, cornerRadius, pointerLength, pointerWidth, width, height, orientation, style, and events.\nAny of these props may be overridden by passing in props to the supplied component, or modified or ignored within\nthe custom component itself. If flyoutComponent is omitted, a default Flyout component will be created with props\ndescribed above.\n\n@example flyoutComponent={<Flyout x={50} y={50}/>}, flyoutComponent={<MyCustomFlyout/>}",
|
|
861
|
+
"defaultValue": "<ChartCursorFlyout />"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"name": "flyoutHeight",
|
|
865
|
+
"type": "number | Function",
|
|
866
|
+
"description": "The flyoutHeight prop defines the height of the tooltip flyout. This prop may be given as a positive number or a function\nof datum. If this prop is not set, height will be determined based on an approximate text size calculated from the\ntext and style props provided to ChartTooltip."
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"name": "flyoutStyle",
|
|
870
|
+
"type": "number | Function",
|
|
871
|
+
"description": "The style prop applies SVG style properties to the rendered flyout container. These props will be passed to the\nflyoutComponent."
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"name": "flyoutWidth",
|
|
875
|
+
"type": "number | Function",
|
|
876
|
+
"description": "The flyoutWidth prop defines the width of the tooltip flyout. This prop may be given as a positive number or a\nfunction of datum. If this prop is not set, flyoutWidth will be determined based on an approximate text size\ncalculated from the text and style props provided to VictoryTooltip."
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"name": "groupComponent",
|
|
880
|
+
"type": "React.ReactElement<any>",
|
|
881
|
+
"description": "The groupComponent prop takes a component instance which will be used to create group elements for use within\ncontainer elements. This prop defaults to a <g> tag.}"
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"name": "horizontal",
|
|
885
|
+
"type": "boolean",
|
|
886
|
+
"description": "The horizontal prop determines whether to plot the flyouts to the left / right of the (x, y) coordinate rather than top / bottom.\nThis is useful when an orientation prop is not provided, and data will determine the default orientation. i.e.\nnegative values result in a left orientation and positive values will result in a right orientation by default."
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"name": "index",
|
|
890
|
+
"type": "number | string",
|
|
891
|
+
"description": "The index prop represents the index of the datum in the data array."
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
"name": "labelComponent",
|
|
895
|
+
"type": "React.ReactElement<any>",
|
|
896
|
+
"description": "The labelComponent prop takes a component instance which will be used to render each tooltip label. The new element\ncreated from the passed labelComponent will be supplied with the following properties: x, y, index, datum,\nverticalAnchor, textAnchor, style, text, and events. Any of these props may be overridden by passing in props to\nthe supplied component, or modified or ignored within the custom component itself. If labelComponent is omitted, a\nnew ChartLabel will be created with the props described above.\n\n@example labelComponent={<ChartLabel dy={20}/>}, labelComponent={<MyCustomLabel/>}"
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
"name": "labelTextAnchor",
|
|
900
|
+
"type": "string | Function",
|
|
901
|
+
"description": "Defines how the labelComponent text is horizontally positioned relative to its `x` and `y` coordinates. Valid\nvalues are 'start', 'middle', 'end', and 'inherit'.",
|
|
902
|
+
"defaultValue": "'start'"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"name": "orientation",
|
|
906
|
+
"type": "string | Function",
|
|
907
|
+
"description": "The orientation prop determines which side of the (x, y) coordinate the tooltip should be rendered on.\nThis prop can be given as “top”, “bottom”, “left”, “right”, or as a function of datum that returns one of these\nvalues. If this prop is not provided it will be determined from the sign of the datum, and the value of the\nhorizontal prop."
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"name": "pointerLength",
|
|
911
|
+
"type": "number | Function",
|
|
912
|
+
"description": "The pointerLength prop determines the length of the triangular pointer extending from the flyout. This prop may be\ngiven as a positive number or a function of datum.",
|
|
913
|
+
"defaultValue": "showPointer && theme && theme.tooltip ? theme.tooltip.pointerLength : 0"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"name": "pointerOrientation",
|
|
917
|
+
"type": "string | Function",
|
|
918
|
+
"description": "This prop determines which side of the tooltip flyout the pointer should originate on. When this prop is not set,\nit will be determined based on the overall orientation of the flyout in relation to its data point, and any center\nor centerOffset values. Valid values are 'top', 'bottom', 'left' and 'right.",
|
|
919
|
+
"defaultValue": "getCursorTooltipPoniterOrientation({ horizontal: true, theme })"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"name": "pointerWidth",
|
|
923
|
+
"type": "number | Function",
|
|
924
|
+
"description": "The pointerWidth prop determines the width of the base of the triangular pointer extending from\nthe flyout. This prop may be given as a positive number or a function of datum.",
|
|
925
|
+
"defaultValue": "(theme.tooltip as any).pointerWidth"
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"name": "renderInPortal",
|
|
929
|
+
"type": "boolean",
|
|
930
|
+
"description": "When renderInPortal is true, rendered tooltips will be wrapped in VictoryPortal and rendered within the Portal element\nwithin ChartContainer. Note: This prop should not be set to true when using a custom container element."
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
"name": "showPointer",
|
|
934
|
+
"type": "boolean",
|
|
935
|
+
"description": "Flag to force flyout pointer to be shown. Victory provides pointerLength=0 when using a voronoi container with\nvoronoiDimension=\"x\"",
|
|
936
|
+
"defaultValue": "true"
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
"name": "style",
|
|
940
|
+
"type": "React.CSSProperties | React.CSSProperties[]",
|
|
941
|
+
"description": "The style prop applies CSS properties to the rendered `<text>` element."
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"name": "text",
|
|
945
|
+
"type": "number | string | Function | string[] | number[]",
|
|
946
|
+
"description": "The text prop defines the text ChartTooltip will render. The text prop may be given as a string, number, or\nfunction of datum. When ChartLabel is used as the labelComponent, strings may include newline characters, which\nChartLabel will split in to separate <tspan/> elements."
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
"name": "theme",
|
|
950
|
+
"type": "object",
|
|
951
|
+
"description": "The theme prop specifies a theme to use for determining styles and layout properties for a component. Any styles or\nprops defined in theme may be overwritten by props specified on the component instance.",
|
|
952
|
+
"defaultValue": "getTheme(themeColor)"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "themeColor",
|
|
956
|
+
"type": "string",
|
|
957
|
+
"description": "Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc.\n\nNote: Not compatible with theme prop\n\n@example themeColor={ChartThemeColor.blue}"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"name": "x",
|
|
961
|
+
"type": "number",
|
|
962
|
+
"description": "The x prop defines the x coordinate to use as a basis for horizontal positioning."
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
"name": "y",
|
|
966
|
+
"type": "number",
|
|
967
|
+
"description": "The y prop defines the y coordinate to use as a basis for vertical positioning."
|
|
968
|
+
}
|
|
969
|
+
]
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"name": "ChartVoronoiContainer",
|
|
973
|
+
"description": "ChartVoronoiContainer adds the ability to associate a mouse position with the data point(s) closest to it. When this\ncontainer is added to a chart, changes in mouse position will add the active prop to data and label components\nclosest to the current mouse position. The closeness of data points to a given position is determined by calculating\na voronoi diagram based on the data of every child VictoryVoronoiContainer renders. This container is useful for\nadding hover interactions, like tooltips, to small data points, or charts with dense or overlapping data.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-voronoi-container/src/index.d.ts",
|
|
974
|
+
"props": [
|
|
975
|
+
{
|
|
976
|
+
"name": "activateData",
|
|
977
|
+
"type": "boolean",
|
|
978
|
+
"description": "When the activateData prop is set to true, the active prop will be set to true on all\ndata components within a voronoi area. When this prop is set to false, the onActivated\nand onDeactivated callbacks will still fire, but no mutations to data components will\noccur via Victory’s event system."
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
"name": "activateLabels",
|
|
982
|
+
"type": "boolean",
|
|
983
|
+
"description": "When the activateLabels prop is set to true, the active prop will be set to true on all\nlabels corresponding to points within a voronoi area. When this prop is set to false,\nthe onActivated and onDeactivated callbacks will still fire, but no mutations to label\ncomponents will occur via Victory’s event system. Labels defined directly on\nChartVoronoiContainer via the labels prop will still appear when this prop is set to false."
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"name": "className",
|
|
987
|
+
"type": "string",
|
|
988
|
+
"description": "The className prop specifies a className that will be applied to the outermost div rendered by the container"
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
"name": "constrainToVisibleArea",
|
|
992
|
+
"type": "boolean",
|
|
993
|
+
"description": "The constrainToVisibleArea prop determines whether to coerce tooltips so that they fit within the visible area of\nthe chart. When this prop is set to true, tooltip pointers will still point to the correct data point, but the\ncenter of the tooltip will be shifted to fit within the overall width and height of the svg Victory renders.",
|
|
994
|
+
"defaultValue": "false"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"name": "containerId",
|
|
998
|
+
"type": "number | string",
|
|
999
|
+
"description": "The containerId prop may be used to set a deterministic id for the container. When a containerId is not manually\nset, a unique id will be generated. It is usually necessary to set deterministic ids for automated testing."
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"name": "desc",
|
|
1003
|
+
"type": "string",
|
|
1004
|
+
"description": "The desc prop specifies the description of the chart/SVG to assist with\naccessibility for screen readers. The more info about the chart provided in\nthe description, the more usable it will be for people using screen readers.\nThis prop defaults to an empty string.\n\n@example \"Golden retrievers make up 30%, Labs make up 25%, and other dog breeds are\nnot represented above 5% each.\""
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"name": "disable",
|
|
1008
|
+
"type": "boolean",
|
|
1009
|
+
"description": "When the disable prop is set to true, ChartVoronoiContainer events will not fire."
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
"name": "events",
|
|
1013
|
+
"type": "React.DOMAttributes<any>",
|
|
1014
|
+
"description": "The events prop attaches arbitrary event handlers to the container component.\nEvent handlers passed from other Victory components are called with their\ncorresponding events as well as scale, style, width, height, and data when\napplicable. Use the invert method to convert event coordinate information to\ndata. `scale.x.invert(evt.offsetX)`.\n\n@example {onClick: (evt) => alert(`x: ${evt.clientX}, y: ${evt.clientY}`)}"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
"name": "height",
|
|
1018
|
+
"type": "number",
|
|
1019
|
+
"description": "The height props specifies the height the svg viewBox of the container.\nThis value should be given as a number of pixels. If no height prop\nis given, the height prop from the child component passed will be used."
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"name": "labelComponent",
|
|
1023
|
+
"type": "React.ReactElement<any>",
|
|
1024
|
+
"description": "The labelComponent prop specified the component that will be rendered when labels are defined\non ChartVoronoiContainer. If the labels prop is omitted, no label component will be rendered.",
|
|
1025
|
+
"defaultValue": "<ChartTooltip />"
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
"name": "labels",
|
|
1029
|
+
"type": "(point: any, index: number, points: any[]) => string",
|
|
1030
|
+
"description": "When a labels prop is provided to ChartVoronoiContainer it will render a label component\nrather than activating labels on the child components it renders. This is useful for\ncreating multi- point tooltips. This prop should be given as a function which will be called\nonce for each active point. The labels function will be called with the arguments point,\nindex, and points, where point refers to a single active point, index refers to the position\nof that point in the array of active points, and points is an array of all active points."
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
"name": "mouseFollowTooltips",
|
|
1034
|
+
"type": "boolean",
|
|
1035
|
+
"description": "When the mouseFollowTooltip prop is set on ChartVoronoiContainer, The position of the center of the tooltip\nfollows the position of the mouse."
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
"name": "name",
|
|
1039
|
+
"type": "string",
|
|
1040
|
+
"description": "The name prop is used to reference a component instance when defining shared events."
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"name": "onActivated",
|
|
1044
|
+
"type": "Function",
|
|
1045
|
+
"description": "The onActivated prop accepts a function to be called whenever new data points are activated.\nThe function is called with the parameters points (an array of active data objects) and props\n(the props used by ChartVoronoiContainer)."
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
"name": "onDeactivated",
|
|
1049
|
+
"type": "Function",
|
|
1050
|
+
"description": "The onDeactivated prop accepts a function to be called whenever points are deactivated. The\nfunction is called with the parameters points (an array of the newly-deactivated data objects)\nand props (the props used by ChartVoronoiContainer)."
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
"name": "origin",
|
|
1054
|
+
"type": "{ x: number, y: number }",
|
|
1055
|
+
"description": "Victory components will pass an origin prop is to define the center point in svg coordinates for polar charts.\n\nNote: It will not typically be necessary to set an origin prop manually"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"name": "portalComponent",
|
|
1059
|
+
"type": "React.ReactElement<any>",
|
|
1060
|
+
"description": "The portalComponent prop takes a component instance which will be used as a container for children that should\nrender inside a top-level container so that they will always appear above other elements. ChartTooltip renders\ninside a portal so that tooltips always render above data. VictoryPortal is used to define elements that should\nrender in the portal container. This prop defaults to Portal, and should only be overridden when changing rendered\nelements from SVG to another type of element e.g., react-native-svg elements."
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
"name": "portalZIndex",
|
|
1064
|
+
"type": "number",
|
|
1065
|
+
"description": "The portalZIndex prop determines the z-index of the div enclosing the portal component. If a portalZIndex prop is\nnot set, the z-index of the enclosing div will be set to 99."
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
"name": "radius",
|
|
1069
|
+
"type": "number",
|
|
1070
|
+
"description": "When the radius prop is set, the voronoi areas associated with each data point will be no larger\nthan the given radius. This prop should be given as a number."
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"name": "responsive",
|
|
1074
|
+
"type": "boolean",
|
|
1075
|
+
"description": "The responsive prop specifies whether the rendered container should be a responsive container\nwith a viewBox attribute, or a static container with absolute width and height.\n\n@default true"
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
"name": "style",
|
|
1079
|
+
"type": "React.CSSProperties",
|
|
1080
|
+
"description": "The style prop specifies styles for your ChartContainer. Any valid inline style properties\nwill be applied. Height and width should be specified via the height\nand width props, as they are used to calculate the alignment of\ncomponents within the container. Styles from the child component will\nalso be passed, if any exist.\n\n@example {border: 1px solid red}"
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"name": "tabIndex",
|
|
1084
|
+
"type": "number",
|
|
1085
|
+
"description": "The tabIndex prop specifies the description of the chart/SVG to assist with accessibility."
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"name": "theme",
|
|
1089
|
+
"type": "object",
|
|
1090
|
+
"description": "The theme prop specifies a theme to use for determining styles and layout properties for a component. Any styles or\nprops defined in theme may be overwritten by props specified on the component instance.",
|
|
1091
|
+
"defaultValue": "getTheme(themeColor)"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
"name": "themeColor",
|
|
1095
|
+
"type": "string",
|
|
1096
|
+
"description": "Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc.\n\nNote: Not compatible with theme prop\n\n@example themeColor={ChartThemeColor.blue}"
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
"name": "voronoiBlacklist",
|
|
1100
|
+
"type": "string[]",
|
|
1101
|
+
"description": "The voronoiBlacklist prop is used to specify a list of components to ignore when calculating a\nshared voronoi diagram. Components with a name prop matching an element in the voronoiBlacklist\narray will be ignored by ChartVoronoiContainer. Ignored components will never be flagged as\nactive, and will not contribute date to shared tooltips or labels."
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"name": "voronoiDimension",
|
|
1105
|
+
"type": "'x' | 'y'",
|
|
1106
|
+
"description": "When the voronoiDimension prop is set, voronoi selection will only take the given dimension into\naccount. For example, when dimension is set to “x”, all data points matching a particular x mouse\nposition will be activated regardless of y value. When this prop is not given, voronoi selection\nis determined by both x any y values."
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"name": "voronoiPadding",
|
|
1110
|
+
"type": "number",
|
|
1111
|
+
"description": "When the voronoiPadding prop is given, the area of the chart that will trigger voronoi events is\nreduced by the given padding on every side. By default, no padding is applied, and the entire range\nof a given chart may trigger voronoi events. This prop should be given as a number."
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
"name": "width",
|
|
1115
|
+
"type": "number",
|
|
1116
|
+
"description": "The width props specifies the width of the svg viewBox of the container\nThis value should be given as a number of pixels. If no width prop\nis given, the width prop from the child component passed will be used."
|
|
1117
|
+
}
|
|
1118
|
+
]
|
|
1119
|
+
}
|
|
1120
|
+
],
|
|
1121
|
+
"examples": [
|
|
1122
|
+
"Basic with right aligned legend",
|
|
1123
|
+
"Labels with bottom aligned legend",
|
|
1124
|
+
"Embedded legend",
|
|
1125
|
+
"Embedded HTML"
|
|
1126
|
+
]
|
|
1127
|
+
};
|
|
1128
|
+
pageData.liveContext = {
|
|
1129
|
+
Chart,
|
|
1130
|
+
ChartAxis,
|
|
1131
|
+
ChartBoxPlot,
|
|
1132
|
+
ChartCursorFlyout,
|
|
1133
|
+
ChartCursorTooltip,
|
|
1134
|
+
ChartLegendTooltip,
|
|
1135
|
+
ChartThemeColor,
|
|
1136
|
+
ChartThreshold,
|
|
1137
|
+
ChartVoronoiContainer,
|
|
1138
|
+
createContainer,
|
|
1139
|
+
VictoryZoomContainer,
|
|
1140
|
+
chart_color_orange_300
|
|
1141
|
+
};
|
|
1142
|
+
pageData.examples = {
|
|
1143
|
+
'Basic with right aligned legend': props =>
|
|
1144
|
+
<Example {...pageData} {...props} {...{"code":"import { Chart, ChartAxis, ChartBoxPlot, ChartThemeColor } from '@patternfly/react-charts/victory';\n\ninterface PetData {\n name: string;\n x: string;\n y: number[];\n}\n\nexport const ChartBoxPlotRightAlignedLegend: React.FunctionComponent = () => {\n const catsData: PetData[] = [\n { name: 'Cats', x: '2015', y: [1, 2, 3, 5] },\n { name: 'Cats', x: '2016', y: [3, 2, 8, 10] },\n { name: 'Cats', x: '2017', y: [2, 8, 6, 5] },\n { name: 'Cats', x: '2018', y: [1, 3, 2, 9] }\n ];\n\n const legendData = [{ name: 'Cats' }];\n return (\n <div style={{ height: '300px', width: '750px' }}>\n <Chart\n ariaDesc=\"Average number of pets\"\n ariaTitle=\"Bar chart example\"\n domain={{ y: [0, 12] }}\n domainPadding={{ x: [30, 25] }}\n legendData={legendData}\n legendOrientation=\"vertical\"\n legendPosition=\"right\"\n height={300}\n name=\"chart3\"\n padding={{\n bottom: 50,\n left: 50,\n right: 200, // Adjusted to accommodate legend\n top: 50\n }}\n themeColor={ChartThemeColor.blue}\n width={750}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartBoxPlot data={catsData} />\n </Chart>\n </div>\n );\n};\n","title":"Basic with right aligned legend","lang":"ts","className":""}}>
|
|
1145
|
+
|
|
1146
|
+
</Example>,
|
|
1147
|
+
'Labels with bottom aligned legend': props =>
|
|
1148
|
+
<Example {...pageData} {...props} {...{"code":"import { Chart, ChartAxis, ChartBoxPlot, ChartThemeColor } from '@patternfly/react-charts/victory';\n\ninterface PetData {\n name: string;\n x: string;\n y: number[];\n}\n\nexport const ChartBoxPlotLabelsLegend: React.FunctionComponent = () => {\n const catsData: PetData[] = [\n { name: 'Cats', x: '2015', y: [1, 2, 3, 5] },\n { name: 'Cats', x: '2016', y: [3, 2, 8, 10] },\n { name: 'Cats', x: '2017', y: [2, 8, 6, 5] },\n { name: 'Cats', x: '2018', y: [1, 3, 2, 9] }\n ];\n const legendData = [{ name: 'Cats' }];\n return (\n <div style={{ height: '300px', width: '600px' }}>\n <Chart\n ariaDesc=\"Average number of pets\"\n ariaTitle=\"Bar chart example\"\n domain={{ y: [0, 12] }}\n domainPadding={{ x: [30, 25] }}\n legendData={legendData}\n legendPosition=\"bottom\"\n height={300}\n name=\"chart2\"\n padding={{\n bottom: 75, // Adjusted to accommodate legend\n left: 50,\n right: 50,\n top: 50\n }}\n themeColor={ChartThemeColor.yellow}\n width={600}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartBoxPlot\n data={catsData}\n labelOrientation={{\n min: 'right',\n max: 'right'\n }}\n maxLabels\n minLabels\n />\n </Chart>\n </div>\n );\n};\n","title":"Labels with bottom aligned legend","lang":"ts","className":""}}>
|
|
1149
|
+
|
|
1150
|
+
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
1151
|
+
{`This demonstrates how to display labels.`}
|
|
1152
|
+
</p>
|
|
1153
|
+
</Example>,
|
|
1154
|
+
'Embedded legend': props =>
|
|
1155
|
+
<Example {...pageData} {...props} {...{"code":"import {\n Chart,\n ChartAxis,\n ChartBoxPlot,\n ChartLegendTooltip,\n ChartThemeColor,\n ChartThreshold,\n createContainer\n} from '@patternfly/react-charts/victory';\nimport chart_color_orange_300 from '@patternfly/react-tokens/dist/esm/chart_color_orange_300';\n\ninterface Data {\n name: string;\n x: string;\n y: number[] | number;\n}\n\nexport const ChartBoxPlotEmbeddedLegend: React.FunctionComponent = () => {\n const catsData: Data[] = [\n { name: 'Cats', x: '2015', y: [null] },\n { name: 'Cats', x: '2016', y: [3, 2, 8, 10] },\n { name: 'Cats', x: '2017', y: [2, 8, 6, 5] },\n { name: 'Cats', x: '2018', y: [1, 3, 2, 9] }\n ];\n\n // Note: Container order is important\n const CursorVoronoiContainer = createContainer('voronoi', 'cursor');\n const limitData: Data[] = [\n { name: 'Limit', x: '2015', y: 12 },\n { name: 'Limit', x: '2016', y: 12 },\n { name: 'Limit', x: '2017', y: 12 },\n { name: 'Limit', x: '2018', y: 12 }\n ];\n const legendData = [\n {\n childName: 'limit',\n name: 'Limit',\n symbol: { fill: chart_color_orange_300.var, type: 'threshold' }\n },\n { childName: 'cats', name: 'Cats' },\n // Force extra space below for line wrapping\n {\n childName: 'cats',\n name: '',\n symbol: { fill: 'none' }\n },\n {\n childName: 'cats',\n name: '',\n symbol: { fill: 'none' }\n }\n ];\n const labelFormatter = (datum) => {\n // With box plot data, datum.y will also be an array\n if (datum && (datum._min || datum._median || datum._max || datum._q1 || datum._q3)) {\n return `Min: ${datum._min}, Max: ${datum._max}\\nMedian: ${datum._median}\\nQ1: ${datum._q1}, Q3: ${datum._q3}`;\n }\n const yVal = Array.isArray(datum.y) ? datum.y[0] : datum.y;\n return yVal !== null ? yVal : 'no data';\n };\n return (\n <div style={{ height: '350px', width: '600px' }}>\n <Chart\n ariaDesc=\"Average number of pets - possibly more information to summarize the data in the chart.\"\n ariaTitle=\"Embedded legend example chart title\"\n containerComponent={\n <CursorVoronoiContainer\n cursorDimension=\"x\"\n labels={({ datum }) => labelFormatter(datum)}\n labelComponent={<ChartLegendTooltip legendData={legendData} title={(datum) => datum.x} />}\n mouseFollowTooltips\n voronoiDimension=\"x\"\n voronoiPadding={50}\n />\n }\n domain={{ y: [0, 13] }}\n domainPadding={{ x: [30, 25] }}\n legendData={legendData}\n legendPosition=\"bottom\"\n height={350}\n name=\"chart5\"\n padding={{\n bottom: 75, // Adjusted to accommodate legend\n left: 50,\n right: 50,\n top: 50\n }}\n themeColor={ChartThemeColor.green}\n width={600}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartThreshold\n data={limitData}\n name=\"limit\"\n style={{\n data: {\n stroke: chart_color_orange_300.var\n }\n }}\n />\n <ChartBoxPlot data={catsData} name=\"cats\" />\n </Chart>\n </div>\n );\n};\n","title":"Embedded legend","lang":"ts","className":""}}>
|
|
1156
|
+
|
|
1157
|
+
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
1158
|
+
{`This demonstrates how to embed a legend within a tooltip. Combining cursor and voronoi containers is required to display tooltips with a vertical cursor.`}
|
|
1159
|
+
</p>
|
|
1160
|
+
</Example>,
|
|
1161
|
+
'Embedded HTML': props =>
|
|
1162
|
+
<Example {...pageData} {...props} {...{"code":"import {\n Chart,\n ChartAxis,\n ChartBoxPlot,\n ChartCursorTooltip,\n ChartThemeColor,\n createContainer\n} from '@patternfly/react-charts/victory';\n\ninterface PetData {\n name: string;\n x: string;\n y: number[] | number;\n}\n\nexport const ChartBoxPlotEmbeddedHtml: React.FunctionComponent = () => {\n const baseStyles = {\n color: '#f0f0f0',\n fontFamily:\n '\"Red Hat Text\", \"RedHatText\", \"Noto Sans Arabic\", \"Noto Sans Hebrew\", \"Noto Sans JP\", \"Noto Sans KR\", \"Noto Sans Malayalam\", \"Noto Sans SC\", \"Noto Sans TC\", \"Noto Sans Thai\", Helvetica, Arial, sans-serif',\n fontSize: '14px'\n };\n const leftColumn = {\n paddingLeft: '10px',\n width: '50%'\n };\n const rightColumn = {\n paddingRight: '20px',\n textAlign: 'right',\n width: '50%'\n };\n\n // Note: Container order is important\n const CursorVoronoiContainer = createContainer('voronoi', 'cursor');\n const catsData: PetData[] = [\n { name: 'Cats', x: '2015', y: [1, 2, 3, 5] },\n { name: 'Cats', x: '2016', y: [3, 2, 8, 10] },\n { name: 'Cats', x: '2017', y: [2, 8, 6, 5] },\n { name: 'Cats', x: '2018', y: [1, 3, 2, 9] }\n ];\n const legendData = [{ name: 'Cats' }];\n\n // Custom HTML component to create a legend layout\n const HtmlLegendContent = ({ datum, _text, title, x, y, ..._rest }) => (\n <g>\n <foreignObject height=\"100%\" width=\"100%\" x={x - 30} y={y - 62}>\n <table>\n <thead>\n <tr>\n <th colSpan={2} style={{ ...baseStyles, ...leftColumn, fontWeight: 700 }}>\n {title(datum)}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr style={baseStyles}>\n <td style={leftColumn}>Max</td>\n <td style={rightColumn}>{datum._max}</td>\n </tr>\n <tr style={baseStyles}>\n <td style={leftColumn}>Median</td>\n <td style={rightColumn}>{datum._median}</td>\n </tr>\n <tr style={baseStyles}>\n <td style={leftColumn}>Min</td>\n <td style={rightColumn}>{datum._min}</td>\n </tr>\n <tr style={baseStyles}>\n <td style={leftColumn}>Q1</td>\n <td style={rightColumn}>{datum._q1}</td>\n </tr>\n <tr style={baseStyles}>\n <td style={leftColumn}>Q3</td>\n <td style={rightColumn}>{datum._q3}</td>\n </tr>\n </tbody>\n </table>\n </foreignObject>\n </g>\n );\n\n return (\n <div style={{ height: '300px', width: '600px' }}>\n <Chart\n ariaDesc=\"Average number of pets - possibly more information to summarize the data in the chart.\"\n ariaTitle=\"Embedded html example chart title\"\n containerComponent={\n <CursorVoronoiContainer\n cursorDimension=\"x\"\n labels={({ datum }) => `${datum.y}`}\n labelComponent={\n <ChartCursorTooltip\n flyoutHeight={145}\n flyoutWidth={110}\n labelComponent={<HtmlLegendContent title={(datum) => datum.x} />}\n />\n }\n mouseFollowTooltips\n voronoiDimension=\"x\"\n voronoiPadding={50}\n />\n }\n domain={{ y: [0, 12] }}\n domainPadding={{ x: [30, 25] }}\n legendData={legendData}\n legendPosition=\"bottom\"\n height={300}\n name=\"chart4\"\n padding={{\n bottom: 75, // Adjusted to accommodate legend\n left: 50,\n right: 50,\n top: 50\n }}\n maxDomain={{ y: 9 }}\n themeColor={ChartThemeColor.orange}\n width={600}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartBoxPlot data={catsData} />\n </Chart>\n </div>\n );\n};\n","title":"Embedded HTML","lang":"ts","className":""}}>
|
|
1163
|
+
|
|
1164
|
+
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
1165
|
+
{`This demonstrates how to embed HTML within a tooltip. Combining cursor and voronoi containers is required to display tooltips with a vertical cursor.`}
|
|
1166
|
+
</p>
|
|
1167
|
+
</Example>
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
const Component = () => (
|
|
1171
|
+
<React.Fragment>
|
|
1172
|
+
<AutoLinkHeader {...{"id":"introduction","headingLevel":"h2","className":"ws-title ws-h2"}}>
|
|
1173
|
+
{`Introduction`}
|
|
1174
|
+
</AutoLinkHeader>
|
|
1175
|
+
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
1176
|
+
{`Note: PatternFly React charts live in its own package at `}
|
|
1177
|
+
<PatternflyThemeLink {...{"to":"https://www.npmjs.com/package/@patternfly/react-charts","className":""}}>
|
|
1178
|
+
{`@patternfly/react-charts`}
|
|
1179
|
+
</PatternflyThemeLink>
|
|
1180
|
+
{`!`}
|
|
1181
|
+
</p>
|
|
1182
|
+
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
1183
|
+
{`The examples below are based on the `}
|
|
1184
|
+
<PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-chart/","className":""}}>
|
|
1185
|
+
{`Victory`}
|
|
1186
|
+
</PatternflyThemeLink>
|
|
1187
|
+
{` chart library, along with additional functionality, custom components, and theming for PatternFly. This provides a collection of React based components you can use to build PatternFly patterns with consistent markup, styling, and behavior.`}
|
|
1188
|
+
</p>
|
|
1189
|
+
<AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
|
|
1190
|
+
{`Examples`}
|
|
1191
|
+
</AutoLinkHeader>
|
|
1192
|
+
{React.createElement(pageData.examples["Basic with right aligned legend"])}
|
|
1193
|
+
{React.createElement(pageData.examples["Labels with bottom aligned legend"])}
|
|
1194
|
+
{React.createElement(pageData.examples["Embedded legend"])}
|
|
1195
|
+
{React.createElement(pageData.examples["Embedded HTML"])}
|
|
1196
|
+
<AutoLinkHeader {...{"id":"documentation","headingLevel":"h2","className":"ws-title ws-h2"}}>
|
|
1197
|
+
{`Documentation`}
|
|
1198
|
+
</AutoLinkHeader>
|
|
1199
|
+
<AutoLinkHeader {...{"id":"tips","headingLevel":"h3","className":"ws-title ws-h3"}}>
|
|
1200
|
+
{`Tips`}
|
|
1201
|
+
</AutoLinkHeader>
|
|
1202
|
+
<ul {...{"className":"pf-v6-c-content--ul pf-m-editorial ws-ul "}}>
|
|
1203
|
+
<li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
|
|
1204
|
+
{`See Victory's `}
|
|
1205
|
+
<PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/faq","className":""}}>
|
|
1206
|
+
{`FAQ`}
|
|
1207
|
+
</PatternflyThemeLink>
|
|
1208
|
+
</li>
|
|
1209
|
+
<li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
|
|
1210
|
+
{`For single data points or zero values, you may want to set the `}
|
|
1211
|
+
<code {...{"className":"ws-code "}}>
|
|
1212
|
+
{`domain`}
|
|
1213
|
+
</code>
|
|
1214
|
+
{` prop`}
|
|
1215
|
+
</li>
|
|
1216
|
+
<li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
|
|
1217
|
+
{`The `}
|
|
1218
|
+
<code {...{"className":"ws-code "}}>
|
|
1219
|
+
{`theme`}
|
|
1220
|
+
</code>
|
|
1221
|
+
{` and `}
|
|
1222
|
+
<code {...{"className":"ws-code "}}>
|
|
1223
|
+
{`themeColor`}
|
|
1224
|
+
</code>
|
|
1225
|
+
{` props should be applied at the most top level component`}
|
|
1226
|
+
</li>
|
|
1227
|
+
</ul>
|
|
1228
|
+
<AutoLinkHeader {...{"id":"note","headingLevel":"h3","className":"ws-title ws-h3"}}>
|
|
1229
|
+
{`Note`}
|
|
1230
|
+
</AutoLinkHeader>
|
|
1231
|
+
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
|
|
1232
|
+
{`Currently, the generated documentation below is not able to resolve type definitions from Victory imports. For the
|
|
1233
|
+
components used in the examples above, Victory pass-thru props are also documented here:`}
|
|
1234
|
+
</p>
|
|
1235
|
+
<ul {...{"className":"pf-v6-c-content--ul pf-m-editorial ws-ul "}}>
|
|
1236
|
+
<li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
|
|
1237
|
+
{`For `}
|
|
1238
|
+
<code {...{"className":"ws-code "}}>
|
|
1239
|
+
{`Chart`}
|
|
1240
|
+
</code>
|
|
1241
|
+
{` props, see `}
|
|
1242
|
+
<PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-chart","className":""}}>
|
|
1243
|
+
{`VictoryChart`}
|
|
1244
|
+
</PatternflyThemeLink>
|
|
1245
|
+
</li>
|
|
1246
|
+
<li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
|
|
1247
|
+
{`For `}
|
|
1248
|
+
<code {...{"className":"ws-code "}}>
|
|
1249
|
+
{`ChartAxis`}
|
|
1250
|
+
</code>
|
|
1251
|
+
{` props, see `}
|
|
1252
|
+
<PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-axis","className":""}}>
|
|
1253
|
+
{`VictoryAxis`}
|
|
1254
|
+
</PatternflyThemeLink>
|
|
1255
|
+
</li>
|
|
1256
|
+
<li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
|
|
1257
|
+
{`For `}
|
|
1258
|
+
<code {...{"className":"ws-code "}}>
|
|
1259
|
+
{`ChartBoxPlot`}
|
|
1260
|
+
</code>
|
|
1261
|
+
{` props, see `}
|
|
1262
|
+
<PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-box-plot","className":""}}>
|
|
1263
|
+
{`VictoryBoxPlot`}
|
|
1264
|
+
</PatternflyThemeLink>
|
|
1265
|
+
</li>
|
|
1266
|
+
<li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
|
|
1267
|
+
{`For `}
|
|
1268
|
+
<code {...{"className":"ws-code "}}>
|
|
1269
|
+
{`ChartVoronoiContainer`}
|
|
1270
|
+
</code>
|
|
1271
|
+
{` props, see `}
|
|
1272
|
+
<PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-voronoi-container","className":""}}>
|
|
1273
|
+
{`VictoryVoronoiContainer`}
|
|
1274
|
+
</PatternflyThemeLink>
|
|
1275
|
+
</li>
|
|
1276
|
+
</ul>
|
|
1277
|
+
</React.Fragment>
|
|
1278
|
+
);
|
|
1279
|
+
Component.displayName = 'ComponentsChartsBoxPlotChart-VictoryDocs';
|
|
1280
|
+
Component.pageData = pageData;
|
|
1281
|
+
|
|
1282
|
+
export default Component;
|