Skip to content

Commit 8daee62

Browse files
committed
update to react 16, add props for ts
1 parent 3b970c5 commit 8daee62

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ render(){
5252
]
5353
};
5454
return (
55-
<PlotlyChart data={toJS(this.model_data)}
55+
<PlotlyChart data={data}
5656
layout={layout}
5757
onClick={({points, event}) => console.log(points, event)}> )
5858
}

dist/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/// <reference types="react" />
22
import * as React from 'react';
33
export interface IPlotlyChartProps {
4+
className?: any;
5+
config?: any;
46
data: any[];
57
layout?: any;
6-
config?: any;
78
onClick?: (data: {
89
points: any;
910
event: any;
@@ -24,6 +25,7 @@ export interface IPlotlyChartProps {
2425
points: any;
2526
event: any;
2627
}) => any;
28+
style?: any;
2729
}
2830
/***
2931
* Usage:

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-plotlyjs-ts",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"description": "Typescript-React component for Plotly.js",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -22,15 +22,15 @@
2222
"lodash": "^4.17.4"
2323
},
2424
"peerDependencies": {
25-
"plotly.js": "^1.30.0",
26-
"react": "^15.6.1",
27-
"react-dom": "^15.6.1",
28-
"typescript": "^2.5.2"
25+
"plotly.js": "^1.31.2",
26+
"react": "^16.0.0",
27+
"react-dom": "^16.0.0",
28+
"typescript": "^2.5.3"
2929
},
3030
"devDependencies": {
31-
"@types/lodash": "^4.14.74",
32-
"@types/plotly.js": "^1.28.4",
33-
"@types/react": "^16.0.5",
34-
"@types/react-dom": "^15.5.4"
31+
"@types/lodash": "^4.14.80",
32+
"@types/plotly.js": "^1.28.8",
33+
"@types/react": "^16.0.18",
34+
"@types/react-dom": "^16.0.2"
3535
}
3636
}

src/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ import * as plotlyInstance from 'plotly.js/dist/plotly.js';
33
import {cloneDeep} from 'lodash';
44

55
export interface IPlotlyChartProps {
6+
className?: any;
7+
config?: any;
68
data: any[];
79
layout?: any;
8-
config?: any;
910
onClick?: (data: { points: any, event: any }) => any;
1011
onBeforeHover?: (data: { points: any, event: any }) => any;
1112
onHover?: (data: { points: any, event: any }) => any;
1213
onUnHover?: (data: { points: any, event: any }) => any;
1314
onSelected?: (data: { points: any, event: any }) => any;
15+
style?: any;
1416
}
1517

1618
/***

0 commit comments

Comments
 (0)