• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An example project of using Pts with React, using react-pts-canvas package.

pts-react-example

This repo provides an example of using Pts in React via react-pts-canvas.

Pts is a typescript/javascript library for visualization and creative-coding. Get started at ptsjs.org.

Let's take a look at the demo first before we start.

screenshot

Using Pts with create-react-app

create-react-app is a popular tool by Facebook to bootstrap a React application.

To get started, take a look at the README in example folder.

Quick Start

If you just want to try out Pts, there's no need to install and build. Try out the online demo editor for quick experimentations.

Technical notes

For common use cases, you can include PtsCanvas functional component in your own component. Take a look at PtsExamples.jsx for example components.

import { PtsCanvas } from "react-pts-canvas";

If needed, you can also use the legacy class component by extending PtsCanvasLegacy.

For documentations, please refer to react-pts-canvas repo.

If you need to use Pts, you can import a class like this:

import {Pt, Create, Util} from "pts"; // use ES6

Note that Pts is an javascript es6 library that targets modern browsers. It also provides an ES5 version for use in older builds. To use ES5, import a class like this:

import {Pt} from "pts/dist/es5"; // use ES5

License

Apache License 2.0. See LICENSE file for details. Copyright Β© 2017-2018 by William Ngan and contributors.