Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can I use @stdlib/plot in React application? #1037

Unanswered
romanstetsyk asked this question in stdlib-bot Q&A
Discussion options

Can I use @stdlib/plot in React application? If so, could you provide a sample component?

You must be logged in to vote

Replies: 1 comment

Comment options

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 } />
		);
	}
}

References

Disclaimer

  • This answer was generated with the help of AI and is not guaranteed to be correct. We will review the answer and update it if necessary.
  • You can also ask follow-up questions to clarify the answer or request additional information by leaving a comment on this issue starting with /ask.
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /