Understanding makeInteractive in 0.5
See original GitHub issueIf I understand the changes correctly, the desired way to interact with a makeInteractive component is to pass in interactiveState, which is controlled by the component?
In the render method, the interactiveState is a property:
render() {
var { enabled, endPointCircleFill, endPointCircleRadius } = this.props;
var { xScale, chartConfig, plotData, xAccessor, interactiveState, show } = this.props;
...
https://github.com/rrag/react-stockcharts/blob/master/src/lib/interactive/TrendLine.jsx#L266
Also defined as a property Type
interactiveState: PropTypes.object,
So if we are using trendline, and wanted to “load” in previously saved data (eg trends[] array), is interactiveState the best way to reflect that?
(pretend I have 2 lines that I have saved...)
var myTrends={trends: [{ start: [Ax1, Ay1], end: [Bx2, By2] }, { start: [Cx1, Cy1], end: [Cx2, Cy2] }]}
render(){
<EventCapture mouseMove zoom pan>
<TrendLine forChart={1} id={1} ref="trend"
enabled={this.state.enableTrendLine}
type="LINE"
interactiveState={myTrends}
snap={true} snapTo={d => [d.high, d.low]}
onStart={() => console.log("START")}
onComplete={this.onTrendLineComplete}
/>
</EventCapture>
}
I am stumbling understanding the different usages of
- overrideInteractive
- state.interactiveState
- props.interactiveState
- interactive where they are applicable, seems like there were many changes
I guess just wondering is there a brief description out there about the rational, so I can understand it better?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Interactive Visualizations — umap 0.5 documentation
It is interactive, letting you switch between 2D and 3D representations and has a wide selection of different animals. Attempting to guess the...
Read more >Create Basic Interactive Response Questions - SYLVA
Interactive response questions focus on the student's thought process and help them gain intuition through hands-on interactivity.
Read more >Essentials: Adopting Interactive Content - Top Hat Support
By default, all Top Hat questions are graded with 0.5 points to correctness, and 0.5 points to participation. These default weights are added ......
Read more >Understanding Correlations - R Psychologist
An interactive app to visualize and understand standardized effect sizes.
Read more >Interactive Data Visualization in Python With Bokeh
This Python tutorial will get you up and running with Bokeh, using examples and a real-world dataset. You'll learn how to visualize your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just wanted to contribute a small plunkr about this for others, which to my understanding is the correct way to load in previous trends[]
https://plnkr.co/edit/e42l6Dk7NaHFHLS3PkIQ?p=info
I am not sure how to directly get access to the EventHandler interactiveState array, without modification to the library.
https://github.com/rrag/react-stockcharts/blob/master/src/lib/EventHandler.js#L58
so I am not sure how the sample code you provided would apply, maybe a plunkr would help if you can make one
instead I have resorted to using the getInteractiveState setInteractiveState methods provided by the Trendline component
this is a clever use of props to override the default behavior. Thanks for sharing. Please use this till a better solution comes out in
0.6