Skip to content

Commit

Permalink
feat: upgrade recharts, add new event handler props on categorical ch…
Browse files Browse the repository at this point in the history
…arts
  • Loading branch information
Coltin Kifer committed Dec 2, 2024
1 parent f108585 commit 6a472f3
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"react-router-redux": "~4.0.7",
"react-router-scroll": "~0.4.1",
"react-runner": "^1.0.3",
"recharts": "^2.13.3",
"recharts": "^2.14.0",
"redux": "4.0.0",
"redux-thunk": "^2.3.0",
"rimraf": "^2.5.4",
Expand Down
18 changes: 17 additions & 1 deletion src/docs/api/AreaChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
isOptional: true,
desc: {
'en-US':
"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."
"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.",
},
},
{
Expand Down Expand Up @@ -152,6 +152,22 @@ export default {
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down
16 changes: 16 additions & 0 deletions src/docs/api/BarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,22 @@ export default {
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down
18 changes: 17 additions & 1 deletion src/docs/api/ComposedChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
isOptional: true,
desc: {
'en-US':
"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."
"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.",
},
},
{
Expand Down Expand Up @@ -172,6 +172,22 @@ export default {
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down
16 changes: 16 additions & 0 deletions src/docs/api/FunnelChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ export default {
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: ['Funnel', 'Legend', 'Tooltip', 'Customized', 'validate svg elements...'],
Expand Down
18 changes: 17 additions & 1 deletion src/docs/api/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
isOptional: true,
desc: {
'en-US':
"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."
"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.",
},
},
{
Expand Down Expand Up @@ -116,6 +116,22 @@ export default {
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down
16 changes: 16 additions & 0 deletions src/docs/api/PieChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ export default {
'饼图每个楔子的 mouseleave 事件的回调函数,如果当子组件 Pie 上也绑定了同样的事件,子组件的事件回调函数才会被绑定。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down
21 changes: 20 additions & 1 deletion src/docs/api/RadarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export default {
'en-US': 'The source data, in which each element is an object.',
'zh-CN': '输入数据,现在支持的类型是对象数组。',
},
format: ["[{ 'subject': 'a', 'key': 120, 'fullMark': 150 }]", "[{ 'subject': 'a', 'key': 100, 'secondKey': 50, 'fullMark': 150 }]"],
format: [
"[{ 'subject': 'a', 'key': 120, 'fullMark': 150 }]",
"[{ 'subject': 'a', 'key': 100, 'secondKey': 50, 'fullMark': 150 }]",
],
},
{
name: 'cx',
Expand Down Expand Up @@ -152,6 +155,22 @@ export default {
'zh-CN': '雷达图 click 事件的回调函数。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down
16 changes: 16 additions & 0 deletions src/docs/api/RadialBarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,22 @@ export default {
'每个柱条的 click 事件的回调函数,如果当子组件 RadialBar 上也绑定了同样的事件,子组件的事件回调函数才会被绑定。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down
16 changes: 16 additions & 0 deletions src/docs/api/ScatterChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@ export default {
'zh-CN': '鼠标在图表图形区域 mouseleave 事件的回调函数。',
},
},
{
name: 'onDoubleClick',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of dblclick in this chart.',
},
},
{
name: 'onContextMenu',
type: 'Function',
isOptional: true,
desc: {
'en-US': 'The customized event handler of contextmenu in this chart.',
},
},
],
parentComponents: ['ResponsiveContainer'],
childrenComponents: [
Expand Down

0 comments on commit 6a472f3

Please sign in to comment.