diff --git a/README.md b/README.md
index 01497344..84ee0957 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,12 @@
# PATCH MAP
English | [νκ΅μ΄](./README_KR.md)
-PATCH MAP is an optimized canvas library built on pixijs and pixi-viewport, tailored to meet the requirements of PATCH services.
-It enables flexible and fast creation of 2D content.
+PATCH MAP is an optimized canvas library built on pixi.js and pixi-viewport, tailored to meet the requirements of PATCH services.
+
+Therefore, to use this, an understanding of the following two libraries is essential.
-- **[PixiJS](https://github.com/pixijs/pixijs)**
-- **[Pixi-Viewport](https://github.com/pixi-viewport/pixi-viewport)**
+- **[pixi.js](https://github.com/pixijs/pixijs)**
+- **[pixi-viewport](https://github.com/pixi-viewport/pixi-viewport)**
@@ -45,52 +46,56 @@ It enables flexible and fast creation of 2D content.
## π Getting Started
### Install
-Install `@conalog/patch-map` using npm:
+#### NPM
```sh
npm install @conalog/patch-map
```
+#### CDN
+```html
+
+
+```
+
### Usage
-Here's a quick example to get you started:
+Here's a quick example to get you started: [Example](https://codesandbox.io/p/sandbox/yvjrpx)
```js
-(async () => {
- import { Patchmap } from '@conalog/patch-map';
-
- const data = [
- {
- type: 'group',
- id: 'group-id-1',
- label: 'group-label-1',
- items: [{
- type: 'grid',
- id: 'grid-1',
- label: 'grid-label-1',
- cells: [ [1, 0, 1], [1, 1, 1] ],
- position: { x: 0, y: 0 },
- itemSize: { width: 40, height: 80 },
- components: [
- {
- type: 'background',
- texture: {
- type: 'rect',
- fill: 'white',
- borderWidth: 2,
- borderColor: 'primary.dark',
- radius: 4,
- },
+import { Patchmap } from '@conalog/patch-map';
+
+const data = [
+ {
+ type: 'group',
+ id: 'group-id-1',
+ label: 'group-label-1',
+ items: [{
+ type: 'grid',
+ id: 'grid-1',
+ label: 'grid-label-1',
+ cells: [ [1, 0, 1], [1, 1, 1] ],
+ position: { x: 0, y: 0 },
+ itemSize: { width: 40, height: 80 },
+ components: [
+ {
+ type: 'background',
+ texture: {
+ type: 'rect',
+ fill: 'white',
+ borderWidth: 2,
+ borderColor: 'primary.dark',
+ radius: 4,
}
- { type: 'icon', asset: 'loading', size: 16 }
- ]
- }]
- }
- ];
+ },
+ { type: 'icon', asset: 'loading', size: 16 }
+ ]
+ }]
+ }
+];
- const patchmap = new Patchmap();
+const patchmap = new Patchmap();
- await patchmap.init(document.body);
-
- patchmap.draw(data);
-})()
+await patchmap.init(document.body);
+
+patchmap.draw(data);
```
@@ -116,7 +121,7 @@ await patchmap.init(el, {
Customize the rendering behavior using the following options:
- `app`
- - `PixiJS Application options` ([Docs](https://pixijs.download/release/docs/app.ApplicationOptions.html))
+ - `pixi.js Application options` ([Docs](https://pixijs.download/release/docs/app.ApplicationOptions.html))
Default:
```js
@@ -129,7 +134,7 @@ Customize the rendering behavior using the following options:
```
- `viewport`
- - `Viewport options` ([Docs](https://pixi-viewport.github.io/pixi-viewport/jsdoc/Viewport.html#Viewport))
+ - `Viewport options` ([Docs](https://viewport.pixijs.io/jsdoc/Viewport.html))
- `plugins` - Plugins to enhance or modify the viewport's behavior. You can add new plugins or disable default ones.
Default:
@@ -196,8 +201,8 @@ const data = [
borderWidth: 2,
borderColor: 'primary.dark',
radius: 4,
- },
- }
+ }
+ },
{ type: 'icon', asset: 'loading', size: 16 }
]
}]
@@ -331,7 +336,7 @@ patchmap.viewport.plugin.remove('mouse-edges');
### `asset`
-- Refer to [pixiJS Assets](https://pixijs.download/release/docs/assets.Assets.html) for information about assets.
+- Refer to [pixi.js Assets](https://pixijs.download/release/docs/assets.Assets.html) for information about assets.
diff --git a/README_KR.md b/README_KR.md
index b5fc4efb..a7c6a2f2 100644
--- a/README_KR.md
+++ b/README_KR.md
@@ -1,11 +1,12 @@
# PATCH MAP
[English](./README.md) | νκ΅μ΄
-PATCH MAPμ PATCH μλΉμ€μ μꡬ μ¬νμ μΆ©μ‘±μν€κΈ° μν΄ `pixijs`μ `pixi-viewport`λ₯Ό κΈ°λ°μΌλ‘ μ΅μ νλ μΊλ²μ€ λΌμ΄λΈλ¬λ¦¬μ
λλ€.
-μ μ°νκ³ λΉ λ₯Έ 2D μ½ν
μΈ μμ±μ κ°λ₯νκ² ν©λλ€.
+PATCH MAPμ PATCH μλΉμ€μ μꡬ μ¬νμ μΆ©μ‘±μν€κΈ° μν΄ `pixi.js`μ `pixi-viewport`λ₯Ό κΈ°λ°μΌλ‘ μ΅μ νλ μΊλ²μ€ λΌμ΄λΈλ¬λ¦¬μ
λλ€.
+
+λ°λΌμ μ΄λ₯Ό μ¬μ©νκΈ° μν΄μλ μλ λ λΌμ΄λΈλ¬λ¦¬μ λν μ΄ν΄κ° νμμ μ
λλ€.
-- **[PixiJS](https://github.com/pixijs/pixijs)**
-- **[Pixi-Viewport](https://github.com/pixi-viewport/pixi-viewport)**
+- **[pixi.js](https://github.com/pixijs/pixijs)**
+- **[pixi-viewport](https://github.com/pixi-viewport/pixi-viewport)**
@@ -45,52 +46,56 @@ PATCH MAPμ PATCH μλΉμ€μ μꡬ μ¬νμ μΆ©μ‘±μν€κΈ° μν΄ `pixijs`
## π μμνκΈ°
### μ€μΉ
-npmμ μ΄μ©ν `@conalog/patch-map` μ€μΉ:
+#### NPM
```sh
npm install @conalog/patch-map
```
+#### CDN
+```html
+
+
+```
+
### κΈ°λ³Έ μμ
-μμνλ λ° λμμ΄ λλ κ°λ¨ν μμ μ
λλ€:
+μμνλ λ° λμμ΄ λλ κ°λ¨ν μμ μ
λλ€: [μμ ](https://codesandbox.io/p/sandbox/yvjrpx)
```js
-(async () => {
- import { Patchmap } from '@conalog/patch-map';
-
- const data = [
- {
- type: 'group',
- id: 'group-id-1',
- label: 'group-label-1',
- items: [{
- type: 'grid',
- id: 'grid-1',
- label: 'grid-label-1',
- cells: [ [1, 0, 1], [1, 1, 1] ],
- position: { x: 0, y: 0 },
- itemSize: { width: 40, height: 80 },
- components: [
- {
- type: 'background',
- texture: {
- type: 'rect',
- fill: 'white',
- borderWidth: 2,
- borderColor: 'primary.dark',
- radius: 4,
- },
+import { Patchmap } from '@conalog/patch-map';
+
+const data = [
+ {
+ type: 'group',
+ id: 'group-id-1',
+ label: 'group-label-1',
+ items: [{
+ type: 'grid',
+ id: 'grid-1',
+ label: 'grid-label-1',
+ cells: [ [1, 0, 1], [1, 1, 1] ],
+ position: { x: 0, y: 0 },
+ itemSize: { width: 40, height: 80 },
+ components: [
+ {
+ type: 'background',
+ texture: {
+ type: 'rect',
+ fill: 'white',
+ borderWidth: 2,
+ borderColor: 'primary.dark',
+ radius: 4,
}
- { type: 'icon', asset: 'loading', size: 16 }
- ]
- }]
- }
- ];
+ },
+ { type: 'icon', asset: 'loading', size: 16 }
+ ]
+ }]
+ }
+];
- const patchmap = new Patchmap();
+const patchmap = new Patchmap();
- await patchmap.init(document.body);
-
- patchmap.draw(data);
-})()
+await patchmap.init(document.body);
+
+patchmap.draw(data);
```
@@ -117,7 +122,7 @@ await patchmap.init(el, {
λ λλ§ λμμ μ¬μ©μ μ μνλ €λ©΄ λ€μ μ΅μ
μ μ¬μ©νμΈμ:
- `app`
- - `PixiJS Application options` ([Docs](https://pixijs.download/release/docs/app.ApplicationOptions.html))
+ - `pixi.js Application options` ([Docs](https://pixijs.download/release/docs/app.ApplicationOptions.html))
Default:
```js
@@ -130,7 +135,7 @@ await patchmap.init(el, {
```
- `viewport`
- - `Viewport options` ([Docs](https://pixi-viewport.github.io/pixi-viewport/jsdoc/Viewport.html#Viewport))
+ - `Viewport options` ([Docs](https://viewport.pixijs.io/jsdoc/Viewport.html))
- `plugins` - Viewportμ λμμ ν₯μμν€κ±°λ μμ νλ νλ¬κ·ΈμΈμ
λλ€. μλ‘μ΄ νλ¬κ·ΈμΈμ μΆκ°νκ±°λ κΈ°λ³Έ νλ¬κ·ΈμΈμ λΉνμ±νν μ μμ΅λλ€.
Default:
@@ -196,8 +201,8 @@ const data = [
borderWidth: 2,
borderColor: 'primary.dark',
radius: 4,
- },
- }
+ }
+ },
{ type: 'icon', texture: 'loading', size: 16 }
]
}]
@@ -331,7 +336,7 @@ patchmap.viewport.plugin.remove('mouse-edges');
### `asset`
-- assetμ λν λ΄μ©μ [pixiJS Assets](https://pixijs.download/release/docs/assets.Assets.html)λ₯Ό μ°Έμ‘°νμΈμ.
+- assetμ λν λ΄μ©μ [pixi.js Assets](https://pixijs.download/release/docs/assets.Assets.html)λ₯Ό μ°Έμ‘°νμΈμ.
diff --git a/package.json b/package.json
index 19bd8709..0abae1f5 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"type": "module",
"name": "@conalog/patch-map",
"version": "0.1.9",
- "description": "λ³Έ λΌμ΄λΈλ¬λ¦¬λ `pixijs` λΌμ΄λΈλ¬λ¦¬λ₯Ό μ΄μ©νμ¬ PATCH μλΉμ€μ μꡬμ¬νμ λ§λ PATCH MAPμ μ 곡νκ³ μ ν¨",
+ "description": "This library utilizes pixi.js to provide a PATCH MAP tailored to the requirements of the PATCH service.",
"license": "MIT",
"author": "Conalog",
"keywords": [],
diff --git a/src/display/data-schema/data.d.ts b/src/display/data-schema/data.d.ts
index ae2e16ce..d8cf7498 100644
--- a/src/display/data-schema/data.d.ts
+++ b/src/display/data-schema/data.d.ts
@@ -93,7 +93,7 @@ export type components =
export interface BackgroundComponent extends BaseObject {
type: 'background';
show?: boolean; // default: true
- texture: string | TextureStyle;
+ texture: TextureStyle;
}
/**
@@ -102,10 +102,10 @@ export interface BackgroundComponent extends BaseObject {
export interface BarComponent extends BaseObject {
type: 'bar';
show?: boolean; // default: true
- texture: string | TextureStyle;
+ texture: TextureStyle;
placement?: Placement; // default: 'bottom'
- margin?: string; // default: '0'
+ margin?: string; // default: '0', ('4 2', '2 1 3 4')
percentWidth?: number; // default: 1 (0~1)
percentHeight?: number; // default: 1 (0~1)
animation?: boolean; // default: true
@@ -118,10 +118,10 @@ export interface BarComponent extends BaseObject {
export interface IconComponent extends BaseObject {
type: 'icon';
show?: boolean; // default: true
- asset: string;
+ asset: string; // object, inverter, combiner, edge, device, loading, warning, wifi, etc.
placement?: Placement; // default: 'center'
- margin?: string; // default: '0'
+ margin?: string; // default: '0', ('4 2', '2 1 3 4')
size: number; // 0 or higher
}
@@ -133,7 +133,7 @@ export interface TextComponent extends BaseObject {
show?: boolean; // default: true
placement?: Placement; // default: 'center'
- margin?: string; // default: '0'
+ margin?: string; // default: '0', ('4 2', '2 1 3 4')
text?: string; // default: ''
style?: Record;
split?: number; // default: 0