@patternfly/react-docs 7.6.0-prerelease.6 → 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.
Files changed (163) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +12 -13
  3. package/patternfly-docs/generated/components/about-modal/react.js +149 -0
  4. package/patternfly-docs/generated/components/accordion/react.js +262 -0
  5. package/patternfly-docs/generated/components/action-list/react.js +144 -0
  6. package/patternfly-docs/generated/components/alert/react-demos.js +56 -0
  7. package/patternfly-docs/generated/components/alert/react.js +1433 -0
  8. package/patternfly-docs/generated/components/avatar/react.js +166 -0
  9. package/patternfly-docs/generated/components/back-to-top/react-demos.js +60 -0
  10. package/patternfly-docs/generated/components/back-to-top/react.js +77 -0
  11. package/patternfly-docs/generated/components/backdrop/react.js +64 -0
  12. package/patternfly-docs/generated/components/background-image/react.js +62 -0
  13. package/patternfly-docs/generated/components/badge/react.js +97 -0
  14. package/patternfly-docs/generated/components/banner/react-demos.js +57 -0
  15. package/patternfly-docs/generated/components/banner/react.js +148 -0
  16. package/patternfly-docs/generated/components/brand/react.js +142 -0
  17. package/patternfly-docs/generated/components/breadcrumb/react.js +206 -0
  18. package/patternfly-docs/generated/components/button/react-demos.js +57 -0
  19. package/patternfly-docs/generated/components/button/react.js +826 -0
  20. package/patternfly-docs/generated/components/card/react-demos.js +201 -0
  21. package/patternfly-docs/generated/components/card/react.js +1015 -0
  22. package/patternfly-docs/generated/components/charts/area-chart/-Victory.js +1350 -0
  23. package/patternfly-docs/generated/components/charts/bar-chart/-Victory.js +1334 -0
  24. package/patternfly-docs/generated/components/charts/box-plot-chart/-Victory.js +1282 -0
  25. package/patternfly-docs/generated/components/charts/bullet-chart/-Victory.js +848 -0
  26. package/patternfly-docs/generated/components/charts/colors-for-charts/-Victory.js +192 -0
  27. package/patternfly-docs/generated/components/charts/donut-chart/-Victory.js +426 -0
  28. package/patternfly-docs/generated/components/charts/donut-utilization-chart/-Victory.js +804 -0
  29. package/patternfly-docs/generated/components/charts/legends/-Victory.js +3230 -0
  30. package/patternfly-docs/generated/components/charts/line-chart/-Victory.js +1178 -0
  31. package/patternfly-docs/generated/components/charts/line-chart/ECharts.js +525 -0
  32. package/patternfly-docs/generated/components/charts/patterns/-Victory.js +3382 -0
  33. package/patternfly-docs/generated/components/charts/pie-chart/-Victory.js +377 -0
  34. package/patternfly-docs/generated/components/charts/resize-observer/-Victory.js +2475 -0
  35. package/patternfly-docs/generated/components/charts/sankey-chart/ECharts.js +538 -0
  36. package/patternfly-docs/generated/components/charts/scatter-chart/-Victory.js +1551 -0
  37. package/patternfly-docs/generated/components/charts/skeletons/-Victory.js +4115 -0
  38. package/patternfly-docs/generated/components/charts/sparkline-chart/-Victory.js +955 -0
  39. package/patternfly-docs/generated/components/charts/stack-chart/-Victory.js +1173 -0
  40. package/patternfly-docs/generated/components/charts/threshold-chart/-Victory.js +1166 -0
  41. package/patternfly-docs/generated/components/charts/tooltips/-Victory.js +413 -0
  42. package/patternfly-docs/generated/components/chip/react-deprecated.js +323 -0
  43. package/patternfly-docs/generated/components/clipboard-copy/react.js +373 -0
  44. package/patternfly-docs/generated/components/code-block/react.js +148 -0
  45. package/patternfly-docs/generated/components/code-editor/react.js +659 -0
  46. package/patternfly-docs/generated/components/compass/react-demos.js +147 -0
  47. package/patternfly-docs/generated/components/compass/react.js +440 -0
  48. package/patternfly-docs/generated/components/content/react.js +248 -0
  49. package/patternfly-docs/generated/components/data-list/react-demos.js +90 -0
  50. package/patternfly-docs/generated/components/data-list/react.js +709 -0
  51. package/patternfly-docs/generated/components/date-and-time/calendar-month/react.js +283 -0
  52. package/patternfly-docs/generated/components/date-and-time/date-and-time-picker/react-demos.js +64 -0
  53. package/patternfly-docs/generated/components/date-and-time/date-picker/react-demos.js +83 -0
  54. package/patternfly-docs/generated/components/date-and-time/date-picker/react.js +395 -0
  55. package/patternfly-docs/generated/components/date-and-time/time-picker/react.js +241 -0
  56. package/patternfly-docs/generated/components/description-list/react-demos.js +58 -0
  57. package/patternfly-docs/generated/components/description-list/react.js +743 -0
  58. package/patternfly-docs/generated/components/divider/react.js +126 -0
  59. package/patternfly-docs/generated/components/drag-and-drop/react-demos.js +351 -0
  60. package/patternfly-docs/generated/components/drag-and-drop/react-deprecated.js +184 -0
  61. package/patternfly-docs/generated/components/drag-and-drop/react.js +137 -0
  62. package/patternfly-docs/generated/components/drawer/react.js +598 -0
  63. package/patternfly-docs/generated/components/dual-list-selector/react-deprecated.js +772 -0
  64. package/patternfly-docs/generated/components/dual-list-selector/react.js +594 -0
  65. package/patternfly-docs/generated/components/empty-state/react.js +199 -0
  66. package/patternfly-docs/generated/components/expandable-section/react-demos.js +65 -0
  67. package/patternfly-docs/generated/components/expandable-section/react.js +408 -0
  68. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react-demos.js +52 -0
  69. package/patternfly-docs/generated/components/file-upload/multiple-file-upload/react.js +398 -0
  70. package/patternfly-docs/generated/components/file-upload/simple-file-upload/react.js +749 -0
  71. package/patternfly-docs/generated/components/forms/checkbox/react.js +222 -0
  72. package/patternfly-docs/generated/components/forms/form/react.js +1106 -0
  73. package/patternfly-docs/generated/components/forms/form-select/react.js +208 -0
  74. package/patternfly-docs/generated/components/forms/radio/react.js +212 -0
  75. package/patternfly-docs/generated/components/forms/text-area/react.js +160 -0
  76. package/patternfly-docs/generated/components/forms/text-input/react.js +216 -0
  77. package/patternfly-docs/generated/components/helper-text/react-demos.js +180 -0
  78. package/patternfly-docs/generated/components/helper-text/react.js +164 -0
  79. package/patternfly-docs/generated/components/hero/react.js +88 -0
  80. package/patternfly-docs/generated/components/hint/react.js +169 -0
  81. package/patternfly-docs/generated/components/icon/react.js +215 -0
  82. package/patternfly-docs/generated/components/input-group/react.js +182 -0
  83. package/patternfly-docs/generated/components/jump-links/react-demos.js +154 -0
  84. package/patternfly-docs/generated/components/jump-links/react.js +212 -0
  85. package/patternfly-docs/generated/components/label/react-demos.js +57 -0
  86. package/patternfly-docs/generated/components/label/react.js +417 -0
  87. package/patternfly-docs/generated/components/list/react.js +175 -0
  88. package/patternfly-docs/generated/components/login-page/react.js +587 -0
  89. package/patternfly-docs/generated/components/masthead/react-demos.js +79 -0
  90. package/patternfly-docs/generated/components/masthead/react.js +291 -0
  91. package/patternfly-docs/generated/components/menus/application-launcher/react-demos.js +769 -0
  92. package/patternfly-docs/generated/components/menus/context-selector/react-demos.js +665 -0
  93. package/patternfly-docs/generated/components/menus/custom-menus/react-demos.js +187 -0
  94. package/patternfly-docs/generated/components/menus/dropdown/react-templates.js +163 -0
  95. package/patternfly-docs/generated/components/menus/dropdown/react.js +998 -0
  96. package/patternfly-docs/generated/components/menus/menu/react.js +1540 -0
  97. package/patternfly-docs/generated/components/menus/menu-toggle/react.js +747 -0
  98. package/patternfly-docs/generated/components/menus/options-menu/react-demos.js +508 -0
  99. package/patternfly-docs/generated/components/menus/select/react-templates.js +257 -0
  100. package/patternfly-docs/generated/components/menus/select/react.js +998 -0
  101. package/patternfly-docs/generated/components/modal/react-deprecated.js +554 -0
  102. package/patternfly-docs/generated/components/modal/react.js +597 -0
  103. package/patternfly-docs/generated/components/navigation/react-demos.js +356 -0
  104. package/patternfly-docs/generated/components/navigation/react.js +409 -0
  105. package/patternfly-docs/generated/components/notification-badge/react.js +196 -0
  106. package/patternfly-docs/generated/components/notification-drawer/react-demos.js +107 -0
  107. package/patternfly-docs/generated/components/notification-drawer/react.js +394 -0
  108. package/patternfly-docs/generated/components/number-input/react.js +210 -0
  109. package/patternfly-docs/generated/components/overflow-menu/react.js +274 -0
  110. package/patternfly-docs/generated/components/page/react-demos.js +149 -0
  111. package/patternfly-docs/generated/components/page/react.js +1352 -0
  112. package/patternfly-docs/generated/components/pagination/react.js +492 -0
  113. package/patternfly-docs/generated/components/panel/react.js +236 -0
  114. package/patternfly-docs/generated/components/popover/react.js +390 -0
  115. package/patternfly-docs/generated/components/progress/react-demos.js +59 -0
  116. package/patternfly-docs/generated/components/progress/react.js +283 -0
  117. package/patternfly-docs/generated/components/progress-stepper/react-demos.js +45 -0
  118. package/patternfly-docs/generated/components/progress-stepper/react.js +219 -0
  119. package/patternfly-docs/generated/components/search-input/react-demos.js +113 -0
  120. package/patternfly-docs/generated/components/search-input/react.js +263 -0
  121. package/patternfly-docs/generated/components/sidebar/react.js +236 -0
  122. package/patternfly-docs/generated/components/simple-list/react.js +200 -0
  123. package/patternfly-docs/generated/components/skeleton/react-demos.js +44 -0
  124. package/patternfly-docs/generated/components/skeleton/react.js +122 -0
  125. package/patternfly-docs/generated/components/skip-to-content/react.js +73 -0
  126. package/patternfly-docs/generated/components/slider/react.js +309 -0
  127. package/patternfly-docs/generated/components/spinner/react.js +111 -0
  128. package/patternfly-docs/generated/components/switch/react.js +163 -0
  129. package/patternfly-docs/generated/components/table/react-demos.js +355 -0
  130. package/patternfly-docs/generated/components/table/react-deprecated.js +1350 -0
  131. package/patternfly-docs/generated/components/table/react.js +3241 -0
  132. package/patternfly-docs/generated/components/tabs/react-demos.js +108 -0
  133. package/patternfly-docs/generated/components/tabs/react.js +1359 -0
  134. package/patternfly-docs/generated/components/text-input-group/react-demos.js +152 -0
  135. package/patternfly-docs/generated/components/text-input-group/react.js +278 -0
  136. package/patternfly-docs/generated/components/tile/react-deprecated.js +242 -0
  137. package/patternfly-docs/generated/components/timestamp/react.js +283 -0
  138. package/patternfly-docs/generated/components/title/react.js +94 -0
  139. package/patternfly-docs/generated/components/toggle-group/react.js +299 -0
  140. package/patternfly-docs/generated/components/toolbar/react-demos.js +66 -0
  141. package/patternfly-docs/generated/components/toolbar/react.js +932 -0
  142. package/patternfly-docs/generated/components/tooltip/react.js +241 -0
  143. package/patternfly-docs/generated/components/tree-view/react.js +429 -0
  144. package/patternfly-docs/generated/components/truncate/react.js +211 -0
  145. package/patternfly-docs/generated/components/wizard/react-demos.js +87 -0
  146. package/patternfly-docs/generated/components/wizard/react-deprecated.js +788 -0
  147. package/patternfly-docs/generated/components/wizard/react.js +986 -0
  148. package/patternfly-docs/generated/developer-guides/open-ui-automation/react.js +285 -0
  149. package/patternfly-docs/generated/foundations-and-styles/layouts/bullseye/react.js +70 -0
  150. package/patternfly-docs/generated/foundations-and-styles/layouts/flex/react.js +506 -0
  151. package/patternfly-docs/generated/foundations-and-styles/layouts/gallery/react.js +94 -0
  152. package/patternfly-docs/generated/foundations-and-styles/layouts/grid/react.js +272 -0
  153. package/patternfly-docs/generated/foundations-and-styles/layouts/level/react.js +87 -0
  154. package/patternfly-docs/generated/foundations-and-styles/layouts/split/react.js +124 -0
  155. package/patternfly-docs/generated/foundations-and-styles/layouts/stack/react.js +112 -0
  156. package/patternfly-docs/generated/index.js +1769 -0
  157. package/patternfly-docs/generated/patterns/card-view/react-demos.js +78 -0
  158. package/patternfly-docs/generated/patterns/filters/react-demos.js +141 -0
  159. package/patternfly-docs/generated/patterns/password-generator/react-demos.js +51 -0
  160. package/patternfly-docs/generated/patterns/password-strength/react-demos.js +61 -0
  161. package/patternfly-docs/generated/patterns/primary-detail/react-demos.js +124 -0
  162. package/patternfly-docs/generated/patterns/right-to-left/react-demos.js +81 -0
  163. package/LICENSE +0 -21
@@ -0,0 +1,1173 @@
1
+ import React from 'react';
2
+ import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3
+ import {
4
+ Chart,
5
+ ChartArea,
6
+ ChartAxis,
7
+ ChartBar,
8
+ ChartStack,
9
+ ChartLegendTooltip,
10
+ ChartThemeColor,
11
+ ChartTooltip,
12
+ ChartVoronoiContainer,
13
+ createContainer
14
+ } from '@patternfly/react-charts/victory';
15
+ import { getResizeObserver } from '@patternfly/react-core';
16
+ import { useEffect, useRef, useState } from 'react';
17
+ const pageData = {
18
+ "id": "Stack chart",
19
+ "section": "components",
20
+ "subsection": "charts",
21
+ "deprecated": false,
22
+ "template": false,
23
+ "beta": false,
24
+ "demo": false,
25
+ "newImplementationLink": false,
26
+ "source": "-Victory",
27
+ "tabName": null,
28
+ "slug": "/components/charts/stack-chart/-Victory",
29
+ "sourceLink": "https://github.com/patternfly/patternfly-org/blob/main/packages/react-charts/src/victory/components/ChartStack/examples/ChartStack.md",
30
+ "relPath": "packages/react-charts/src/victory/components/ChartStack/examples/ChartStack.md",
31
+ "propComponents": [
32
+ {
33
+ "name": "Chart",
34
+ "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",
35
+ "props": [
36
+ {
37
+ "name": "animate",
38
+ "type": "boolean | object",
39
+ "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})})}"
40
+ },
41
+ {
42
+ "name": "ariaDesc",
43
+ "type": "string",
44
+ "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"
45
+ },
46
+ {
47
+ "name": "ariaTitle",
48
+ "type": "string",
49
+ "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"
50
+ },
51
+ {
52
+ "name": "backgroundComponent",
53
+ "type": "React.ReactElement<any>",
54
+ "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."
55
+ },
56
+ {
57
+ "name": "children",
58
+ "type": "React.ReactNode | React.ReactNode[]",
59
+ "description": "The children to render with the chart"
60
+ },
61
+ {
62
+ "name": "containerComponent",
63
+ "type": "React.ReactElement<any>",
64
+ "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 ...\" />",
65
+ "defaultValue": "<ChartContainer />"
66
+ },
67
+ {
68
+ "name": "domain",
69
+ "type": "number[] | { x: number[], y: number[] }",
70
+ "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]}"
71
+ },
72
+ {
73
+ "name": "domainPadding",
74
+ "type": "number | number[] | { x: number[], y: number[] }",
75
+ "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}"
76
+ },
77
+ {
78
+ "name": "endAngle",
79
+ "type": "number",
80
+ "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."
81
+ },
82
+ {
83
+ "name": "eventKey",
84
+ "type": "number | string | Function",
85
+ "description": "Similar to data accessor props `x` and `y`, this prop may be used to functionally\nassign eventKeys to data"
86
+ },
87
+ {
88
+ "name": "events",
89
+ "type": "object[]",
90
+ "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]}"
91
+ },
92
+ {
93
+ "name": "externalEventMutations",
94
+ "type": "object[]",
95
+ "description": "Chart uses the standard externalEventMutations prop."
96
+ },
97
+ {
98
+ "name": "groupComponent",
99
+ "type": "React.ReactElement<any>",
100
+ "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"
101
+ },
102
+ {
103
+ "name": "hasPatterns",
104
+ "type": "boolean | boolean[]",
105
+ "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 ]}"
106
+ },
107
+ {
108
+ "name": "height",
109
+ "type": "number",
110
+ "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.",
111
+ "defaultValue": "theme.chart.height"
112
+ },
113
+ {
114
+ "name": "horizontal",
115
+ "type": "boolean",
116
+ "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."
117
+ },
118
+ {
119
+ "name": "innerRadius",
120
+ "type": "number | Function",
121
+ "description": "When the innerRadius prop is set, polar charts will be hollow rather than circular."
122
+ },
123
+ {
124
+ "name": "legendAllowWrap",
125
+ "type": "boolean | ((extraHeight: number) => void)",
126
+ "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"
127
+ },
128
+ {
129
+ "name": "legendComponent",
130
+ "type": "React.ReactElement<any>",
131
+ "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",
132
+ "defaultValue": "<ChartLegend />"
133
+ },
134
+ {
135
+ "name": "legendData",
136
+ "type": "{\n name?: string;\n symbol?: {\n fill?: string;\n type?: string;\n };\n}[]",
137
+ "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' }]}"
138
+ },
139
+ {
140
+ "name": "legendDirection",
141
+ "type": "'ltr' | 'rtl'",
142
+ "description": "Text direction of the legend labels.",
143
+ "defaultValue": "'ltr'"
144
+ },
145
+ {
146
+ "name": "legendOrientation",
147
+ "type": "'horizontal' | 'vertical'",
148
+ "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.",
149
+ "defaultValue": "theme.legend.orientation"
150
+ },
151
+ {
152
+ "name": "legendPosition",
153
+ "type": "'bottom' | 'bottom-left' | 'right'",
154
+ "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.",
155
+ "defaultValue": "\"right\""
156
+ },
157
+ {
158
+ "name": "maxDomain",
159
+ "type": "number | { x?: number; y?: number }",
160
+ "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 }}"
161
+ },
162
+ {
163
+ "name": "minDomain",
164
+ "type": "number | { x?: number; y?: number }",
165
+ "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 }}"
166
+ },
167
+ {
168
+ "name": "name",
169
+ "type": "string",
170
+ "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."
171
+ },
172
+ {
173
+ "name": "padding",
174
+ "type": "number | { top: number, bottom: number, left: number, right: number }",
175
+ "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."
176
+ },
177
+ {
178
+ "name": "patternScale",
179
+ "type": "string[]",
180
+ "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 ]}"
181
+ },
182
+ {
183
+ "name": "polar",
184
+ "type": "boolean",
185
+ "description": "Victory components can pass a boolean polar prop to specify whether a label is part of a polar chart."
186
+ },
187
+ {
188
+ "name": "range",
189
+ "type": "number[] | { x: number[], y: number[] }",
190
+ "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] }}"
191
+ },
192
+ {
193
+ "name": "scale",
194
+ "type": "string | { x: string, y: string }",
195
+ "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\"}"
196
+ },
197
+ {
198
+ "name": "showAxis",
199
+ "type": "boolean",
200
+ "description": "Convenience prop to hide both x and y axis, which are shown by default. Alternatively, the axis can be hidden via\nchart styles.",
201
+ "defaultValue": "true"
202
+ },
203
+ {
204
+ "name": "singleQuadrantDomainPadding",
205
+ "type": "boolean | { x?: boolean; y?: boolean }",
206
+ "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 }}"
207
+ },
208
+ {
209
+ "name": "standalone",
210
+ "type": "boolean",
211
+ "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."
212
+ },
213
+ {
214
+ "name": "startAngle",
215
+ "type": "number",
216
+ "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."
217
+ },
218
+ {
219
+ "name": "style",
220
+ "type": "{ parent: object, background: object }",
221
+ "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 }"
222
+ },
223
+ {
224
+ "name": "theme",
225
+ "type": "object",
226
+ "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.",
227
+ "defaultValue": "getChartTheme(themeColor, showAxis)"
228
+ },
229
+ {
230
+ "name": "themeColor",
231
+ "type": "string",
232
+ "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}"
233
+ },
234
+ {
235
+ "name": "width",
236
+ "type": "number",
237
+ "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.",
238
+ "defaultValue": "theme.chart.width"
239
+ }
240
+ ]
241
+ },
242
+ {
243
+ "name": "ChartArea",
244
+ "description": "ChartArea renders a dataset as a single area path. Since ChartArea renders only a single element to represent a\ndataset rather than individual elements for each data point, some of its behavior is different from other Victory\nbased components. Pay special attention to style and events props, and take advantage of ChartVoronoiContainer to\nenable tooltips. ChartArea can be composed with Chart to create area charts.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-area/src/victory-area.tsx",
245
+ "props": [
246
+ {
247
+ "name": "animate",
248
+ "type": "boolean | object",
249
+ "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})})}"
250
+ },
251
+ {
252
+ "name": "categories",
253
+ "type": "string[] | { x: string[], y: string[] }",
254
+ "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\"]"
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 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...\" />",
260
+ "defaultValue": "<ChartContainer />"
261
+ },
262
+ {
263
+ "name": "data",
264
+ "type": "any[]",
265
+ "description": "The data prop specifies the data to be plotted. Data should be in the form of an array\nof data points, or an array of arrays of data points for multiple datasets.\nEach data point may be any format you wish (depending on the `x` and `y` accessor props),\nbut by default, an object with x and y properties is expected.\n\n@example\n\n[{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]],\n[[{x: \"a\", y: 1}, {x: \"b\", y: 2}], [{x: \"a\", y: 2}, {x: \"b\", y: 3}]]"
266
+ },
267
+ {
268
+ "name": "dataComponent",
269
+ "type": "React.ReactElement<any>",
270
+ "description": "The dataComponent prop takes an entire component which will be used to create an area.\nThe new element created from the passed dataComponent will be provided with the\nfollowing properties calculated by ChartArea: a scale, style, events, interpolation,\nand an array of modified data objects (including x, y, and calculated y0 and y1).\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 its default Area component."
271
+ },
272
+ {
273
+ "name": "domain",
274
+ "type": "number[] | { x: number[], y: number[] }",
275
+ "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]}"
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": "eventKey",
284
+ "type": "number | string | Function | string[] | number[]",
285
+ "description": "Similar to data accessor props `x` and `y`, this prop may be used to functionally\nassign eventKeys to data"
286
+ },
287
+ {
288
+ "name": "events",
289
+ "type": "object[]",
290
+ "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 ChartArea events.\nSince ChartArea only renders a single element, the eventKey property is not used.\nThe 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. an area), 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 eventHandlers: {\n onClick: () => {\n return [\n {\n mutation: (props) => {\n return {style: merge({}, props.style, {fill: \"orange\"})};\n }\n }, {\n target: \"labels\",\n mutation: () => {\n return {text: \"hey\"};\n }\n }\n ];\n }\n }\n }\n]}"
291
+ },
292
+ {
293
+ "name": "externalEventMutations",
294
+ "type": "object[]",
295
+ "description": "ChartArea uses the standard externalEventMutations prop."
296
+ },
297
+ {
298
+ "name": "groupComponent",
299
+ "type": "React.ReactElement<any>",
300
+ "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"
301
+ },
302
+ {
303
+ "name": "height",
304
+ "type": "number",
305
+ "description": "The height props specifies the height the svg viewBox of the chart container.\nThis value should be given as a number of pixels"
306
+ },
307
+ {
308
+ "name": "horizontal",
309
+ "type": "boolean",
310
+ "description": "The horizontal prop determines whether data will be plotted horizontally.\nWhen this prop is set to true, the independent variable will be plotted on the y axis\nand the dependent variable will be plotted on the x axis."
311
+ },
312
+ {
313
+ "name": "interpolation",
314
+ "type": "string | Function",
315
+ "description": "The interpolation prop determines how data points should be connected when plotting a line.\nPolar area charts may use the following interpolation options: \"basis\", \"cardinal\", \"catmullRom\", \"linear\".\nCartesian area charts may use the following interpolation options: \"basis\", \"cardinal\", \"catmullRom\", \"linear\",\n\"monotoneX\", \"monotoneY\", \"natural\", \"step\", \"stepAfter\", \"stepBefore\"."
316
+ },
317
+ {
318
+ "name": "labelComponent",
319
+ "type": "React.ReactElement<any>",
320
+ "description": "The labelComponent prop takes in an entire label component which will be used\nto create a label for the area. The new element created from the passed labelComponent\nwill be supplied with the following properties: x, y, index, data, verticalAnchor,\ntextAnchor, angle, style, text, and events. any of these props may be overridden\nby passing in props to the supplied component, or modified or ignored within\nthe custom component itself. If labelComponent is omitted, a new ChartLabel\nwill be created with props described above. This labelComponent prop should be used to\nprovide a series label for ChartArea. If individual labels are required for each\ndata point, they should be created by composing ChartArea with VictoryScatter"
321
+ },
322
+ {
323
+ "name": "labels",
324
+ "type": "string[] | number[] | ((data: any) => string | number | null)",
325
+ "description": "The labels prop defines labels that will appear above each bar in your chart.\nThis prop should be given as an array of values or as a function of data.\nIf given as an array, the number of elements in the array should be equal to\nthe length of the data array. Labels may also be added directly to the data object\nlike data={[{x: 1, y: 1, label: \"first\"}]}.\n\n@example [\"spring\", \"summer\", \"fall\", \"winter\"], (datum) => datum.title"
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 used to reference a component instance when defining shared events."
341
+ },
342
+ {
343
+ "name": "origin",
344
+ "type": "{ x: number, y: number }",
345
+ "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"
346
+ },
347
+ {
348
+ "name": "padding",
349
+ "type": "number | { top: number, bottom: number, left: number, right: number }",
350
+ "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."
351
+ },
352
+ {
353
+ "name": "polar",
354
+ "type": "boolean",
355
+ "description": "Victory components can pass a boolean polar prop to specify whether a label is part of a polar chart."
356
+ },
357
+ {
358
+ "name": "range",
359
+ "type": "number[] | { x: number[], y: number[] }",
360
+ "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] }}"
361
+ },
362
+ {
363
+ "name": "samples",
364
+ "type": "number",
365
+ "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."
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": "singleQuadrantDomainPadding",
374
+ "type": "boolean | { x?: boolean; y?: boolean }",
375
+ "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 }}"
376
+ },
377
+ {
378
+ "name": "sortKey",
379
+ "type": "number | string | Function | string[]",
380
+ "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."
381
+ },
382
+ {
383
+ "name": "sortOrder",
384
+ "type": "string",
385
+ "description": "The sortOrder prop specifies whether sorted data should be returned in 'ascending' or 'descending' order."
386
+ },
387
+ {
388
+ "name": "standalone",
389
+ "type": "boolean",
390
+ "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 ChartArea with other components within an enclosing <svg> tag."
391
+ },
392
+ {
393
+ "name": "style",
394
+ "type": "{ parent: object, data: object, labels: object }",
395
+ "description": "The style prop specifies styles for your ChartArea. 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}}"
396
+ },
397
+ {
398
+ "name": "theme",
399
+ "type": "object",
400
+ "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 ChartArea as a solo component, implement the theme directly on\nChartArea. If you are wrapping ChartArea in ChartChart or ChartGroup,\nplease call the theme on the outermost wrapper component instead.",
401
+ "defaultValue": "getTheme(themeColor)"
402
+ },
403
+ {
404
+ "name": "themeColor",
405
+ "type": "string",
406
+ "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}"
407
+ },
408
+ {
409
+ "name": "width",
410
+ "type": "number",
411
+ "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"
412
+ },
413
+ {
414
+ "name": "x",
415
+ "type": "number | string | Function | string[]",
416
+ "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)"
417
+ },
418
+ {
419
+ "name": "y",
420
+ "type": "number | string | Function | string[]",
421
+ "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)"
422
+ },
423
+ {
424
+ "name": "y0",
425
+ "type": "number | string | Function | string[]",
426
+ "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 ChartArea.\nThis prop may be given in a variety of formats.\n\n\n@example 'last_quarter_profit', () => 10, 1, 'employees.salary', [\"employees\", \"salary\"]"
427
+ }
428
+ ]
429
+ },
430
+ {
431
+ "name": "ChartBar",
432
+ "description": "ChartBar renders a dataset as series of bars. ChartBar can be composed with Chart to create bar charts.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-bar/src/index.d.ts",
433
+ "props": [
434
+ {
435
+ "name": "alignment",
436
+ "type": "string",
437
+ "description": "The alignment prop specifies how bars should be aligned relative to their data points.\nThis prop may be given as “start”, “middle” or “end”. When this prop is not specified,\nbars will have “middle” alignment relative to their data points."
438
+ },
439
+ {
440
+ "name": "animate",
441
+ "type": "boolean | object",
442
+ "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})})}"
443
+ },
444
+ {
445
+ "name": "barRatio",
446
+ "type": "number",
447
+ "description": "The barRatio prop specifies an approximate ratio between bar widths and spaces between bars.\nWhen width is not specified via the barWidth prop or in bar styles, the barRatio prop will\nbe used to calculate a default width for each bar given the total number of bars in the data series\nand the overall width of the chart."
448
+ },
449
+ {
450
+ "name": "barWidth",
451
+ "type": "number | Function",
452
+ "description": "The barWidth prop is used to specify the width of each bar. This prop may be given as\na number of pixels or as a function that returns a number. When this prop is given as\na function, it will be evaluated with the arguments datum, and active. When this value\nis not given, a default value will be calculated based on the overall dimensions of\nthe chart, and the number of bars."
453
+ },
454
+ {
455
+ "name": "categories",
456
+ "type": "string[] | { x: string[], y: string[] }",
457
+ "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\"]"
458
+ },
459
+ {
460
+ "name": "containerComponent",
461
+ "type": "React.ReactElement<any>",
462
+ "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 ChartBar: 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, ChartBar will use the default ChartContainer component.\n\n@example <ChartContainer title=\"Chart of Dog Breeds\" desc=\"This chart shows...\" />",
463
+ "defaultValue": "<ChartContainer />"
464
+ },
465
+ {
466
+ "name": "cornerRadius",
467
+ "type": "Function | number | { top, bottom, topLeft, topRight, bottomLeft, bottomRight }",
468
+ "description": "The cornerRadius prop specifies a radius to apply to each bar.\nIf this prop is given as a single number, the radius will only be applied to the top of each bar.\nWhen this prop is given as a function, it will be evaluated with the arguments datum, and active.\n\n\n@example {topLeft: ({ datum }) => datum.x * 4}"
469
+ },
470
+ {
471
+ "name": "data",
472
+ "type": "any[]",
473
+ "description": "The data prop specifies the data to be plotted. Data should be in the form of an array\nof data points, or an array of arrays of data points for multiple datasets.\nEach data point may be any format you wish (depending on the `x` and `y` accessor props),\nbut by default, an object with x and y properties is expected.\n\n@example\n\n[{x: 1, y: 2}, {x: 2, y: 3}], [[1, 2], [2, 3]],\n[[{x: \"a\", y: 1}, {x: \"b\", y: 2}], [{x: \"a\", y: 2}, {x: \"b\", y: 3}]]"
474
+ },
475
+ {
476
+ "name": "dataComponent",
477
+ "type": "React.ReactElement<any>",
478
+ "description": "The dataComponent prop takes an entire component which will be used to create a bar.\nThe new element created from the passed dataComponent will be provided with the\nfollowing properties calculated by ChartBar: a scale, style, events, interpolation,\nand an array of modified data objects (including x, y, and calculated y0 and y1).\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, ChartBar will use its default Bar component."
479
+ },
480
+ {
481
+ "name": "domain",
482
+ "type": "number[] | { x: number[], y: number[] }",
483
+ "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]}"
484
+ },
485
+ {
486
+ "name": "domainPadding",
487
+ "type": "number | number[] | { x: number[], y: number[] }",
488
+ "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}"
489
+ },
490
+ {
491
+ "name": "eventKey",
492
+ "type": "number | string | Function",
493
+ "description": "Similar to data accessor props `x` and `y`, this prop may be used to functionally\nassign eventKeys to data"
494
+ },
495
+ {
496
+ "name": "events",
497
+ "type": "object[]",
498
+ "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 VictoryBar 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\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]}"
499
+ },
500
+ {
501
+ "name": "externalEventMutations",
502
+ "type": "object[]",
503
+ "description": "ChartBar uses the standard externalEventMutations prop."
504
+ },
505
+ {
506
+ "name": "groupComponent",
507
+ "type": "React.ReactElement<any>",
508
+ "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"
509
+ },
510
+ {
511
+ "name": "height",
512
+ "type": "number",
513
+ "description": "The height props specifies the height the svg viewBox of the chart container.\nThis value should be given as a number of pixels"
514
+ },
515
+ {
516
+ "name": "horizontal",
517
+ "type": "boolean",
518
+ "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."
519
+ },
520
+ {
521
+ "name": "labelComponent",
522
+ "type": "React.ReactElement<any>",
523
+ "description": "The labelComponent prop takes in an entire label component which will be used\nto create a label for the bar. The new element created from the passed labelComponent\nwill be supplied with the following properties: x, y, index, data, verticalAnchor,\ntextAnchor, angle, style, text, and events. any of these props may be overridden\nby passing in props to the supplied component, or modified or ignored within\nthe custom component itself. If labelComponent is omitted, a new ChartLabel\nwill be created with props described above. This labelComponent prop should be used to\nprovide a series label for ChartBar. If individual labels are required for each\ndata point, they should be created by composing ChartBar with VictoryScatter"
524
+ },
525
+ {
526
+ "name": "labels",
527
+ "type": "string[] | number[] | ((data: any) => string | number | null)",
528
+ "description": "The labels prop defines labels that will appear above each bar in your chart.\nThis prop should be given as an array of values or as a function of data.\nIf given as an array, the number of elements in the array should be equal to\nthe length of the data array. Labels may also be added directly to the data object\nlike data={[{x: 1, y: 1, label: \"first\"}]}.\n\n@example [\"spring\", \"summer\", \"fall\", \"winter\"], (datum) => datum.title"
529
+ },
530
+ {
531
+ "name": "maxDomain",
532
+ "type": "number | { x?: number; y?: number }",
533
+ "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 }}"
534
+ },
535
+ {
536
+ "name": "minDomain",
537
+ "type": "number | { x?: number; y?: number }",
538
+ "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 }}"
539
+ },
540
+ {
541
+ "name": "name",
542
+ "type": "string",
543
+ "description": "The name prop is used to reference a component instance when defining shared events."
544
+ },
545
+ {
546
+ "name": "origin",
547
+ "type": "{ x: number, y: number }",
548
+ "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"
549
+ },
550
+ {
551
+ "name": "padding",
552
+ "type": "number | { top: number, bottom: number, left: number, right: number }",
553
+ "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."
554
+ },
555
+ {
556
+ "name": "range",
557
+ "type": "number[] | { x: number[], y: number[] }",
558
+ "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] }}"
559
+ },
560
+ {
561
+ "name": "samples",
562
+ "type": "number",
563
+ "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."
564
+ },
565
+ {
566
+ "name": "scale",
567
+ "type": "string | { x: string, y: string }",
568
+ "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\"}"
569
+ },
570
+ {
571
+ "name": "singleQuadrantDomainPadding",
572
+ "type": "boolean | { x?: boolean; y?: boolean }",
573
+ "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 }}"
574
+ },
575
+ {
576
+ "name": "sortKey",
577
+ "type": "number | string | Function | string[]",
578
+ "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."
579
+ },
580
+ {
581
+ "name": "sortOrder",
582
+ "type": "string",
583
+ "description": "The sortOrder prop specifies whether sorted data should be returned in 'ascending' or 'descending' order."
584
+ },
585
+ {
586
+ "name": "standalone",
587
+ "type": "boolean",
588
+ "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 ChartBar with other components within an enclosing <svg> tag."
589
+ },
590
+ {
591
+ "name": "style",
592
+ "type": "{ parent: object, data: object, labels: object }",
593
+ "description": "The style prop specifies styles for your ChartBar. 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}}"
594
+ },
595
+ {
596
+ "name": "theme",
597
+ "type": "object",
598
+ "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 ChartBar as a solo component, implement the theme directly on\nChartBar. If you are wrapping ChartBar in ChartChart or ChartGroup,\nplease call the theme on the outermost wrapper component instead.",
599
+ "defaultValue": "getTheme(themeColor)"
600
+ },
601
+ {
602
+ "name": "themeColor",
603
+ "type": "string",
604
+ "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}"
605
+ },
606
+ {
607
+ "name": "width",
608
+ "type": "number",
609
+ "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"
610
+ },
611
+ {
612
+ "name": "x",
613
+ "type": "number | string | Function | string[]",
614
+ "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)"
615
+ },
616
+ {
617
+ "name": "y",
618
+ "type": "number | string | Function | string[]",
619
+ "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)"
620
+ },
621
+ {
622
+ "name": "y0",
623
+ "type": "number | string | Function | string[]",
624
+ "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 ChartBar.\nThis prop may be given in a variety of formats.\n\n\n@example 'last_quarter_profit', () => 10, 1, 'employees.salary', [\"employees\", \"salary\"]"
625
+ }
626
+ ]
627
+ },
628
+ {
629
+ "name": "ChartStack",
630
+ "description": "ChartStack is a wrapper component that renders a given set of children in a stacked layout. Like other wrapper\ncomponents, ChartStack also reconciles the domain and layout for all its children, and coordinates animations and\nshared events.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-stack/src/index.d.ts",
631
+ "props": [
632
+ {
633
+ "name": "animate",
634
+ "type": "boolean | object",
635
+ "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\n{duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})}"
636
+ },
637
+ {
638
+ "name": "ariaDesc",
639
+ "type": "string",
640
+ "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"
641
+ },
642
+ {
643
+ "name": "ariaTitle",
644
+ "type": "string",
645
+ "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"
646
+ },
647
+ {
648
+ "name": "categories",
649
+ "type": "string[] | { x: string[], y: string[] }",
650
+ "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 values for x and y. When categories are not given as an object\nWhen this prop is set on a wrapper component, it will dictate the categories of\nits the children. If this prop is not set, any categories on child component\nor categorical data, will be merged to create a shared set of categories.\n\n\n@example [\"dogs\", \"cats\", \"mice\"]"
651
+ },
652
+ {
653
+ "name": "children",
654
+ "type": "React.ReactNode",
655
+ "description": "ChartStack works with any combination of the following children: ChartArea, ChartBar, VictoryCandlestick,\nVictoryErrorBar, ChartGroup, ChartLine, VictoryScatter, ChartStack, and ChartVoronoi. Children supplied to\nChartGroup will be cloned and rendered with new props so that all children share common props such as domain and\nscale."
656
+ },
657
+ {
658
+ "name": "colorScale",
659
+ "type": "string[]",
660
+ "description": "The colorScale prop is an optional prop that defines the color scale the chart's bars\nwill be created on. This prop should be given as an array of CSS colors, or as a string\ncorresponding to one of the built in color scales. ChartStack will automatically assign\nvalues from this color scale to the bars unless colors are explicitly provided in the\n`dataAttributes` prop."
661
+ },
662
+ {
663
+ "name": "containerComponent",
664
+ "type": "React.ReactElement<any>",
665
+ "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...\" />",
666
+ "defaultValue": "<ChartContainer />"
667
+ },
668
+ {
669
+ "name": "domain",
670
+ "type": "number[] | { x: number[], y: number[] }",
671
+ "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]}"
672
+ },
673
+ {
674
+ "name": "domainPadding",
675
+ "type": "number | number[] | { x: number[], y: number[] }",
676
+ "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}"
677
+ },
678
+ {
679
+ "name": "eventKey",
680
+ "type": "number | string | Function",
681
+ "description": "Similar to data accessor props `x` and `y`, this prop may be used to functionally\nassign eventKeys to data"
682
+ },
683
+ {
684
+ "name": "events",
685
+ "type": "object[]",
686
+ "description": "The event prop take an array of event objects. Event objects are composed of\na childName, target, eventKey, and eventHandlers. Targets may be any valid style namespace\nfor a given component, (i.e. \"data\" and \"labels\"). The childName will refer to an\nindividual child of ChartStack, either by its name prop, or by index. The eventKey\nmay optionally be used to select a single element by index or eventKey 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 and childName keys,\nand a mutation key whose value is a function. The target and eventKey and childName 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 childName: \"firstBar\",\n eventHandlers: {\n onClick: () => {\n return [\n {\n childName: \"secondBar\",\n mutation: (props) => {\n return {style: merge({}, props.style, {fill: \"orange\"})};\n }\n }, {\n childName: \"secondBar\",\n target: \"labels\",\n mutation: () => {\n return {text: \"hey\"};\n }\n }\n ];\n }\n }\n }\n]}"
687
+ },
688
+ {
689
+ "name": "externalEventMutations",
690
+ "type": "object[]",
691
+ "description": "ChartStack uses the standard externalEventMutations prop."
692
+ },
693
+ {
694
+ "name": "groupComponent",
695
+ "type": "React.ReactElement<any>",
696
+ "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"
697
+ },
698
+ {
699
+ "name": "hasPatterns",
700
+ "type": "boolean | boolean[]",
701
+ "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 ]}"
702
+ },
703
+ {
704
+ "name": "height",
705
+ "type": "number",
706
+ "description": "The height props specifies the height the svg viewBox of the chart container.\nThis value should be given as a number of pixels"
707
+ },
708
+ {
709
+ "name": "horizontal",
710
+ "type": "boolean",
711
+ "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."
712
+ },
713
+ {
714
+ "name": "labelComponent",
715
+ "type": "React.ReactElement<any>",
716
+ "description": "The labelComponent prop takes in an entire label component which will be used\nto create a label for the area. The new element created from the passed labelComponent\nwill be supplied with the following properties: x, y, index, data, verticalAnchor,\ntextAnchor, angle, style, text, and events. any of these props may be overridden\nby passing in props to the supplied component, or modified or ignored within\nthe custom component itself. If labelComponent is omitted, a new ChartLabel\nwill be created with props described above. This labelComponent prop should be used to\nprovide a series label for ChartArea. If individual labels are required for each\ndata point, they should be created by composing ChartArea with VictoryScatter"
717
+ },
718
+ {
719
+ "name": "labels",
720
+ "type": "string[] | number[] | ((data: any) => string | number | null)",
721
+ "description": "The labels prop defines labels that will appear above each bar in your chart.\nThis prop should be given as an array of values or as a function of data.\nIf given as an array, the number of elements in the array should be equal to\nthe length of the data array. Labels may also be added directly to the data object\nlike data={[{x: 1, y: 1, label: \"first\"}]}.\n\n@example [\"spring\", \"summer\", \"fall\", \"winter\"], (datum) => datum.title"
722
+ },
723
+ {
724
+ "name": "maxDomain",
725
+ "type": "number | { x?: number; y?: number }",
726
+ "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 }}"
727
+ },
728
+ {
729
+ "name": "minDomain",
730
+ "type": "number | { x?: number; y?: number }",
731
+ "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 }}"
732
+ },
733
+ {
734
+ "name": "name",
735
+ "type": "string",
736
+ "description": "The name prop is used to reference a component instance when defining shared events."
737
+ },
738
+ {
739
+ "name": "origin",
740
+ "type": "{ x: number, y: number }",
741
+ "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"
742
+ },
743
+ {
744
+ "name": "padding",
745
+ "type": "number | { top: number, bottom: number, left: number, right: number }",
746
+ "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."
747
+ },
748
+ {
749
+ "name": "patternScale",
750
+ "type": "string[]",
751
+ "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 ]}"
752
+ },
753
+ {
754
+ "name": "range",
755
+ "type": "number[] | { x: number[], y: number[] }",
756
+ "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] }}"
757
+ },
758
+ {
759
+ "name": "scale",
760
+ "type": "string | { x: string, y: string }",
761
+ "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\"}"
762
+ },
763
+ {
764
+ "name": "singleQuadrantDomainPadding",
765
+ "type": "boolean | { x?: boolean; y?: boolean }",
766
+ "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 }}"
767
+ },
768
+ {
769
+ "name": "standalone",
770
+ "type": "boolean",
771
+ "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 ChartArea with other components within an enclosing <svg> tag."
772
+ },
773
+ {
774
+ "name": "style",
775
+ "type": "{ parent: object, data: object, labels: object }",
776
+ "description": "The style prop specifies styles for your grouped chart. These styles will be\napplied to all grouped children"
777
+ },
778
+ {
779
+ "name": "theme",
780
+ "type": "object",
781
+ "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 ChartArea as a solo component, implement the theme directly on\nChartArea. If you are wrapping ChartArea in ChartChart or ChartGroup,\nplease call the theme on the outermost wrapper component instead.",
782
+ "defaultValue": "getTheme(themeColor)"
783
+ },
784
+ {
785
+ "name": "themeColor",
786
+ "type": "string",
787
+ "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}"
788
+ },
789
+ {
790
+ "name": "width",
791
+ "type": "number",
792
+ "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"
793
+ },
794
+ {
795
+ "name": "xOffset",
796
+ "type": "number",
797
+ "description": "The xOffset prop is used for grouping stacks of bars. This prop will be set\nby the ChartGroup component wrapper, or can be set manually."
798
+ }
799
+ ]
800
+ },
801
+ {
802
+ "name": "ChartTooltip",
803
+ "description": "ChartTooltip renders a tooltip component with a set of default events. When ChartTooltip is used as a label component\nfor any Victory based component that renders data, it will attach events to rendered data components that will\nactivate the tooltip when hovered or focused. ChartTooltipTooltip renders text as well as a configurable Flyout\ncontainer.\n\nNote: When providing tooltips for ChartLine or ChartArea, it is necessary to use ChartVoronoiContainer, as these\ncomponents only render a single element for the entire dataset.\n\nSee https://github.com/FormidableLabs/victory/blob/main/packages/victory-tooltip/src/index.d.ts",
804
+ "props": [
805
+ {
806
+ "name": "activateData",
807
+ "type": "boolean",
808
+ "description": "When true, tooltip events will set the active prop on both data and label elements."
809
+ },
810
+ {
811
+ "name": "active",
812
+ "type": "boolean",
813
+ "description": "The active prop specifies whether the tooltip component should be displayed."
814
+ },
815
+ {
816
+ "name": "angle",
817
+ "type": "number",
818
+ "description": "The angle prop specifies the angle to rotate the tooltip around its origin point."
819
+ },
820
+ {
821
+ "name": "center",
822
+ "type": "{ x: number; y: number }",
823
+ "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."
824
+ },
825
+ {
826
+ "name": "centerOffset",
827
+ "type": "{ x: number | Function, y: number | Function }",
828
+ "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."
829
+ },
830
+ {
831
+ "name": "constrainToVisibleArea",
832
+ "type": "boolean",
833
+ "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.",
834
+ "defaultValue": "false"
835
+ },
836
+ {
837
+ "name": "cornerRadius",
838
+ "type": "number | Function",
839
+ "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."
840
+ },
841
+ {
842
+ "name": "data",
843
+ "type": "any[]",
844
+ "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."
845
+ },
846
+ {
847
+ "name": "datum",
848
+ "type": "{}",
849
+ "description": "Victory components can pass a datum prop to their label component. This can be used to calculate functional styles,\nand determine text."
850
+ },
851
+ {
852
+ "name": "dx",
853
+ "type": "number | Function",
854
+ "description": "The dx prop defines a horizontal shift from the x coordinate."
855
+ },
856
+ {
857
+ "name": "dy",
858
+ "type": "number | Function",
859
+ "description": "The dy prop defines a vertical shift from the y coordinate."
860
+ },
861
+ {
862
+ "name": "events",
863
+ "type": "object",
864
+ "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)}}"
865
+ },
866
+ {
867
+ "name": "flyoutComponent",
868
+ "type": "React.ReactElement<any>",
869
+ "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/>}"
870
+ },
871
+ {
872
+ "name": "flyoutHeight",
873
+ "type": "number | Function",
874
+ "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."
875
+ },
876
+ {
877
+ "name": "flyoutStyle",
878
+ "type": "number | Function",
879
+ "description": "The style prop applies SVG style properties to the rendered flyout container. These props will be passed to the\nflyoutComponent."
880
+ },
881
+ {
882
+ "name": "flyoutWidth",
883
+ "type": "number | Function",
884
+ "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."
885
+ },
886
+ {
887
+ "name": "groupComponent",
888
+ "type": "React.ReactElement<any>",
889
+ "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.}"
890
+ },
891
+ {
892
+ "name": "horizontal",
893
+ "type": "boolean",
894
+ "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."
895
+ },
896
+ {
897
+ "name": "index",
898
+ "type": "number | string",
899
+ "description": "The index prop represents the index of the datum in the data array."
900
+ },
901
+ {
902
+ "name": "labelComponent",
903
+ "type": "React.ReactElement<any>",
904
+ "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/>}",
905
+ "defaultValue": "<ChartLabel />"
906
+ },
907
+ {
908
+ "name": "labelTextAnchor",
909
+ "type": "string | Function",
910
+ "description": "Defines how the labelComponent text is horizontally positioned relative to its `x` and `y` coordinates. Valid\nvalues are 'start', 'middle', 'end', and 'inherit'."
911
+ },
912
+ {
913
+ "name": "orientation",
914
+ "type": "string | Function",
915
+ "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."
916
+ },
917
+ {
918
+ "name": "pointerLength",
919
+ "type": "number | Function",
920
+ "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."
921
+ },
922
+ {
923
+ "name": "pointerOrientation",
924
+ "type": "string | Function",
925
+ "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."
926
+ },
927
+ {
928
+ "name": "pointerWidth",
929
+ "type": "number | Function",
930
+ "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."
931
+ },
932
+ {
933
+ "name": "renderInPortal",
934
+ "type": "boolean",
935
+ "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."
936
+ },
937
+ {
938
+ "name": "style",
939
+ "type": "React.CSSProperties | React.CSSProperties[]",
940
+ "description": "The style prop applies CSS properties to the rendered `<text>` element."
941
+ },
942
+ {
943
+ "name": "text",
944
+ "type": "number | string | Function | string[] | number[]",
945
+ "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."
946
+ },
947
+ {
948
+ "name": "theme",
949
+ "type": "object",
950
+ "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.",
951
+ "defaultValue": "getTheme(themeColor)"
952
+ },
953
+ {
954
+ "name": "themeColor",
955
+ "type": "string",
956
+ "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}"
957
+ },
958
+ {
959
+ "name": "x",
960
+ "type": "number",
961
+ "description": "The x prop defines the x coordinate to use as a basis for horizontal positioning."
962
+ },
963
+ {
964
+ "name": "y",
965
+ "type": "number",
966
+ "description": "The y prop defines the y coordinate to use as a basis for vertical positioning."
967
+ }
968
+ ]
969
+ }
970
+ ],
971
+ "examples": [
972
+ "Basic with right aligned legend",
973
+ "Horizontal with bottom aligned legend",
974
+ "Multi-color (ordered) horizontal with bottom aligned legend",
975
+ "Monthly data with responsive container",
976
+ "Multi-color (unordered) responsive container"
977
+ ]
978
+ };
979
+ pageData.liveContext = {
980
+ Chart,
981
+ ChartArea,
982
+ ChartAxis,
983
+ ChartBar,
984
+ ChartStack,
985
+ ChartLegendTooltip,
986
+ ChartThemeColor,
987
+ ChartTooltip,
988
+ ChartVoronoiContainer,
989
+ createContainer,
990
+ getResizeObserver,
991
+ useEffect,
992
+ useRef,
993
+ useState
994
+ };
995
+ pageData.examples = {
996
+ 'Basic with right aligned legend': props =>
997
+ <Example {...pageData} {...props} {...{"code":"import { Chart, ChartAxis, ChartBar, ChartStack, ChartVoronoiContainer } from '@patternfly/react-charts/victory';\n\ninterface PetData {\n name: string;\n x: string;\n y: number;\n}\n\nexport const ChartStackBasicRightLegend: React.FunctionComponent = () => {\n const data1: PetData[] = [\n { name: 'Cats', x: '2015', y: 1 },\n { name: 'Cats', x: '2016', y: 2 },\n { name: 'Cats', x: '2017', y: 5 },\n { name: 'Cats', x: '2018', y: 3 }\n ];\n const data2: PetData[] = [\n { name: 'Dogs', x: '2015', y: 2 },\n { name: 'Dogs', x: '2016', y: 1 },\n { name: 'Dogs', x: '2017', y: 7 },\n { name: 'Dogs', x: '2018', y: 4 }\n ];\n const data3: PetData[] = [\n { name: 'Birds', x: '2015', y: 4 },\n { name: 'Birds', x: '2016', y: 4 },\n { name: 'Birds', x: '2017', y: 9 },\n { name: 'Birds', x: '2018', y: 7 }\n ];\n const data4: PetData[] = [\n { name: 'Mice', x: '2015', y: 3 },\n { name: 'Mice', x: '2016', y: 3 },\n { name: 'Mice', x: '2017', y: 8 },\n { name: 'Mice', x: '2018', y: 5 }\n ];\n\n return (\n <div style={{ height: '250px', width: '600px' }}>\n <Chart\n ariaDesc=\"Average number of pets\"\n ariaTitle=\"Stack chart example\"\n containerComponent={\n <ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />\n }\n domainPadding={{ x: [30, 25] }}\n legendData={[{ name: 'Cats' }, { name: 'Dogs' }, { name: 'Birds' }, { name: 'Mice' }]}\n legendOrientation=\"vertical\"\n legendPosition=\"right\"\n height={250}\n name=\"chart1\"\n padding={{\n bottom: 50,\n left: 50,\n right: 200, // Adjusted to accommodate legend\n top: 50\n }}\n width={600}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartStack>\n <ChartBar data={data1} />\n <ChartBar data={data2} />\n <ChartBar data={data3} />\n <ChartBar data={data4} />\n </ChartStack>\n </Chart>\n </div>\n );\n};\n","title":"Basic with right aligned legend","lang":"ts","className":""}}>
998
+
999
+ </Example>,
1000
+ 'Horizontal with bottom aligned legend': props =>
1001
+ <Example {...pageData} {...props} {...{"code":"import {\n Chart,\n ChartAxis,\n ChartBar,\n ChartStack,\n ChartThemeColor,\n ChartVoronoiContainer\n} from '@patternfly/react-charts/victory';\n\ninterface PetData {\n name: string;\n x: string;\n y: number;\n}\n\nexport const ChartStackBottomLegend: React.FunctionComponent = () => {\n const data1: PetData[] = [\n { name: 'Cats', x: '2015', y: 1 },\n { name: 'Cats', x: '2016', y: 2 },\n { name: 'Cats', x: '2017', y: 5 },\n { name: 'Cats', x: '2018', y: 3 }\n ];\n const data2: PetData[] = [\n { name: 'Dogs', x: '2015', y: 2 },\n { name: 'Dogs', x: '2016', y: 1 },\n { name: 'Dogs', x: '2017', y: 7 },\n { name: 'Dogs', x: '2018', y: 4 }\n ];\n const data3: PetData[] = [\n { name: 'Birds', x: '2015', y: 4 },\n { name: 'Birds', x: '2016', y: 4 },\n { name: 'Birds', x: '2017', y: 9 },\n { name: 'Birds', x: '2018', y: 7 }\n ];\n const data4: PetData[] = [\n { name: 'Mice', x: '2015', y: 3 },\n { name: 'Mice', x: '2016', y: 3 },\n { name: 'Mice', x: '2017', y: 8 },\n { name: 'Mice', x: '2018', y: 5 }\n ];\n\n return (\n <div style={{ height: '275px', width: '450px' }}>\n <Chart\n ariaDesc=\"Average number of pets\"\n ariaTitle=\"Stack chart example\"\n containerComponent={\n <ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />\n }\n domainPadding={{ x: [30, 25] }}\n legendData={[{ name: 'Cats' }, { name: 'Dogs' }, { name: 'Birds' }, { name: 'Mice' }]}\n legendPosition=\"bottom\"\n height={275}\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={450}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartStack>\n <ChartBar data={data1} />\n <ChartBar data={data2} />\n <ChartBar data={data3} />\n <ChartBar data={data4} />\n </ChartStack>\n </Chart>\n </div>\n );\n};\n","title":"Horizontal with bottom aligned legend","lang":"ts","className":""}}>
1002
+
1003
+ </Example>,
1004
+ 'Multi-color (ordered) horizontal with bottom aligned legend': props =>
1005
+ <Example {...pageData} {...props} {...{"code":"import {\n Chart,\n ChartBar,\n ChartAxis,\n ChartStack,\n ChartThemeColor,\n ChartTooltip\n} from '@patternfly/react-charts/victory';\n\ninterface PetData {\n name?: string;\n x?: string;\n y?: number;\n label?: string;\n}\n\nexport const ChartStackMultiColorOrdered: React.FunctionComponent = () => {\n const data1: PetData[] = [\n { name: 'Cats', x: '2015', y: 1, label: 'Cats: 1' },\n { name: 'Cats', x: '2016', y: 2, label: 'Cats: 2' },\n { name: 'Cats', x: '2017', y: 5, label: 'Cats: 5' },\n { name: 'Cats', x: '2018', y: 3, label: 'Cats: 3' }\n ];\n const data2: PetData[] = [\n { name: 'Dogs', x: '2015', y: 2, label: 'Dogs: 2' },\n { name: 'Dogs', x: '2016', y: 1, label: 'Dogs: 1' },\n { name: 'Dogs', x: '2017', y: 7, label: 'Dogs: 7' },\n { name: 'Dogs', x: '2018', y: 4, label: 'Dogs: 4' }\n ];\n const data3: PetData[] = [\n { name: 'Birds', x: '2015', y: 4, label: 'Birds: 4' },\n { name: 'Birds', x: '2016', y: 4, label: 'Birds: 4' },\n { name: 'Birds', x: '2017', y: 9, label: 'Birds: 9' },\n { name: 'Birds', x: '2018', y: 7, label: 'Birds: 7' }\n ];\n const data4: PetData[] = [\n { name: 'Mice', x: '2015', y: 3, label: 'Mice: 3' },\n { name: 'Mice', x: '2016', y: 3, label: 'Mice: 3' },\n { name: 'Mice', x: '2017', y: 8, label: 'Mice: 8' },\n { name: 'Mice', x: '2018', y: 5, label: 'Mice: 5' }\n ];\n const legendData: PetData[] = [{ name: 'Cats' }, { name: 'Dogs' }, { name: 'Birds' }, { name: 'Mice' }];\n\n return (\n <div style={{ height: '275px', width: '450px' }}>\n <Chart\n ariaDesc=\"Average number of pets\"\n ariaTitle=\"Stack chart example\"\n domainPadding={{ x: [30, 25] }}\n legendData={legendData}\n legendPosition=\"bottom-left\"\n height={275}\n name=\"chart3\"\n padding={{\n bottom: 75, // Adjusted to accommodate legend\n left: 50,\n right: 50,\n top: 50\n }}\n themeColor={ChartThemeColor.multiOrdered}\n width={450}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartStack horizontal>\n <ChartBar data={data1} labelComponent={<ChartTooltip constrainToVisibleArea />} />\n <ChartBar data={data2} labelComponent={<ChartTooltip constrainToVisibleArea />} />\n <ChartBar data={data3} labelComponent={<ChartTooltip constrainToVisibleArea />} />\n <ChartBar data={data4} labelComponent={<ChartTooltip constrainToVisibleArea />} />\n </ChartStack>\n </Chart>\n </div>\n );\n};\n","title":"Multi-color (ordered) horizontal with bottom aligned legend","lang":"ts","className":""}}>
1006
+
1007
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1008
+ {`This demonstrates an alternate way of applying tooltips using data labels.`}
1009
+ </p>
1010
+ </Example>,
1011
+ 'Monthly data with responsive container': props =>
1012
+ <Example {...pageData} {...props} {...{"code":"import { Chart, ChartAxis, ChartBar, ChartStack, ChartTooltip } from '@patternfly/react-charts/victory';\nimport { getResizeObserver } from '@patternfly/react-core';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface Bar {\n x: string;\n y: number;\n}\n\nexport const ChartStackMonthlyResponsive: React.FunctionComponent = () => {\n const containerRef = useRef(null);\n const observer = useRef(() => {});\n const [width, setWidth] = useState(0);\n\n const handleResize = () => {\n if (containerRef.current && containerRef.current.clientWidth) {\n setWidth(containerRef.current.clientWidth);\n }\n };\n const bars: Bar[] = [];\n for (let i = 1; i < 32; i++) {\n bars.push({ x: `Aug. ${i}`, y: Math.floor(Math.random() * 6) + 1 });\n }\n\n const renderSocketBars = () => {\n const socketBars = bars.map((tick, index) => ({\n key: index,\n x: tick.x,\n y: tick.y,\n name: 'Sockets',\n label: `${tick.x} Sockets: ${tick.y}`\n }));\n return <ChartBar data={socketBars} labelComponent={<ChartTooltip constrainToVisibleArea />} />;\n };\n\n const renderCoresBars = () => {\n const coresBars = bars.map((tick, index) => ({\n key: index,\n x: tick.x,\n y: tick.y,\n name: 'Cores',\n label: `${tick.x} Cores: ${tick.y}`\n }));\n return <ChartBar data={coresBars} labelComponent={<ChartTooltip constrainToVisibleArea />} />;\n };\n\n const renderNodesBars = () => {\n const nodesBars = bars.map((tick, index) => ({\n key: index,\n x: tick.x,\n y: tick.y,\n name: 'Nodes',\n label: `${tick.x} Nodes: ${tick.y}`\n }));\n return <ChartBar data={nodesBars} labelComponent={<ChartTooltip constrainToVisibleArea />} />;\n };\n\n const getTickValues = (offset = 2) => {\n const tickValues = [];\n for (let i = 1; i < 32; i++) {\n if (i % offset === 0) {\n tickValues.push(`Aug. ${i}`);\n }\n }\n return tickValues;\n };\n\n useEffect(() => {\n observer.current = getResizeObserver(containerRef.current, handleResize);\n handleResize();\n\n return () => {\n observer.current();\n };\n }, []);\n\n return (\n <div ref={containerRef}>\n <div style={{ height: '225px' }}>\n <Chart\n ariaDesc=\"Stack Chart with monthly metric data\"\n ariaTitle=\"Monthly Stack Chart\"\n domainPadding={{ x: [30, 25] }}\n legendData={[{ name: 'Sockets' }, { name: 'Cores' }, { name: 'Nodes' }]}\n legendPosition=\"bottom\"\n height={225}\n name=\"chart4\"\n padding={{\n bottom: 75, // Adjusted to accommodate legend\n left: 50,\n right: 50,\n top: 50\n }}\n width={width}\n >\n <ChartAxis tickValues={getTickValues()} fixLabelOverlap />\n <ChartAxis dependentAxis showGrid />\n <ChartStack domainPadding={{ x: [10, 2] }}>\n {renderSocketBars()}\n {renderCoresBars()}\n {renderNodesBars()}\n </ChartStack>\n </Chart>\n </div>\n </div>\n );\n};\n","title":"Monthly data with responsive container","lang":"ts","className":""}}>
1013
+
1014
+ </Example>,
1015
+ 'Multi-color (unordered) responsive container': props =>
1016
+ <Example {...pageData} {...props} {...{"code":"import {\n Chart,\n ChartArea,\n ChartAxis,\n ChartStack,\n ChartLegendTooltip,\n ChartThemeColor,\n createContainer\n} from '@patternfly/react-charts/victory';\nimport { getResizeObserver } from '@patternfly/react-core';\nimport { useEffect, useRef, useState } from 'react';\n\ninterface Data {\n x: string;\n y: number;\n}\n\nexport const ChartStackMultiColorUnordered: React.FunctionComponent = () => {\n const containerRef = useRef(null);\n const observer = useRef(() => {});\n const [width, setWidth] = useState(0);\n\n const handleResize = () => {\n if (containerRef.current && containerRef.current.clientWidth) {\n setWidth(containerRef.current.clientWidth);\n }\n };\n\n useEffect(() => {\n observer.current = getResizeObserver(containerRef.current, handleResize);\n handleResize();\n\n return () => {\n observer.current();\n };\n }, []);\n\n // Note: Container order is important\n const CursorVoronoiContainer = createContainer('voronoi', 'cursor');\n const legendData = [\n { childName: 'cats', name: 'Cats' },\n { childName: 'dogs', name: 'Dogs' },\n { childName: 'birds', name: 'Birds' }\n ];\n const data1: Data[] = [\n { x: 'Sunday', y: 6 },\n { x: 'Monday', y: 2 },\n { x: 'Tuesday', y: 8 },\n { x: 'Wednesday', y: 15 },\n { x: 'Thursday', y: 6 },\n { x: 'Friday', y: 2 },\n { x: 'Saturday', y: 0 }\n ];\n const data2: Data[] = [\n { x: 'Sunday', y: 4 },\n { x: 'Monday', y: 5 },\n { x: 'Tuesday', y: 7 },\n { x: 'Wednesday', y: 6 },\n { x: 'Thursday', y: 10 },\n { x: 'Friday', y: 3 },\n { x: 'Saturday', y: 5 }\n ];\n const data3: Data[] = [\n { x: 'Sunday', y: 8 },\n { x: 'Monday', y: 18 },\n { x: 'Tuesday', y: 14 },\n { x: 'Wednesday', y: 8 },\n { x: 'Thursday', y: 6 },\n { x: 'Friday', y: 8 },\n { x: 'Saturday', y: 12 }\n ];\n\n return (\n <div ref={containerRef}>\n <div style={{ height: '225px' }}>\n <Chart\n ariaDesc=\"Average number of pets\"\n ariaTitle=\"Area chart example\"\n containerComponent={\n <CursorVoronoiContainer\n cursorDimension=\"x\"\n labels={({ datum }) => `${datum.y !== null ? datum.y : 'no data'}`}\n labelComponent={<ChartLegendTooltip legendData={legendData} title={(datum) => datum.x} />}\n mouseFollowTooltips\n voronoiDimension=\"x\"\n voronoiPadding={50}\n />\n }\n legendData={legendData}\n legendPosition=\"bottom-left\"\n height={225}\n name=\"chart5\"\n padding={{\n bottom: 75, // Adjusted to accomodate legend\n left: 50,\n right: 50,\n top: 50\n }}\n maxDomain={{ y: 30 }}\n themeColor={ChartThemeColor.multiUnordered}\n width={width}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartStack>\n <ChartArea data={data1} interpolation=\"monotoneX\" name=\"cats\" />\n <ChartArea data={data2} interpolation=\"monotoneX\" name=\"dogs\" />\n <ChartArea data={data3} interpolation=\"monotoneX\" name=\"birds\" />\n </ChartStack>\n </Chart>\n </div>\n </div>\n );\n};\n","title":"Multi-color (unordered) responsive container","lang":"ts","className":""}}>
1017
+
1018
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1019
+ {`This demonstrates monthly data with a bottom aligned legend and responsiveness for mobile.`}
1020
+ </p>
1021
+ </Example>
1022
+ };
1023
+
1024
+ const Component = () => (
1025
+ <React.Fragment>
1026
+ <AutoLinkHeader {...{"id":"introduction","headingLevel":"h2","className":"ws-title ws-h2"}}>
1027
+ {`Introduction`}
1028
+ </AutoLinkHeader>
1029
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1030
+ {`Note: PatternFly React charts live in its own package at `}
1031
+ <PatternflyThemeLink {...{"to":"https://www.npmjs.com/package/@patternfly/react-charts","className":""}}>
1032
+ {`@patternfly/react-charts`}
1033
+ </PatternflyThemeLink>
1034
+ {`!`}
1035
+ </p>
1036
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1037
+ {`The examples below are based on the `}
1038
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-chart/","className":""}}>
1039
+ {`Victory`}
1040
+ </PatternflyThemeLink>
1041
+ {` 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.`}
1042
+ </p>
1043
+ <AutoLinkHeader {...{"id":"examples","headingLevel":"h2","className":"ws-title ws-h2"}}>
1044
+ {`Examples`}
1045
+ </AutoLinkHeader>
1046
+ {React.createElement(pageData.examples["Basic with right aligned legend"])}
1047
+ {React.createElement(pageData.examples["Horizontal with bottom aligned legend"])}
1048
+ {React.createElement(pageData.examples["Multi-color (ordered) horizontal with bottom aligned legend"])}
1049
+ {React.createElement(pageData.examples["Monthly data with responsive container"])}
1050
+ {React.createElement(pageData.examples["Multi-color (unordered) responsive container"])}
1051
+ <AutoLinkHeader {...{"id":"documentation","headingLevel":"h2","className":"ws-title ws-h2"}}>
1052
+ {`Documentation`}
1053
+ </AutoLinkHeader>
1054
+ <AutoLinkHeader {...{"id":"tips","headingLevel":"h3","className":"ws-title ws-h3"}}>
1055
+ {`Tips`}
1056
+ </AutoLinkHeader>
1057
+ <ul {...{"className":"pf-v6-c-content--ul pf-m-editorial ws-ul "}}>
1058
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1059
+ {`See Victory's `}
1060
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/faq","className":""}}>
1061
+ {`FAQ`}
1062
+ </PatternflyThemeLink>
1063
+ </li>
1064
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1065
+ {`For single data points or zero values, you may want to set the `}
1066
+ <code {...{"className":"ws-code "}}>
1067
+ {`domain`}
1068
+ </code>
1069
+ {` prop`}
1070
+ </li>
1071
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1072
+ <code {...{"className":"ws-code "}}>
1073
+ {`ChartLegend`}
1074
+ </code>
1075
+ {` may be used as a standalone component, instead of using `}
1076
+ <code {...{"className":"ws-code "}}>
1077
+ {`legendData`}
1078
+ </code>
1079
+ </li>
1080
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1081
+ {`Themes are inherited, so a default theme may override `}
1082
+ <code {...{"className":"ws-code "}}>
1083
+ {`themeColor`}
1084
+ </code>
1085
+ {` for a child component`}
1086
+ </li>
1087
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1088
+ {`The `}
1089
+ <code {...{"className":"ws-code "}}>
1090
+ {`theme`}
1091
+ </code>
1092
+ {` and `}
1093
+ <code {...{"className":"ws-code "}}>
1094
+ {`themeColor`}
1095
+ </code>
1096
+ {` props should be applied at the most top level component`}
1097
+ </li>
1098
+ </ul>
1099
+ <AutoLinkHeader {...{"id":"note","headingLevel":"h3","className":"ws-title ws-h3"}}>
1100
+ {`Note`}
1101
+ </AutoLinkHeader>
1102
+ <p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
1103
+ {`Currently, the generated documentation below is not able to resolve type definitions from Victory imports. For the
1104
+ components used in the examples above, Victory pass-thru props are also documented here:`}
1105
+ </p>
1106
+ <ul {...{"className":"pf-v6-c-content--ul pf-m-editorial ws-ul "}}>
1107
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1108
+ {`For `}
1109
+ <code {...{"className":"ws-code "}}>
1110
+ {`Chart`}
1111
+ </code>
1112
+ {` props, see `}
1113
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-chart","className":""}}>
1114
+ {`VictoryChart`}
1115
+ </PatternflyThemeLink>
1116
+ </li>
1117
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1118
+ {`For `}
1119
+ <code {...{"className":"ws-code "}}>
1120
+ {`ChartArea`}
1121
+ </code>
1122
+ {` props, see `}
1123
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-area","className":""}}>
1124
+ {`VictoryArea`}
1125
+ </PatternflyThemeLink>
1126
+ </li>
1127
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1128
+ {`For `}
1129
+ <code {...{"className":"ws-code "}}>
1130
+ {`ChartAxis`}
1131
+ </code>
1132
+ {` props, see `}
1133
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-axis","className":""}}>
1134
+ {`VictoryAxis`}
1135
+ </PatternflyThemeLink>
1136
+ </li>
1137
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1138
+ {`For `}
1139
+ <code {...{"className":"ws-code "}}>
1140
+ {`ChartBar`}
1141
+ </code>
1142
+ {` props, see `}
1143
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-bar","className":""}}>
1144
+ {`VictoryBar`}
1145
+ </PatternflyThemeLink>
1146
+ </li>
1147
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1148
+ {`For `}
1149
+ <code {...{"className":"ws-code "}}>
1150
+ {`ChartStack`}
1151
+ </code>
1152
+ {` props, see `}
1153
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-stack","className":""}}>
1154
+ {`VictoryStack`}
1155
+ </PatternflyThemeLink>
1156
+ </li>
1157
+ <li {...{"className":"pf-v6-c-content--li pf-m-editorial ws-li "}}>
1158
+ {`For `}
1159
+ <code {...{"className":"ws-code "}}>
1160
+ {`ChartTooltip`}
1161
+ </code>
1162
+ {` props, see `}
1163
+ <PatternflyThemeLink {...{"to":"https://formidable.com/open-source/victory/docs/victory-tooltip","className":""}}>
1164
+ {`VictoryTooltip`}
1165
+ </PatternflyThemeLink>
1166
+ </li>
1167
+ </ul>
1168
+ </React.Fragment>
1169
+ );
1170
+ Component.displayName = 'ComponentsChartsStackChart-VictoryDocs';
1171
+ Component.pageData = pageData;
1172
+
1173
+ export default Component;