npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-bezier-curve-editor

v2.1.0

Published

Simple bezier curve editor built with React

Downloads

1,439

Readme

React Bezier Curve Editor

Customizable React Bezier Curve editor for easings and more. Default styling inspired by cubic-bezier

Usage

import { BezierCurveEditor } from 'react-bezier-curve-editor`;

<BezierCurveEditor />

Props

| Name | Description | Default value | | ---------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------- | | size | This defines the width and the height of the control. | 200 | | | The final width/height of the component will be slightly larger because of the outerAreaSize and spacings | | | outerAreaSize | The extra height above and below the editor. This is necessary for creating elastic curves | 50 | | outerAreaColor | The background color of the outer area | #fafafa | | innerAreaColor | The background color of the actual editor area | #ffffff | | rowColor | The background color of the rows in the editor area | #f2f2f2 | | strokeWidth | The width of the bezier curve stroke | 2 | | curveLineColor | The stroke color of the bezier curve | #000 | | fixedHandleColor | The background color of the curve fixed curve handle colors (start and end point) | #fff | | handleLineColor | The stroke color of the handle lines. This also affects the stroke of the fixed handles | #969696 | | startHandleColor | The color of the start point curve handle | #f08 | | endHandleColor | The color of the end point curve handle | #0ab | | startHandleClassName | The className of the start handle | | | startHandleActiveClassName | Class to apply for active state of start handle | | | endHandleClassName | The className of the end handle | | | endHandleActiveClassName | Class to apply for active state of end handle | | | fixedPointActiveClassName | Class to apply for active state of fixed points | | | value | The current bezier curve value | [.4,0,1,.6] | | onChange | The onChange handler (takes bezier curve value array as parameter) | | |allowNodeEditing | Whether or not the left and right nodes can be moved by the user | false |

Theming

Theming can be done by either overriding the class names or the CSS variables. Below is a list of the CSS variables used:

:root {
  --bce-sizes-curve-handle: 16px;
  --bce-padding-sm: 4px;
  --bce-padding-md: 8px;
  --bce-padding-lg: 12px;
  --bce-padding-xl: 16px;
  --bce-colors-handle-line: #969696;
  --bce-colors-curve-line: black;
  --bce-colors-row: #f2f2f2;
  --bce-colors-background: white;
  --bce-colors-outerarea: #fafafa;
  --bce-colors-axisline: black;
  --bce-colors-handle-fixed: white;
  --bce-colors-handle-start: #f08;
  --bce-colors-handle-end: #0ab;
  --bce-colors-preview: white;
  --bce-colors-preview-border: black;
  --bce-colors-handle-active-shadow: rgba(255, 255, 255, 0.7);
}

Accessibility

For now, this library doesn't handle the accessibility in any special way intentionally. Google Chrome has zero support for screen readers in Bezier curve editors in the developer tools, which was our only idea for how to model this component for a11y.

At present, we would suggest that you provide a toggle-able alternative experience for keyboard users as well as users who don't have access to a fine pointer device.