Can I use @stdlib/plot in React application? #1037
Unanswered
romanstetsyk
asked this question in
stdlib-bot Q&A
Replies: 1 comment
-
Yes, you can use @stdlib/plot in a React application. The following example shows a React component which renders a rug plot: import React from 'react';
import { Rug } from '@stdlib/plot/components/svg/rug';
class RugPlot extends React.Component {
constructor( props ) {
super( props );
this.state = {
data: [ 1, 2, 3, 4 ]
};
this.handleChange = this.handleChange.bind( this );
}
handleChange() {
this.setState({
data: [ 5, 6, 7, 8 ]
});
}
render() {
return (
<Rug data={ this.state.data } onChange={ this.handleChange } />
);
}
} ReferencesDisclaimer
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can I use @stdlib/plot in React application? If so, could you provide a sample component?
Beta Was this translation helpful? Give feedback.
All reactions