1.0.21 • Published 6 months ago

blix_svelvet v1.0.21

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

banner

MIT License NPM Downloads GitHub Stars GitHub Forks NPM Version

Infinitely Customizable Node-Based User Interfaces with Svelvet!

Svelvet is a lightweight Svelte component library for building interactive node-based user interfaces and diagrams.

⚡ Website | 📚 Documentation | ⌨️ Blog | 💬 Twitter | 💼 LinkedIn

Version Updates

Shout out to our contributors! Here's what's new:

Changelog

Key Features

  • Easy to use: To get started with Svelvet, all you need is data for nodes and edges. Visit our documentation website for streamlined, user-friendly tutorials and examples on how to get the most out of your Svelvet interfaces!
  • Interactive: Elegant and smooth interface when selecting a node to drag it across the graph.
  • Customizable: Fully customizable Edges, Nodes, Backgrounds and components
  • Reliable: Svelvet is written in TypeScript and tested with Vitest, Playwright and Svelte Testing Library. Svelvet is maintained by motivated engineers seeking to contribute to the larger Svelte developer community and library ecosystem.
  • Room to Grow: There is so much we can do to improve, add features and make Svelvet the best version of itself - we welcome feedback and contributions! Scroll below for suggestions on what to contribute.

Installation

Svelvet is available as both an npm and a yarn package. You can install it by running one of the two commands:

npm install svelvet
yarn add svelvet

Quick Start

Start by importing the Svelvet and Node components into your application:

import { Svelvet, Node, Anchor, Edge, Controls } from 'svelvet';

A Svelvet canvas primarily consists of Nodes. You can pass any number of Nodes as children to the Svelvet wrapper. You can use all the standard conditional rendering syntax to populate nodes within the Svelvet component. Basic parameters like color, input and output count, label and more can be specified and feature two-way data binding with passed props. For greater customization, wrap your own custom components in our Node component and pass the whole thing to Svelvet.

Nodes, Edges and Anchors all feature click events, properties and functions to allow developers to fully customize the state of their graphs.

When creating custom Nodes, you can position any number of our Anchor components to enable dynamic connections. You can also wrap Nodes in a Group component to limit their boundaries and move them as one. These groups can be created dynamically by Shift + Click and dragging.

Finally, you can render our Controls, Minimap, Background and Theme Toggle components via props or named slots. In the latter use case, you can pass props to further customize them. The Controls component can wrap your own set of buttons as we expose the zoom/reset/lock actions using a let directive.

Svelvet is focused on dynamic edge connections, but if you'd like to specify edges ahead of time, you can pass an array of connections to any Anchor component. You can also pass a custom Edge component!

For more detailed use cases and examples, please visit our website.

<Svelvet width={500} height={500} theme="dark" initialZoom={0.6} minimap>
	<Node />
	<Node label="Demo Node" TD />
	<Node id="node-id" inputs={2} />
	<Node bgColor="red" inputs={10} outputs={5} height={200} position={{ x: 100, y: 100 }} />
	<Controls slot="controls" horizontal />
</Svelvet>

Testing

Testing is done with Playwright, Vitest, and the Svelte Testing Library. You can find tests in the /tests folder. We plan on dramatically expanding test coverage very soon. In order to run the tests use the command:

For End-to-End testing

npx playwright test

For unit testing

npm run test:unit [filename]

The Svelvet Team

How to Contribute

Please refer to the roadmap for the full list of ideas for iteration. Some ideas inspired by v8.0.0 include:

  • Example Showcase: we've added a new section to the documentation which will contain example sandboxes of features and potential usecases of Svelvet. If you would like to contribute to the showcase with an example of how you’re using Svelvet, reach out to the team with your project via Github discussion.
  • Additional functionality to the Drawer Component: we are planning to make updates to address the ablity to 1) take custom Nodes as props, 2) edit and remove nodes that already exisits on the canvas 3) export the canvas as JSON or PDF file.
  • Additional Data Input Components: we plan on creating additional input/parameter components that integrate with our data flow system and can be used when composing custom Nodes.

  • Extensive Test Converage: We expect to have full E2E and unit test coverage relatively soon.

GET CREATIVE!! Svelvet is an amazing project that has so much room to grow.

Credits

Inspired by React Flow, Svelvet expands the tools available to Svelte developers and makes Svelte more inviting to both new and seasoned software engineers.

License

Svelvet is developed under the MIT license.

ababacornacorn-jsxacorn-walkagent-baseajvansi-regexansi-stylesanymatchargparsearia-queryarray-buffer-byte-lengtharray-unionassertion-errorasynckitavailable-typed-arraysaxobject-querybalanced-matchbinary-extensionsblueimp-md5brace-expansionbracesbuffer-crc32busboycaccall-bindcallsiteschaichalkcheck-errorchokidarcode-redcolor-convertcolor-namecombined-streamconcat-mapconcordancecookiecross-spawncss-treecssesccssstyledata-urlsdate-timedebugdecimal.jsdedent-jsdeep-eqldeep-equaldeep-isdeepmergedefine-propertiesdelayed-streamdequaldetect-indentdevaluediff-sequencesdir-globdoctrinedom-accessibility-apidomexceptionentitieses-get-iteratores6-promiseescape-string-regexpeslint-scopeeslint-visitor-keysesm-envespreeesqueryesrecurseestraverseestree-walkeresutilsfast-deep-equalfast-difffast-globfast-json-stable-stringifyfast-levenshteinfastqfile-entry-cachefill-rangefind-upflat-cacheflattedfor-eachform-datafs.realpathfunction-bindfunctions-have-namesget-func-nameget-intrinsicglobglob-parentglobalsglobbygopdgraceful-fsgrapheme-splittergraphemerhashas-bigintshas-flaghas-property-descriptorshas-protohas-symbolshas-tostringtaghtml-encoding-snifferhttp-proxy-agenthttps-proxy-agenticonv-liteignoreignore-walkimport-freshimport-meta-resolveimurmurhashinflightinheritsinternal-slotis-argumentsis-array-bufferis-bigintis-binary-pathis-boolean-objectis-callableis-date-objectis-extglobis-globis-mapis-numberis-number-objectis-path-insideis-potential-custom-element-nameis-referenceis-regexis-setis-shared-array-bufferis-stringis-symbolis-typed-arrayis-weakmapis-weaksetisarrayisexejs-string-escapejs-tokensjs-yamljson-schema-traversejson-stable-stringify-without-jsonifyjsonc-parserkleurknown-css-propertieslevnlilconfiglocal-pkglocate-characterlocate-pathlodashlodash.mergeloupelower-caselru-cachelz-stringmagic-stringmd5-hexmdn-datamerge2micromatchmimemime-dbmime-typesmin-indentminimatchminimistmkdirpmllymrimrmimemsnanoidnatural-comparenatural-compare-liteno-casenormalize-pathnpm-bundlednpm-normalize-package-binnpm-packlistnwsapiobject-inspectobject-isobject-keysobject.assignonceoptionatorp-limitp-locateparent-moduleparse5pascal-casepath-existspath-is-absolutepath-keypath-typepathepathvalperiscopicpicocolorspicomatchpkg-typesplaywright-corepostcsspostcss-load-configpostcss-safe-parserpostcss-scsspostcss-selector-parserprelude-lspretty-formatpslpunycodequerystringifyqueue-microtaskreact-isreaddirpregenerator-runtimeregexp.prototype.flagsrequires-portresolve-fromreusifyrimrafrolluprrweb-cssomrun-parallelsadesafer-buffersandersaxessemverset-cookie-parsershebang-commandshebang-regexside-channelsiginfosirvslashsorcerysource-map-jsstackbackstd-envstop-iteration-iteratorstreamsearchstrip-ansistrip-indentstrip-json-commentsstrip-literalsupports-colorsveltesvelte-eslint-parsersvelte-hmrsvelte-preprocesssvelte2tsxsymbol-treetext-tabletime-zonetinybenchtinypooltinyspyto-regex-rangetotalisttough-cookietr46tsutilstype-checktype-detecttype-festufoundiciuniversalifyuri-jsurl-parseutil-deprecatevite-nodevitefuw3c-xmlserializerwebidl-conversionswell-known-symbolswhatwg-encodingwhatwg-mimetypewhatwg-urlwhichwhich-boxed-primitivewhich-collectionwhich-typed-arraywhy-is-node-runningwrappywsxml-name-validatorxmlcharsyallistyamlyarnyocto-queue
1.0.21

6 months ago

1.0.20

7 months ago

1.0.19

7 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.16

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

8.0.10

10 months ago

8.0.9

10 months ago

8.0.8

10 months ago