@tibowl/node-gkcoi
v1.1.5
Published
Generate KanColle Organization Image in Node - original by Nishikuma
Downloads
37
Readme
node-gkcoi
Generate KC organization images in Node.js. Originally developed by Nishisonic for web canvas.
Exports Deckbuilder format fleets into an image.
- There might be some visual differences due to changes
Description
Allows you to create ElectronicObserver style fleet images on server-side. Also includes dark theme.
Supports Japanese, English, Korean and Chinese (Simplified)
Usage
import { generate } from "@tibowl/node-gkcoi";
// DeckBuilder
const deck = {
hqlv: 120,
theme: "dark",
lang: "en",
f1 = {
s1: {
id: 463,
lv: 175,
hp: 38,
fp: 71,
tp: 118,
ar: 55,
aa: 70,
asw: 108,
ev: 127,
los: 94,
luck: 62,
items: {
i1: { id: 122, rf: 10 },
i2: { id: 122, rf: 10 },
i3: { id: 106 },
i4: { id: 173, rf: 4 },
},
},
},
};
const output = await generate(deck); // returns node-canvas Canvas
await writeFile("deck.png", output.toBuffer());
Format
Refer to original gkcoi documentation.
Differences
Also comes with a configure
function to set cache directory. This is to reduce HTTP requests on server-side.
If you already have api_start2 data within your application, it can be passed through via generate(..., { start2Data })
.
Examples
See ./test/index.ts for a small example. Asashio's randomfleet.ts is a larger use-case, includes setting up cache, converting TsunDB format and passes own api_start2 data.
Install
Fork, for use in node.js
$ npm install @tibowl/node-gkcoi
Original, for use on web
$ npm install gkcoi
License
MIT License
※コードのみ
Chart.js
- ドーナツ円グラフの表示に使用
- MIT License
chartjs-plugin-datalabels
- ドーナツ円グラフの表示に使用
- MIT License
chartjs-plugin-colorschemes
- ドーナツ円グラフの表示に使用
- MIT License
ElectronicObserver
- 七四式ver.のアイコンで使用
- MIT License
kc3-translations
- 翻訳で使用
- MIT License