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

spline-wrapper-qm

v0.1.0

Published

[`react-map-gl`](https://github.com/visgl/react-map-gl) [`mapbox`](https://www.mapbox.com/)

Downloads

7

Readme

Spline Wrapper

react-map-gl mapbox

An unofficial plugin component for react-map-gl

Available functions

  • Create curved lines (No more straight lines with sharp corners! 😉)
  • Add arrow to start/center/end of lines (Hopefully, this is helpful! 🥳)

Here is a screenshot of the output after using both functions provided: image
Run this project to see the demo! (Don't forget to add the token and map style first)

Props

|Props|Description| |-----|-----------| |children| Source component| |arrow| {icon, position} object where icon sets the loaded arrow image's name and position can be set to either start,center or end| |lines| array of {from:[longitude, latitude], to:[longitude, latitude], properties:{}}|

Getting Started

Setup

How to use SplineWrapper

  • Import the component: import SplineWrapper from "spline-wrapper"
  • Already have an existing Source and Layer components? Don't have them yet? Not an issue! 😉
<Map>
  <SplineWrapper>
    //Copy&Paste or Create your Source and Layer components here
    <Source data={data}>
      <Layer/>
      ...
    </Source>
  </SplineWrapper>
</Map
<SplineWrapper arrow={{
  icon:"arrow", // Pass the name of the loaded/added arrow image
  position:"start" // Can be either start, center or end
}}>
  ...
</SplineWrapper>
  • Want curvy lines? Use lines props:
const lines = [
  {
    from:[51.5072, -0.1276],  // longitude, latitude
    to:[48.8566, 2.3522],     // longitude, latitude
    properties:{...}  // optional
  },
  {
    from:[48.8566, 2.3522],  // longitude, latitude
    to:[4.2105, 101.9758],     // longitude, latitude
    properties:{...}  // optional
  }
]
<SplineWrapper lines={lines}>
  ...
</SplineWrapper>

Still confused? Check out the example here 😁

Notes 📝

  • There is no control points prop (to control the curve level/intensity) available at the moment but might be added if lots of people need it
  • Curves are only applied to lines generated from the lines prop
  • Load and add icon image before passing the name to arrow prop
  • The arrows are applied to every feature of type LineString (including those generated from lines prop)
  • The arrow points to the direction of the line
  • Since this is just a wrapper component, you should have almost full control over react-map-gl related uses

Enjoy this wrapper component!

Getting Started with Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.