Coder Social home page Coder Social logo

afshin / phosphor-splitpanel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dwillmer/phosphor-splitpanel

0.0 1.0 0.0 784 KB

A Phosphor layout widget which arranges its children into resizable sections.

License: BSD 3-Clause "New" or "Revised" License

CSS 2.88% HTML 0.20% TypeScript 93.67% JavaScript 1.71% Shell 1.54%

phosphor-splitpanel's Introduction

phosphor-splitpanel

Build Status Coverage Status

A Phosphor layout panel which arranges its children into resizable sections.

API Docs

Package Install

Prerequisites

npm install --save phosphor-splitpanel

Source Build

Prerequisites

git clone https://github.com/phosphorjs/phosphor-splitpanel.git
cd phosphor-splitpanel
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 {
  SplitPanel
} from 'phosphor-splitpanel';

import {
  Widget
} from 'phosphor-widget';


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

// Set the widget stretch factors (optional).
SplitPanel.setStretch(w1, 0);
SplitPanel.setStretch(w2, 2);
SplitPanel.setStretch(w3, 1);

// Setup the split panel.
let panel = new SplitPanel();
panel.handleSize = 5;
panel.orientation = SplitPanel.Horizontal;
panel.children.assign([w1, w2, w3]);

// sometime later...

// Get the normalized relative widget sizes.
let sizes = panel.sizes();

// Set the relative widget sizes.
panel.setSizes([2, 4, 1]);

phosphor-splitpanel's People

Contributors

blink1073 avatar sccolbert avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.