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

phosphor-gridpanel

v1.0.0-beta.1

Published

A Phosphor layout panel which arranges its children into a 2D grid.

Downloads

19

Readme

phosphor-gridpanel

Build Status Coverage Status

A Phosphor layout panel which arranges its children into a 2D grid.

API Docs

Package Install

Prerequisites

npm install --save phosphor-gridpanel

Source Build

Prerequisites

git clone https://github.com/phosphorjs/phosphor-gridpanel.git
cd phosphor-gridpanel
npm install

Rebuild

npm run clean
npm run build

Run Tests

Follow the source build instructions first.

# run tests in Firefox
npm test

# run tests in Chrome
npm run test:chrome

# run tests in IE
npm run test:ie

Build Docs

Follow the source build instructions first.

npm run docs

Navigate to docs/index.html.

Build Example

Follow the source build instructions first.

npm run build:example

Navigate to example/index.html.

Supported Runtimes

The runtime versions which are currently known to work are listed below. Earlier versions may also work, but come with no guarantees.

  • IE 11+
  • Firefox 32+
  • Chrome 38+

Bundle for the Browser

Follow the package install instructions first.

npm install --save-dev browserify browserify-css
browserify myapp.js -o mybundle.js

Usage Examples

Note: This module is fully compatible with Node/Babel/ES6/ES5. Simply omit the type declarations when using a language other than TypeScript.

import {
  GridPanel, Spec
} from 'phosphor-gridpanel';

import {
  Widget
} from 'phosphor-widget';


// Create some content for the panel.
let w1 = new Widget();
let w2 = new Widget();
let w3 = new Widget();

// Create the row and column specs for panel.
let rowSpecs = [
  new Spec({ minSize: 150, sizeBasis: 300, stretch: 2 }),
  new Spec({ minSize: 50, sizeBasis: 150, stretch: 1 })
];

let colSpecs = [
  new Spec({ minSize: 200 }),
  new Spec({ minSize: 300 }),
];

// Set the content cell indices and spans.
GridPanel.setRow(w1, 0);
GridPanel.setColumn(w1, 0);
GridPanel.setRowSpan(w1, 1);
GridPanel.setColumnSpan(w1, 1);

GridPanel.setRow(w2, 1);
GridPanel.setColumn(w2, 0);
GridPanel.setRowSpan(w2, 1);
GridPanel.setColumnSpan(w2, 1);

GridPanel.setRow(w3, 0);
GridPanel.setColumn(w3, 1);
GridPanel.setRowSpan(w3, 2);
GridPanel.setColumnSpan(w3, 1);

// Setup the grid panel.
let panel = new GridPanel();
panel.rowSpacing = 3;
panel.columnSpacing = 3;
panel.rowSpecs = rowSpecs;
panel.columnSpecs = colSpecs;
panel.addChild(w1);
panel.addChild(w2);
panel.addChild(w3);