Skip to content

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

License

Notifications You must be signed in to change notification settings

williamngan/react-pts-canvas-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pts-react-example

This repo provides an example of using react-pts-canvas with Vite. The example code will also work with create-react-app if you prefer it over Vite.

please refer to documentations in react-pts-canvas repo for details.

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

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";

Legacy class component is deprecated in react-pts-canvas v0.4. If you still need it, use v0.3.x and take a look at the code in legacy folder.

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published