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

generator-canvas

v1.0.0

Published

Yeoman generator to scaffold a new canvas project!

Downloads

5

Readme

generator-canvas

Yeoman generator to scaffold a new canvas growbag project, gromits, or both at once!

Getting Started

What is Yeoman?

Trick question. It's not a thing. It's this guy:

Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create.

Not every new computer comes with a Yeoman pre-installed. He lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive. Make sure you clean up, he likes new and shiny things.

$ npm install -g yo

Yeoman Generators

Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension.

To install generator-growbag from npm, run:

$ npm install -g generator-canvas

How to use the generator:

First, navigate to the 'projects' folder with your local copy of the 'Canvas/Growbag' repository in your terminal window. Then choose one of the commands below.

New project:

Sets up a new Growbag project, generating all the directories and basic files you need to get started. The generator will prompt you to supply information such as project name, environment id, and whether you would like to add a gromit.

Example:

$ yo growbag

There are also optional parameters that you can supply to speed up the process. Project name, environment id, new gromit's name, and the gromit's dataset can be added to the command.

Example:

$ yo growbag project_name environment_id gromit_name gromit_dataset

Gromit:

If you are simply looking to add a new gromit to an existing project, you can use the gromit subgenerator. Navigate to your existing project folder and choose one of the commands below.

$ yo growbag:gromit

As with the project generator, there are optional parameters that can be specified as well. The gromit's name and dataset can be added to your terminal command.

Example:

$ yo growbag:gromit gromit_name gromit_dataset

Chart Builder:

What is Chart Builder and when do I use it? When you are making a gromit with a chart built by Highcharts, Chart Builder will make your life a lot easier. Chart Builder is a series of services and a directive to help you easily configure it. While generating a gromit, you will be prompted to add a controller. If you choose to include one, then you will be further prompted to include the Chart Builder files.

There are several files included: chartBuilder-svc.js, dataBuilder-svc.js, chartConfig-svc.js, and chart-dir.js.

Usage:

  <chart id="chart_id" options="chart_id_options" data="chart_id_data" legend-btn="chart_id_legend"></chart>

The "id" will be the identification for the chart's div. The options are the configuration object that will be used to display the chart. The data attribute specifies the data package that will be rendered. The last attribute is optional. If included, specifying the "id" of the button, this attribute will add a button to toggle the legend.

If the standard data model does not suffice, adding a new custom method to the dataBuilder-svc.js will allow you to mold the data any way you need it. If the data is being return asynchronously, make sure that a promise is used to render the directive correctly. The generated example demonstrates this case.

The general configuration is done by specifying a chart type and several other parameters leveraging the chartConfig service.

Example:

    $scope.options = chartConfig('column','Title', 'Subtitle', [70,30], [{colors:['red','white','blue']}]);

The first parameter specifies the chart type that corresponds to a pre-made set of configurations. If one does not exist, add it within the service. The second and third parameters are the chart's titles. The optional fourth parameter specifies the Y plotlines that will appear on the chart by entering an array of values. The last parameter is for option overrides for cases when the general configuration for your chart type does not quite get you there. Specify an array of property objects that you would like to include.

Lastly, the chartBuilder service renders the chart by combining all the information supplied in the directives attributes.

Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.

If you'd like to get to know Yeoman better and meet some of his friends, Grunt and Bower, check out the complete Getting Started Guide.

License

MIT