3.8.84 • Published 10 months ago

@erboladaiorg/voluptates-nisi-quibusdam v3.8.84

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Build Status Coverage Status

svg-path-properties

Pure Javascript alternative to getPointAtLength(t) and getTotalLength() functions. Works with Canvas objects and when Node

JavaScript can access to path elements properties in a browser, such as its length and the point at a given length. Unfortunately, this can't be achieved using a Canvas element or when working with node. This library can be used to replace this need. It has no dependencies on other JavaScript libraries.

INSTALL

To use with npm, just type

npm install svg-path-properties

You can use it int he browser directly by including svg-path-properties.min.js from the dist directory

<script src="svg-path-properties.min.js"></script>

USAGE

The available methods are:

const path = require("svg-path-properties");
const properties = new path.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");
const length = properties.getTotalLength();
const point = properties.getPointAtLength(200);
const tangent = properties.getTangentAtLength(200);
const allProperties = properties.getPropertiesAtLength(200);
const parts = properties.getParts();

Node:

const path = require("svg-path-properties");
const properties = new path.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");

Including it from an import:

import { svgPathProperties } from "svg-path-properties";
const properties = new svgPathProperties("M0,100 Q50,-50 100,100 T200,100");

Including the script in the browser

Once the script tag has been included,

const properties = new svgPathProperties.svgPathProperties("M0,100 Q50,-50 100,100 T200,100");

Using new

Since svgPathProperties is a class, using new is the correct way to initilize it. For backwards compatibility reasons, the object can be get without it:

const properties = svgPathProperties("M0,100 Q50,-50 100,100 T200,100");

Some usage examples

Typescript

The TypeScript declaration file is available too, since version 0.5.0 From version 1.0.0, the whole library has been rewritten using TypeScript, and the types are auto-generated.

CREDITS

Some parts of the code are taken from other libraries or questions at StackOverflow:

For Bézier curves:

For path parsing:

prettyWeakMappredictableuninstallperformantprototypetouchreactsharedless compilerString.prototype.trimsortedreact-hookswaapicryptformpopmotionshellestreeiamFunction.prototype.nameglobalcall-boundutil.inspectmulti-packageeast-asian-widthexecconsumespinnerprivate dataes2018ECMAScript 2022es2017chinesehttpssignedsymbolsclonereducerproxyequalconfigurableairbnbReactiveXdescriptorsstylestoolkiteslint-pluginbincallbinddescriptionfunctionsexit-codemergeTypedArrayglobal this valuepyyamlbufferbufferssesdropiteratorterminalsnsinterruptsglobal objectmaphttpremovecss lesspromiseemrlistenersassertsguidwriteencryptionTypeBoxRFC-6455syntaxerrormodulewgetautoprefixerenvironmentstrimLeftapolloimportexportObservablefastifyECMAScript 2017bddcloudtrailstyleguidedatastructurebindstableJSONvisualforEachsuperagentzodRegExp.prototype.flagssyntaxworkertelephonepackagesiefile systemcircularsafesetPrototypeOfarrayentriesprotobufvalidatorsideyamlcolorsslicegroupByformsnegative zerogetoptlazyplugintddresolveform-validationURLtypedSymbol.toStringTagpruneInt16ArrayArray.prototype.findLastcore@@toStringTagfast-clonenodeamazonconsoleswfreadableObject.isrfc4122mobileindicatorspringless cssdirECMAScript 2016monorepoimmutableletECMAScript 2015less mixinsECMAScript 7byteOffsetcommand-lineECMAScript 2019Object.getPrototypeOfroute53astAsyncIteratorwafECMAScript 2020URLSearchParamshandlersfullwidthroutecolourvpcESUint16ArrayinferenceFloat32Arrayshebangless.jsWebSocketsescapeeventDispatcherhasOwnPropertyirqflatsymbolpositiveObject.valuesautoscalingCSStypanionsameValueZero256statusPromiseES3lrul10nerrorasyncreact posehasOwnexpressnamemixinsfilter3dhasES2017i18nfull-widthlesscsscachea11y$.extendReflect.getPrototypeOfArray.prototype.filterECMAScript 5regular expressionfpsfunctionStreamviewmake dirwidthshimpinoglobschemaHyBiprotocol-bufferstermtrimStartcodesforklanguageexecfiletraverseES2016omites2016statelessquerydeepcopyECMAScript 6queueMicrotaskquerystringiterateruntimeoncebootstrap lesstesttoArrayerror-handlingargvoptionmoveexittypesidentifierscall-bindimmercloudformationuuidcryptotoolsES7trimEndchildes-shim APIconstdynamodbcensorSystem.globallastObject.fromEntriesInt8ArraygesturesBigInt64ArrayendpointArraybinaryRxJSpureglobalThisqueueloggingflagSymbolsubprocesselectronclassnamebinariesxtermes6ECMAScript 2023ES2021importgitignoreECMAScript 2018takeArray.prototype.findLastIndexasciipolyfillaccessibilityStyleSheetglobalsapiclientgraphqlscheme-validationchromiumexecutefullBigUint64Arraydiffreduxrandomuser-streamsstylejson-schema-validationbyteES2020boundpasswordartObject.definePropertydeep-copyvaluevaluescss nestingES2018formatarktypewindowsfnmatchUint8ArraycliregularthreeparsingchromefindLastminimalajv[[Prototype]]efficientshrinkwrapcommanderslotreadablestreamassertionhigher-orderInt32Arrayeffect-tsstringifyauthvalidlockfilezerowritablejQuerysqses7statereact-hook-formgradients cssbootstrap cssfixed-widthwhatwgstructuredClonetranspilehelperoptimizercollection.es6typescriptbabel-coresettingsES8ignorenodejssigtermgetterjsonschemabrowserlistredux-toolkitMapbcryptclassesObject.keyscssbannerjshintclassnamesdataviewpushchecknested cssfetchfast-copyhookformgetintrinsicfastcopypatchjson-schema-validatorvalidationpreprocessorutilityreusesharedarraybuffermruoptimistpipefindLastIndexcallmakeinternaldeepcloudwatchObjectIteratortoSortedtypesafelessreversemkdirpxhrhas-ownes5awesomesauceoperating-systemTypeScriptdeep-clonetypeerrorextradataViewoutputreact-testing-libraryjestlinknamesReactiveExtensionsstoragegatewayFloat64Arraydragsignalharmonyttyio-tsparserstringifierspinnersidleECMAScript 2021intrinsicutilitiescreatelengthES2022spawngenericsprefixesreplayArrayBuffer#slicejsxdirectoryperformancecloudsearchbusypnpm9fpArray.prototype.flattenlivenativeRegExp#flagsmkdirsparsefromArrayBuffer.prototype.sliceinputcompile lesstypecss variablelinuxfsvalidateregular-expressiones2015styled-componentswalkSetbyteLengtharraybuffervariables in cssgetOwnPropertyDescriptoraccessordependency managerfantasy-landRxstreamsisConcatSpreadabledeleterfc9562eslintloggercurriedtestercss-in-jsopensslgrouptranspilersomesignalssetImmediatehardlinksgdprECMAScriptcopyinternal slotcontainsformattingtsfastcloneebsmomentcore-js__proto__6to5deepcloneclass-validatortimeownloadbalancingvarrulescjkdayjsprotoArray.prototype.flatfast-deep-copysetvariablesramdaassignutilsyupawsObservablesvars
3.8.84

10 months ago

3.8.83

10 months ago

3.8.82

10 months ago

2.8.82

10 months ago

2.8.81

10 months ago

2.8.80

11 months ago

2.8.79

11 months ago

2.8.78

11 months ago

2.8.77

11 months ago

2.8.76

11 months ago

2.8.75

11 months ago

2.8.74

11 months ago

2.8.73

11 months ago

2.8.72

11 months ago

2.8.71

11 months ago

2.8.70

11 months ago

2.8.69

11 months ago

2.8.68

11 months ago

2.8.67

11 months ago

2.8.66

11 months ago

2.8.65

11 months ago

2.7.65

11 months ago

2.7.64

11 months ago

2.7.63

11 months ago

2.7.62

11 months ago

2.7.61

11 months ago

2.7.60

11 months ago

2.7.59

11 months ago

2.7.58

11 months ago

2.7.57

11 months ago

2.7.56

11 months ago

2.7.55

11 months ago

2.7.54

11 months ago

2.7.53

11 months ago

2.7.52

11 months ago

2.7.51

12 months ago

1.7.51

12 months ago

1.7.50

12 months ago

1.7.49

12 months ago

1.7.48

12 months ago

1.7.47

12 months ago

1.7.46

12 months ago

1.7.45

12 months ago

1.7.44

12 months ago

1.7.43

12 months ago

1.7.42

12 months ago

1.7.41

12 months ago

1.7.40

12 months ago

1.7.39

12 months ago

1.7.38

12 months ago

1.7.37

12 months ago

1.7.36

12 months ago

1.7.35

12 months ago

1.7.34

12 months ago

1.7.33

12 months ago

1.7.32

1 year ago

1.7.31

1 year ago

1.7.30

1 year ago

1.6.30

1 year ago

1.6.29

1 year ago

1.5.29

1 year ago

1.5.28

1 year ago

1.4.28

1 year ago

1.4.27

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.24

1 year ago

1.4.23

1 year ago

1.4.22

1 year ago

1.4.21

1 year ago

1.3.21

1 year ago

1.3.20

1 year ago

1.3.19

1 year ago

1.3.18

1 year ago

1.3.17

1 year ago

1.3.16

1 year ago

1.2.16

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago