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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ikagaka.balloon.js

v4.0.0

Published

Ukagaka Balloon Surface Renderer for Web Browser

Readme

Balloon.js

npm bower

Ukagaka Balloon Surface Renderer for Web Browser

About

Balloon.js is a Ukagaka compatible Balloon Shell renderer for HTML canvas.

Usage

<script src="../bower_components/encoding-japanese/encoding.js"></script>
<script src="../bower_components/jszip/dist/jszip.min.js"></script>
<script src="../bower_components/narloader/NarLoader.js"></script>
<script src="../dist/Balloon.js"></script>
<script>
NarLoader
.loadFromURL("../nar/origin.nar")
.then(function(nanikaDir){
  console.log(nanikaDir.files);
  var balloonDir = nanikaDir.asArrayBuffer();
  var balloon = new Balloon.Balloon(balloonDir);
  return balloon.load();
}).then(function(balloon){
  console.log(balloon);
  var div = document.createElement("div");
  var scopeId = 0;
  var surfaceId = 0;
  balloon.attachBlimp(div, scopeId, surfaceId);
  document.body.appendChild(div);
}).catch(function(err){
  console.error(err);
});

ChangeLog

Development

npm install -g bower dtsm gulp browserify watchify http-server coffee-script
npm run init
npm run build

Document

  • 型はTypeScriptで、サンプルコードはCoffeeScriptで書かれています。

Balloon Class

load(directory: { [path: string]: ArrayBuffer; }): Promise

unload(): void

descript: { [key: string]: string; }

attatchSurface(element: HTMLDivElement, scoepId: number, blimpId: number|string): BalloonSurface|null

  • blimpId: バルーンサーフェスID
    • 0の時、左側通常バルーン
    • 1の時、右側通常バルーン
    • 2の時、右側大きなバルーン
    • 3の時、左側大きなバルーン

detachSurface(element: HTMLDivElement): void

on(event: string, callback: (event: BalloonEvent)=> void): void

  • on(event: "mouse", callback: (ev: BalloonMouseEvent)=>void): void
  • on(event: "select", callback: (ev: BalloonSelectEvent)=>void): void
interface BalloonEvent {
  type: string;
  scopeId: number; // \p[n]
  balloonId: number; // \b[n]
}

interface BalloonMouseEvent extends BalloonEvent {
  type: string; // click|dblclikck|mousemove|mouseup|mousedown
}

interface BalloonSelectEvent extends BalloonEvent {
  type: string; // anchorselect|choiceselect
  id: string;
  text: string;
  args: string[]
}

BalloonSurface Class

element: HTMLDivElement

  • attatchSurfaceで指定したDiv要素です。
  • 以下のように要素が追加されます
    div.blimp
      canvas.blimpCanvas
      div.blimpText
      style[scoepd]

isBalloonLeft: boolean

  • 吹き出しがゴーストに向かって左にあるならtrue

width: number

  • バルーンの横幅px

height: number

  • バルーンの縦幅px

render(): void

  • バルーンを再描画します

surface(balloonId: number): void

  • \b[n]
  • このメソッドを使ってもバルーンの左右位置は変えられません。
  • Blimp#left(), Blimp#rihgt()を使ってください。

left(): void

  • バルーンを左向き表示にします

right(): void

  • バルーンを右向き表示にします

anchorBegin(id: string, ...args: string[]): void

anchorEnd(): void

choice(text: string, id: string, ...args: string[]): void

choiceBegin(id: string, ...args: string)[]: void

choiceEnd(): void

talk(test: string): void

  • バルーンの現在のカーソル位置に文字を追加します

marker(): void

clear(): void

br(ratio: number): void

showWait(): void

font(name: string, ...values: string[]): void

location( x: string, y?: string ): void