All Projects → AlexSugak → react-svg-pathline

AlexSugak / react-svg-pathline

Licence: other
React component for drawing SVG path through set of points, smoothing the corners

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-svg-pathline

react-svg-curve
React components to draw different types of curves with svg
Stars: ✭ 42 (+0%)
Mutual labels:  path, smooth
gab-cmdline
A GABStudios Java library to help with command line parsing.
Stars: ✭ 12 (-71.43%)
Mutual labels:  line
pyne
LINE for Python
Stars: ✭ 18 (-57.14%)
Mutual labels:  line
array-keyed-map
JS datastructure, like Map, but the keys are arrays
Stars: ✭ 29 (-30.95%)
Mutual labels:  path
path-replace-loader
Path replace loader for webpack
Stars: ✭ 14 (-66.67%)
Mutual labels:  path
groupoid.space
🧊 Інститут Формальної Математики
Stars: ✭ 35 (-16.67%)
Mutual labels:  path
line-bot-sdk
🍥 Haskell向けLINE Messaging API SDK
Stars: ✭ 31 (-26.19%)
Mutual labels:  line
linenotify
Template for LINE Notify service in Golang
Stars: ✭ 18 (-57.14%)
Mutual labels:  line
CHRLINE
LINE Chrome API
Stars: ✭ 41 (-2.38%)
Mutual labels:  line
line-example-bot-tiny-php
Line Bot 基礎範例程式碼教學 (PHP) - 輕量版 LINEBotTiny.php
Stars: ✭ 58 (+38.1%)
Mutual labels:  line
clova-cek-sdk-python
SDK of the Clova CEK for Python
Stars: ✭ 19 (-54.76%)
Mutual labels:  line
text-sdk-php
PHP SDK to send messages with CM.com
Stars: ✭ 18 (-57.14%)
Mutual labels:  line
STPathTextField
Subclass of NSTextField that supports shell and browser-style path autocompletion
Stars: ✭ 17 (-59.52%)
Mutual labels:  path
regl-line
Flat 2D and 3D line rending with Regl for WebGL
Stars: ✭ 44 (+4.76%)
Mutual labels:  line
path-absolutize
A library for extending `Path` and `PathBuf` in order to get an absolute path and remove the containing dots.
Stars: ✭ 37 (-11.9%)
Mutual labels:  path
LINE-Source
Line Application Source
Stars: ✭ 43 (+2.38%)
Mutual labels:  line
SonogramView
Audio visualisation of song
Stars: ✭ 65 (+54.76%)
Mutual labels:  path
scripts
Small, useful platform-agnostic scripts (mostly just for Linux) that don't justify having their own repo
Stars: ✭ 25 (-40.48%)
Mutual labels:  smooth
SimpleCLI
Command Line Interface Library for Arduino
Stars: ✭ 197 (+369.05%)
Mutual labels:  line
llvm-epp
Efficient Path Profiling using LLVM
Stars: ✭ 16 (-61.9%)
Mutual labels:  path

react-svg-pathline

React component for drawing SVG path through set of points, smoothing the corners

Why?

SVG polyline is the simplest option for rendering "path" line through set of known points but it gives you a "broken" line with sharp corners. Using SVG path you can get smooth corners but it requires adding more points to original set. This component helps with rendering SVG path by generating correct SVG data from original set of points, producing "smooth path line" as result.

So instead of this:

    <svg>
        <polyline 
            points="0,0 125,0 125,125 250,125"  
            stroke="red" 
            strokeWidth="3"
            fill="none" />
    </svg>

polyline

You get this:

import React from 'react'
import {PathLine} from 'react-svg-pathline'

export class MyComponent extends React.Component {
  render() (
    <svg>
        <PathLine 
            points={[{x:0, y:0}, {x:125, y: 0}, {x:125, y:125}, {x:250, y:125}]} 
            stroke="red" 
            strokeWidth="3"
            fill="none"
            r={10}
            />
    </svg>
  )
}

pathline

Installation

Requires nodejs.

$ npm install react-svg-pathline

Live Example

$ npm i && npm i react react-dom && npm start

Open a browser at localhost:8080

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].