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-native-vexflow-custom

v0.0.2

Published

Vexflow on React Native

Downloads

6

Readme

React-Native-Vexflow

Make Vexflow work on react native. Tried to make it deliciously simple.

Installation

Use npm to install this non-sense tool.

npm install react-native-vexflow

Credit

I really need to give credit first, this repository are the backbone of this package. standalone-vexflow-context: https://github.com/panarch/standalone-vexflow-context

Usage

There is ONE and ONLY hook provided (No wonder I said it is non-sense)

import { useScore } from 'react-native-vexflow'; // import the one and only thing provided
import React from 'react';
import { View } from 'react-native';
import Vex from 'vexflow';

const SomeReactComponent = () => {
	const [context, stave] = useScore({
		contextSize: { x: 300, y: 300 }, // this determine the canvas size
		staveOffset: { x: 5, y: 5 }, // this determine the starting point of the staff relative to top-right corner of canvas
		staveWidth: 250, // ofc, stave width
		clef: 'treble', // clef
		timeSig: '4/4', // time signiture
	});

	// you got your context, you got your stave, you can do your stuff now

	// picked from Vexflow tutorial: https://github.com/0xfe/vexflow/wiki/The-VexFlow-Tutorial
	const VF = Vex.Flow;
	var notes = [
		// A quarter-note C.
		new VF.StaveNote({ clef: 'treble', keys: ['c/4'], duration: 'q' }),

		// A quarter-note D.
		new VF.StaveNote({ clef: 'treble', keys: ['d/4'], duration: 'q' }),

		// A quarter-note rest. Note that the key (b/4) specifies the vertical
		// position of the rest.
		new VF.StaveNote({ clef: 'treble', keys: ['b/4'], duration: 'qr' }),

		// A C-Major chord.
		new VF.StaveNote({
			clef: 'treble',
			keys: ['c/4', 'e/4', 'g/4'],
			duration: 'q',
		}),
	];

	// Create a voice in 4/4 and add the notes from above
	var voice = new VF.Voice({ num_beats: 4, beat_value: 4 });
	voice.addTickables(notes);

	// Format and justify the notes to 200 pixels.
	var formatter = new VF.Formatter().joinVoices([voice]).format([voice], 200);

	// Render voice
	voice.draw(context, stave);

	return <View>{context.render()}</View>;
};

Last words

You got the context, you got the staff. Now scram. Remember to learn Vexflow (https://github.com/0xfe/vexflow/wiki/The-VexFlow-Tutorial) before using it or else you still a dumb like me.

Contributing

Sure! You masters can contribute to this stuff, make it contain more functionality. After all I am just a random guy who used React for only 3 month and I am drunk right now.

License

Who DOES license stuff when he / she is drunk?