Skip to content

Commit 6a472f3

Browse files
author
Coltin Kifer
committed
feat: upgrade recharts, add new event handler props on categorical charts
1 parent f108585 commit 6a472f3

File tree

11 files changed

+159
-12
lines changed

11 files changed

+159
-12
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"react-router-redux": "~4.0.7",
6363
"react-router-scroll": "~0.4.1",
6464
"react-runner": "^1.0.3",
65-
"recharts": "^2.13.3",
65+
"recharts": "^2.14.0",
6666
"redux": "4.0.0",
6767
"redux-thunk": "^2.3.0",
6868
"rimraf": "^2.5.4",

src/docs/api/AreaChart.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default {
3939
isOptional: true,
4040
desc: {
4141
'en-US':
42-
"When syncId is provided, allows customisation of how the charts will synchronize tooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index."
42+
"When syncId is provided, allows customisation of how the charts will synchronize tooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index.",
4343
},
4444
},
4545
{
@@ -152,6 +152,22 @@ export default {
152152
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
153153
},
154154
},
155+
{
156+
name: 'onDoubleClick',
157+
type: 'Function',
158+
isOptional: true,
159+
desc: {
160+
'en-US': 'The customized event handler of dblclick in this chart.',
161+
},
162+
},
163+
{
164+
name: 'onContextMenu',
165+
type: 'Function',
166+
isOptional: true,
167+
desc: {
168+
'en-US': 'The customized event handler of contextmenu in this chart.',
169+
},
170+
},
155171
],
156172
parentComponents: ['ResponsiveContainer'],
157173
childrenComponents: [

src/docs/api/BarChart.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,22 @@ export default {
203203
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
204204
},
205205
},
206+
{
207+
name: 'onDoubleClick',
208+
type: 'Function',
209+
isOptional: true,
210+
desc: {
211+
'en-US': 'The customized event handler of dblclick in this chart.',
212+
},
213+
},
214+
{
215+
name: 'onContextMenu',
216+
type: 'Function',
217+
isOptional: true,
218+
desc: {
219+
'en-US': 'The customized event handler of contextmenu in this chart.',
220+
},
221+
},
206222
],
207223
parentComponents: ['ResponsiveContainer'],
208224
childrenComponents: [

src/docs/api/ComposedChart.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
isOptional: true,
3838
desc: {
3939
'en-US':
40-
"When syncId is provided, allows customisation of how the charts will synchronize tooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index."
40+
"When syncId is provided, allows customisation of how the charts will synchronize tooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index.",
4141
},
4242
},
4343
{
@@ -172,6 +172,22 @@ export default {
172172
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
173173
},
174174
},
175+
{
176+
name: 'onDoubleClick',
177+
type: 'Function',
178+
isOptional: true,
179+
desc: {
180+
'en-US': 'The customized event handler of dblclick in this chart.',
181+
},
182+
},
183+
{
184+
name: 'onContextMenu',
185+
type: 'Function',
186+
isOptional: true,
187+
desc: {
188+
'en-US': 'The customized event handler of contextmenu in this chart.',
189+
},
190+
},
175191
],
176192
parentComponents: ['ResponsiveContainer'],
177193
childrenComponents: [

src/docs/api/FunnelChart.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ export default {
7878
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
7979
},
8080
},
81+
{
82+
name: 'onDoubleClick',
83+
type: 'Function',
84+
isOptional: true,
85+
desc: {
86+
'en-US': 'The customized event handler of dblclick in this chart.',
87+
},
88+
},
89+
{
90+
name: 'onContextMenu',
91+
type: 'Function',
92+
isOptional: true,
93+
desc: {
94+
'en-US': 'The customized event handler of contextmenu in this chart.',
95+
},
96+
},
8197
],
8298
parentComponents: ['ResponsiveContainer'],
8399
childrenComponents: ['Funnel', 'Legend', 'Tooltip', 'Customized', 'validate svg elements...'],

src/docs/api/LineChart.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
isOptional: true,
3636
desc: {
3737
'en-US':
38-
"When syncId is provided, allows customisation of how the charts will synchronize tooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index."
38+
"When syncId is provided, allows customization of how the charts will synchronize tooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index.",
3939
},
4040
},
4141
{
@@ -116,6 +116,22 @@ export default {
116116
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
117117
},
118118
},
119+
{
120+
name: 'onDoubleClick',
121+
type: 'Function',
122+
isOptional: true,
123+
desc: {
124+
'en-US': 'The customized event handler of dblclick in this chart.',
125+
},
126+
},
127+
{
128+
name: 'onContextMenu',
129+
type: 'Function',
130+
isOptional: true,
131+
desc: {
132+
'en-US': 'The customized event handler of contextmenu in this chart.',
133+
},
134+
},
119135
],
120136
parentComponents: ['ResponsiveContainer'],
121137
childrenComponents: [

src/docs/api/PieChart.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ export default {
6565
'饼图每个楔子的 mouseleave 事件的回调函数,如果当子组件 Pie 上也绑定了同样的事件,子组件的事件回调函数才会被绑定。',
6666
},
6767
},
68+
{
69+
name: 'onDoubleClick',
70+
type: 'Function',
71+
isOptional: true,
72+
desc: {
73+
'en-US': 'The customized event handler of dblclick in this chart.',
74+
},
75+
},
76+
{
77+
name: 'onContextMenu',
78+
type: 'Function',
79+
isOptional: true,
80+
desc: {
81+
'en-US': 'The customized event handler of contextmenu in this chart.',
82+
},
83+
},
6884
],
6985
parentComponents: ['ResponsiveContainer'],
7086
childrenComponents: [

src/docs/api/RadarChart.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ export default {
3030
'en-US': 'The source data, in which each element is an object.',
3131
'zh-CN': '输入数据,现在支持的类型是对象数组。',
3232
},
33-
format: ["[{ 'subject': 'a', 'key': 120, 'fullMark': 150 }]", "[{ 'subject': 'a', 'key': 100, 'secondKey': 50, 'fullMark': 150 }]"],
33+
format: [
34+
"[{ 'subject': 'a', 'key': 120, 'fullMark': 150 }]",
35+
"[{ 'subject': 'a', 'key': 100, 'secondKey': 50, 'fullMark': 150 }]",
36+
],
3437
},
3538
{
3639
name: 'cx',
@@ -152,6 +155,22 @@ export default {
152155
'zh-CN': '雷达图 click 事件的回调函数。',
153156
},
154157
},
158+
{
159+
name: 'onDoubleClick',
160+
type: 'Function',
161+
isOptional: true,
162+
desc: {
163+
'en-US': 'The customized event handler of dblclick in this chart.',
164+
},
165+
},
166+
{
167+
name: 'onContextMenu',
168+
type: 'Function',
169+
isOptional: true,
170+
desc: {
171+
'en-US': 'The customized event handler of contextmenu in this chart.',
172+
},
173+
},
155174
],
156175
parentComponents: ['ResponsiveContainer'],
157176
childrenComponents: [

src/docs/api/RadialBarChart.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ export default {
171171
'每个柱条的 click 事件的回调函数,如果当子组件 RadialBar 上也绑定了同样的事件,子组件的事件回调函数才会被绑定。',
172172
},
173173
},
174+
{
175+
name: 'onDoubleClick',
176+
type: 'Function',
177+
isOptional: true,
178+
desc: {
179+
'en-US': 'The customized event handler of dblclick in this chart.',
180+
},
181+
},
182+
{
183+
name: 'onContextMenu',
184+
type: 'Function',
185+
isOptional: true,
186+
desc: {
187+
'en-US': 'The customized event handler of contextmenu in this chart.',
188+
},
189+
},
174190
],
175191
parentComponents: ['ResponsiveContainer'],
176192
childrenComponents: [

0 commit comments

Comments
 (0)