ziko 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ziko.cjs +479 -1901
- package/dist/ziko.js +7648 -8185
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +7614 -8182
- package/package.json +1 -1
- package/readme.md +137 -0
- package/src/app/spa-file-based-routing.js +0 -1
- package/src/data/datatypes/color.js +11 -0
- package/src/graphics/canvas/canvas.js +13 -26
- package/src/graphics/canvas/elements/{Basic → basic}/arc.js +1 -1
- package/src/graphics/canvas/elements/{Basic → basic}/line.js +1 -1
- package/src/graphics/canvas/elements/{Basic → basic}/points.js +1 -1
- package/src/graphics/canvas/elements/{Basic → basic}/rect.js +1 -1
- package/src/graphics/canvas/elements/index.js +4 -4
- package/src/graphics/canvas/index.js +2 -15
- package/src/graphics/index.js +9 -68
- package/src/graphics/svg/{Elements/Basic → elements/basic}/circle.js +5 -2
- package/src/graphics/svg/{Elements/Basic → elements/basic}/ellipse.js +5 -2
- package/src/graphics/svg/{Elements/Basic/foreignObject.js → elements/basic/foreign-object.js} +7 -4
- package/src/graphics/svg/{Elements/Basic → elements/basic}/groupe.js +5 -2
- package/src/graphics/svg/{Elements/Basic → elements/basic}/image.js +5 -2
- package/src/graphics/svg/elements/basic/index.js +11 -0
- package/src/graphics/svg/{Elements/Basic → elements/basic}/line.js +5 -2
- package/src/graphics/svg/{Elements/Basic → elements/basic}/link.js +5 -2
- package/src/graphics/svg/{Elements/Basic → elements/basic}/path.js +5 -2
- package/src/graphics/svg/{Elements/Basic → elements/basic}/polygon.js +1 -1
- package/src/graphics/svg/{Elements/Basic → elements/basic}/polyline.js +4 -1
- package/src/graphics/svg/{Elements/Basic → elements/basic}/rect.js +5 -2
- package/src/graphics/svg/{Elements/Basic → elements/basic}/text.js +5 -2
- package/src/graphics/svg/{Elements/Derived → elements/derived}/grid.js +1 -1
- package/src/graphics/svg/elements/derived/index.js +1 -0
- package/src/graphics/svg/elements/index.js +2 -0
- package/src/graphics/svg/{Elements/ZikoSvgElement.js → elements/ziko-svg-element.js} +5 -3
- package/src/graphics/svg/index.js +1 -1
- package/src/graphics/svg/svg.js +19 -65
- package/src/index.js +2 -1
- package/src/reactivity/events/index.js +12 -63
- package/src/reactivity/hooks/index.js +8 -91
- package/src/reactivity/hooks/ui/index.js +2 -1
- package/src/reactivity/hooks/ui/useRoot.js +39 -0
- package/src/reactivity/index.js +2 -2
- package/src/ui/elements/primitives/ZikoUIContainerElement.js +155 -118
- package/src/ui/elements/primitives/ZikoUIElement.js +3 -3
- package/src/ui/elements/primitives/misc/xml-wrapper.js +3 -2
- package/src/ui/index.js +10 -1
- package/README.md +0 -246
- package/src/graphics/canvas/elements/Groupe.js +0 -0
- package/src/graphics/canvas/elements/grid.js +0 -0
- package/src/graphics/canvas/filter/index.js +0 -0
- package/src/graphics/canvas/paint/index.js +0 -0
- package/src/graphics/svg/Elements/index.js +0 -14
- /package/src/graphics/canvas/elements/{Basic → basic}/image.js +0 -0
- /package/src/graphics/canvas/elements/{Basic → basic}/path.js +0 -0
- /package/src/graphics/canvas/elements/{Basic → basic}/polygon.js +0 -0
- /package/src/graphics/canvas/elements/{Basic → basic}/polyline.js +0 -0
- /package/src/graphics/canvas/elements/{Basic → basic}/text.js +0 -0
- /package/src/graphics/canvas/elements/{Chart → chart}/histogram.js +0 -0
- /package/src/graphics/canvas/elements/{Chart → chart}/plot.js +0 -0
- /package/src/graphics/canvas/elements/{Chart → chart}/scatter.js +0 -0
- /package/src/graphics/canvas/elements/{Chart → chart}/stem.js +0 -0
- /package/src/graphics/canvas/elements/{Element.js → element.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziko",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "a versatile JavaScript library offering a rich set of UI components, advanced mathematical utilities,Reactivity,animations,client side routing and graphics capabilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Zikojs",
|
package/readme.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<img src="docs/assets/zikojs.png" width="200" align="right" alt="zikojs logo">
|
|
2
|
+
|
|
3
|
+
*💡 **Zikojs** a versatile JavaScript library offering a rich set of UI components, advanced mathematical utilities,Reactivity,animations,client side routing and graphics capabilities*
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
```bash
|
|
7
|
+
npm install ziko
|
|
8
|
+
```
|
|
9
|
+
## 🎬 Demos
|
|
10
|
+
- ### [ Windows entanglement using zikojs and ziko-three ](https://www.linkedin.com/feed/update/urn:li:activity:7144023650394918913/)
|
|
11
|
+
|
|
12
|
+
## Features :
|
|
13
|
+
|
|
14
|
+
### 🔰 Seamlessly operates in both browser and Node.js environments
|
|
15
|
+
|
|
16
|
+
### 🔰 Mathematical Utilities & Tips
|
|
17
|
+
|
|
18
|
+
- ***Flexible Math Functions*** :
|
|
19
|
+
|
|
20
|
+
ZikoJS offers flexible math utilities, such as the `mapfun` function, which allows mapping standard mathematical operations to complex and nested data structures.
|
|
21
|
+
For example, the `cos` function in ZikoJS is built on top of mapfun, enabling it to handle multiple arguments with diverse types (numbers, arrays, objects).
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { cos, PI } from "ziko";
|
|
25
|
+
const result = cos(PI, PI / 2, PI / 4, [PI / 6, PI / 3], {
|
|
26
|
+
x: PI / 2,
|
|
27
|
+
y: PI / 4,
|
|
28
|
+
z: [0, PI / 12],
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
/*
|
|
32
|
+
result =>
|
|
33
|
+
[
|
|
34
|
+
-1,
|
|
35
|
+
0,
|
|
36
|
+
0.707106781186548,
|
|
37
|
+
[0.866025403784439, 0.5],
|
|
38
|
+
{
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0.707106781186548,
|
|
41
|
+
z: [1, 0.965925826289068],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
*/
|
|
45
|
+
// console.log(result)
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
You can also built your own flexible Math function using this mapfun util :
|
|
49
|
+
```js
|
|
50
|
+
import { mapfun } from "ziko";
|
|
51
|
+
const parabolic_func = (a, b, c, x) => a * x ** 2 + b * x + c;
|
|
52
|
+
const map_parabolic_func =
|
|
53
|
+
(a, b, c) =>
|
|
54
|
+
(...X) =>
|
|
55
|
+
mapfun((n) => parabolic_func(a, b, c, n), ...X);
|
|
56
|
+
const a = -1.5,
|
|
57
|
+
b = 2,
|
|
58
|
+
c = 3;
|
|
59
|
+
const X = [0, 1, 2, 3];
|
|
60
|
+
console.log(parabolic_func(a, b, c)(X));
|
|
61
|
+
// [3,3,1,3]
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- Built in Matrix, Complex, Random ... classes
|
|
66
|
+
|
|
67
|
+
### 🔰 No Template Engines :
|
|
68
|
+
zikojs UI module adopts a distinctive approach to building and updating user interfaces. It doesn't rely on predefined markup templates. Instead, it leverages a hyperscript-like syntax to dynamically create and update user interfaces.
|
|
69
|
+
|
|
70
|
+
### 🔰 Built in File-Based Routing with Single Page Application
|
|
71
|
+
|
|
72
|
+
ZikoJS provides an intuitive file-based routing mechanism that simplifies the development of single-page applications. By organizing your page components into a directory structure, you can automatically generate routes based on the file paths. This approach enhances the maintainability of your code by allowing you to easily manage and navigate between different views in your application.
|
|
73
|
+
|
|
74
|
+
To implement file-based routing, simply use the following code:
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
import { FileBasedRouting } from "ziko";
|
|
78
|
+
FileBasedRouting(import.meta.glob("./src/pages/**/*.js"))
|
|
79
|
+
```
|
|
80
|
+
In this example, the import.meta.glob function dynamically imports all JavaScript files from the specified directory (./src/pages/**). Each file represents a separate route in your application, allowing you to create a clean and organized routing structure without the need for manual route configuration.
|
|
81
|
+
|
|
82
|
+
### 🔰 Flexible Integration with Popular Frameworks/Libraries
|
|
83
|
+
|
|
84
|
+
**ZikoJS** is designed to seamlessly integrate into other frameworks and libraries. By installing the [ziko-wrapper](https://github.com/zakarialaoui10/ziko-wrapper) package, you can easily use ZikoJS within your favorite frontend ecosystems.
|
|
85
|
+
|
|
86
|
+
Currently supported frameworks:
|
|
87
|
+
- ***REACT***
|
|
88
|
+
- ***Solid***
|
|
89
|
+
- ***Preact***
|
|
90
|
+
- ***Svelte***
|
|
91
|
+
- ***Vue***
|
|
92
|
+
|
|
93
|
+
### 🔰 Custom Markdown Parser
|
|
94
|
+
|
|
95
|
+
[Mdzjs](https://github.com/zakarialaoui10/mdzjs) allowing you to write markdown content alongside Zikojs Elements
|
|
96
|
+
|
|
97
|
+
```md
|
|
98
|
+
---
|
|
99
|
+
module :
|
|
100
|
+
- import InteractiveBlock from "./InteractiveBlock"
|
|
101
|
+
title : Article 1
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
# Hello World this is markdown heading
|
|
105
|
+
|
|
106
|
+
<InteractiveBlock data = "Hello" />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 🔰 Growing Add-On Ecosystem
|
|
110
|
+
|
|
111
|
+
|Addon|Purpose|Dependencies|Repository|
|
|
112
|
+
|-|-|-|-|
|
|
113
|
+
|ziko-gl||`threejs`|
|
|
114
|
+
|ziko-code||`codeMirror`||
|
|
115
|
+
|ziko-chart||`chartjs`||
|
|
116
|
+
|ziko-pdf||`jsPdf.js`||
|
|
117
|
+
|ziko-xls||`xls.js`||
|
|
118
|
+
|ziko-lottie||`Lottie-web`|
|
|
119
|
+
|ziko-rough||`rough.js`|
|
|
120
|
+
|ziko-icons||`fontawesome`|
|
|
121
|
+
|ziko-tippy||`tippy.js`|
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### 🔰 Rich UI elements
|
|
125
|
+
|
|
126
|
+
### 🔰 Reactivity
|
|
127
|
+
|
|
128
|
+
### 🔰 Time loop and animations support
|
|
129
|
+
|
|
130
|
+
## ⭐️ Show your support <a name="support"></a>
|
|
131
|
+
|
|
132
|
+
If you appreciate the library, kindly demonstrate your support by giving it a star!<br>
|
|
133
|
+
[](https://github.com/zakarialaoui10/ziko.js)
|
|
134
|
+
<!--## Financial support-->
|
|
135
|
+
# License
|
|
136
|
+
This projet is licensed under the terms of MIT License
|
|
137
|
+
<img src="https://img.shields.io/github/license/zakarialaoui10/zikojs?color=rgb%2820%2C21%2C169%29" width="100" align="right">
|
|
@@ -4,7 +4,6 @@ import { Section } from "../ui";
|
|
|
4
4
|
async function FileBasedRouting(pages /* use import.meta.glob */){
|
|
5
5
|
const routes = Object.keys(pages)
|
|
6
6
|
const root = findCommonPath(routes)
|
|
7
|
-
// console.log({root})
|
|
8
7
|
const pairs = {}
|
|
9
8
|
for(let i=0; i<routes.length; i++){
|
|
10
9
|
const module = await pages[routes[i]]()
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import ZikoUIContainerElement from "../../ui/elements/primitives/ZikoUIContainerElement.js";
|
|
2
2
|
import {Matrix} from "../../math/matrix/index.js"
|
|
3
|
-
import { convolute } from "../../math/signal/conv.js";
|
|
3
|
+
// import { convolute } from "../../math/signal/conv.js";
|
|
4
4
|
class ZikoUICanvas extends ZikoUIContainerElement{
|
|
5
5
|
constructor(w,h){
|
|
6
6
|
super("canvas","canvas");
|
|
7
|
-
//this.element=document?.createElement("canvas");
|
|
8
7
|
this.ctx = this.element?.getContext("2d");
|
|
9
8
|
this.style({
|
|
10
9
|
border:"1px red solid",
|
|
11
|
-
//width:"300px",
|
|
12
|
-
//height:"300px"
|
|
13
10
|
})
|
|
14
11
|
this.transformMatrix=new Matrix([
|
|
15
12
|
[1,0,0],
|
|
@@ -20,16 +17,10 @@ class ZikoUICanvas extends ZikoUIContainerElement{
|
|
|
20
17
|
[-10,-10],
|
|
21
18
|
[10,10]
|
|
22
19
|
])
|
|
23
|
-
// this.
|
|
24
|
-
|
|
20
|
+
// setTimeout(()=>this.resize(w,h),0);
|
|
21
|
+
requestAnimationFrame(()=>this.resize(w,h),0);
|
|
25
22
|
this.on("sizeupdated",()=>this.adjust())
|
|
26
23
|
}
|
|
27
|
-
get Width(){
|
|
28
|
-
return this.element?.width;
|
|
29
|
-
}
|
|
30
|
-
get Height(){
|
|
31
|
-
return this.element?.height;
|
|
32
|
-
}
|
|
33
24
|
get Xmin(){
|
|
34
25
|
return this.axisMatrix[0][0];
|
|
35
26
|
}
|
|
@@ -72,10 +63,6 @@ class ZikoUICanvas extends ZikoUIContainerElement{
|
|
|
72
63
|
return this;
|
|
73
64
|
}
|
|
74
65
|
resize(w,h){
|
|
75
|
-
// this.style({
|
|
76
|
-
// width:w,
|
|
77
|
-
// height:h
|
|
78
|
-
// })
|
|
79
66
|
this.size(w,h)
|
|
80
67
|
this.lineWidth();
|
|
81
68
|
this.view(this.axisMatrix[0][0], this.axisMatrix[0][1], this.axisMatrix[1][0], this.axisMatrix[1][1]);
|
|
@@ -89,10 +76,10 @@ class ZikoUICanvas extends ZikoUIContainerElement{
|
|
|
89
76
|
return this;
|
|
90
77
|
}
|
|
91
78
|
view(xMin,yMin,xMax,yMax){
|
|
92
|
-
this.transformMatrix[0][0]=this.
|
|
93
|
-
this.transformMatrix[1][1]=-this.
|
|
94
|
-
this.transformMatrix[0][2]=this.
|
|
95
|
-
this.transformMatrix[1][2]=this.
|
|
79
|
+
this.transformMatrix[0][0]=this.width/(xMax-xMin); // scaleX
|
|
80
|
+
this.transformMatrix[1][1]=-this.height/(yMax-yMin); // scaleY
|
|
81
|
+
this.transformMatrix[0][2]=this.width/2;
|
|
82
|
+
this.transformMatrix[1][2]=this.height/2;
|
|
96
83
|
this.axisMatrix=new Matrix([
|
|
97
84
|
[xMin,yMin],
|
|
98
85
|
[xMax,yMax]
|
|
@@ -116,7 +103,7 @@ class ZikoUICanvas extends ZikoUIContainerElement{
|
|
|
116
103
|
background(color){
|
|
117
104
|
this.ctx.fillStyle = color;
|
|
118
105
|
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
119
|
-
this.ctx.fillRect(0, 0, this.
|
|
106
|
+
this.ctx.fillRect(0, 0, this.width, this.height);
|
|
120
107
|
this.applyTransformMatrix();
|
|
121
108
|
this.draw();
|
|
122
109
|
}
|
|
@@ -124,17 +111,17 @@ class ZikoUICanvas extends ZikoUIContainerElement{
|
|
|
124
111
|
this.ctx.lineWidth=w/this.transformMatrix[0][0];
|
|
125
112
|
return this
|
|
126
113
|
}
|
|
127
|
-
getImageData(x=0,y=0,w=this.
|
|
114
|
+
getImageData(x=0,y=0,w=this.width,h=this.height){
|
|
128
115
|
return this.ctx.getImageData(x,y,w,h);
|
|
129
116
|
}
|
|
130
117
|
clear(){
|
|
131
118
|
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
132
|
-
this.ctx.clearRect(0, 0, this.
|
|
119
|
+
this.ctx.clearRect(0, 0, this.width, this.height);
|
|
133
120
|
this.applyTransformMatrix();
|
|
134
121
|
return this;
|
|
135
122
|
}
|
|
136
123
|
clone(){
|
|
137
|
-
console.log(this.
|
|
124
|
+
console.log(this.width)
|
|
138
125
|
const canvas=new ZikoUICanvas();
|
|
139
126
|
canvas.items=this.items;
|
|
140
127
|
canvas.transformMatrix=this.transformMatrix;
|
|
@@ -184,6 +171,6 @@ class ZikoUICanvas extends ZikoUIContainerElement{
|
|
|
184
171
|
|
|
185
172
|
const Canvas=(w,h)=>new ZikoUICanvas(w,h);
|
|
186
173
|
export{
|
|
187
|
-
ZikoUICanvas
|
|
174
|
+
ZikoUICanvas,
|
|
175
|
+
Canvas
|
|
188
176
|
}
|
|
189
|
-
export default Canvas;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export {
|
|
2
2
|
canvasArc,
|
|
3
3
|
canvasCircle
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./basic/arc.js";
|
|
5
5
|
export {
|
|
6
6
|
canvasPoints
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./basic/points.js";
|
|
8
8
|
export {
|
|
9
9
|
canvasLine
|
|
10
|
-
}from "./
|
|
10
|
+
}from "./basic/line.js"
|
|
11
11
|
export {
|
|
12
12
|
canvasRect
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./basic/rect.js"
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
ZikoUICanvas
|
|
4
|
-
} from "./canvas.js";
|
|
5
|
-
export {
|
|
6
|
-
canvasArc,
|
|
7
|
-
canvasCircle,
|
|
8
|
-
canvasPoints,
|
|
9
|
-
canvasLine,
|
|
10
|
-
canvasRect,
|
|
11
|
-
} from "./Elements/index.js";
|
|
12
|
-
export {
|
|
13
|
-
ZikoUICanvas,
|
|
14
|
-
Canvas,
|
|
15
|
-
}
|
|
1
|
+
export * from "./canvas";
|
|
2
|
+
export * from "./elements"
|
package/src/graphics/index.js
CHANGED
|
@@ -1,69 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
svgRect,
|
|
10
|
-
svgText,
|
|
11
|
-
svgGroupe,
|
|
12
|
-
svgLink,
|
|
13
|
-
svgGrid,
|
|
14
|
-
svgObject,
|
|
15
|
-
svgPath
|
|
16
|
-
} from "./svg/index.js";
|
|
17
|
-
import {
|
|
18
|
-
Canvas,
|
|
19
|
-
canvasArc,
|
|
20
|
-
canvasCircle,
|
|
21
|
-
canvasPoints,
|
|
22
|
-
canvasLine,
|
|
23
|
-
canvasRect
|
|
24
|
-
} from "./canvas/index.js";
|
|
25
|
-
const Graphics={
|
|
26
|
-
Svg,
|
|
27
|
-
ZikoUISvg,
|
|
28
|
-
svgCircle,
|
|
29
|
-
svgEllipse,
|
|
30
|
-
svgImage,
|
|
31
|
-
svgLine,
|
|
32
|
-
svgPolygon,
|
|
33
|
-
svgRect,
|
|
34
|
-
svgText,
|
|
35
|
-
svgGroupe,
|
|
36
|
-
svgLink,
|
|
37
|
-
svgGrid,
|
|
38
|
-
svgObject,
|
|
39
|
-
svgPath,
|
|
40
|
-
Canvas,
|
|
41
|
-
canvasArc,
|
|
42
|
-
canvasCircle,
|
|
43
|
-
canvasPoints,
|
|
44
|
-
canvasLine,
|
|
45
|
-
canvasRect,
|
|
46
|
-
ExtractAll: function () {
|
|
47
|
-
const keys = Object.keys(this);
|
|
48
|
-
for (let i = 0; i < keys.length; i++) {
|
|
49
|
-
const key = keys[i];
|
|
50
|
-
if (key !== 'ExtractAll' && key !== 'RemoveAll') {
|
|
51
|
-
globalThis[key] = this[key];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return this;
|
|
55
|
-
},
|
|
56
|
-
RemoveAll: function () {
|
|
57
|
-
const keys = Object.keys(this);
|
|
58
|
-
for (let i = 0; i < keys.length; i++) {
|
|
59
|
-
const key = keys[i];
|
|
60
|
-
if (key !== 'RemoveAll') {
|
|
61
|
-
delete globalThis[key];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
1
|
+
export * from "./svg"
|
|
2
|
+
export * from "./canvas"
|
|
3
|
+
import * as SVG from "./svg"
|
|
4
|
+
import * as CANVAS from "./canvas"
|
|
5
|
+
|
|
6
|
+
const Graphics = {
|
|
7
|
+
...SVG,
|
|
8
|
+
...CANVAS
|
|
66
9
|
}
|
|
67
|
-
export
|
|
68
|
-
export * from "./canvas/index.js"
|
|
69
|
-
export default Graphics;
|
|
10
|
+
export default Graphics
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgCircle extends ZikoSvgElement{
|
|
3
3
|
constructor(cx,cy,r){
|
|
4
4
|
super("circle")
|
|
@@ -23,4 +23,7 @@ class ZikoSvgCircle extends ZikoSvgElement{
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
const svgCircle=(x,y,r)=>new ZikoSvgCircle(x,y,r);
|
|
26
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
svgCircle,
|
|
28
|
+
ZikoSvgCircle
|
|
29
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgEllipse extends ZikoSvgElement{
|
|
3
3
|
constructor(cx,cy,rx,ry){
|
|
4
4
|
super("ellipse")
|
|
@@ -18,4 +18,7 @@ class ZikoSvgEllipse extends ZikoSvgElement{
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
const svgEllipse=(x,y,rx,ry)=>new ZikoSvgEllipse(x,y,rx,ry);
|
|
21
|
-
export{
|
|
21
|
+
export{
|
|
22
|
+
svgEllipse,
|
|
23
|
+
ZikoSvgEllipse
|
|
24
|
+
}
|
package/src/graphics/svg/{Elements/Basic/foreignObject.js → elements/basic/foreign-object.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
2
|
-
import { Flex } from "../../../../ui/
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
|
+
import { Flex } from "../../../../ui/index.js"
|
|
3
3
|
class ZikoSvgForeignObject extends ZikoSvgElement{
|
|
4
4
|
constructor(x=0,y=0,w="100%",h="100%",...ZikoUIElement){
|
|
5
5
|
super("foreignObject")
|
|
@@ -29,5 +29,8 @@ class ZikoSvgForeignObject extends ZikoSvgElement{
|
|
|
29
29
|
return this;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const svgObject=(x,y,
|
|
33
|
-
export {
|
|
32
|
+
const svgObject=(x, y, w, h)=>new ZikoSvgForeignObject(x, y, w, h);
|
|
33
|
+
export {
|
|
34
|
+
svgObject,
|
|
35
|
+
ZikoSvgForeignObject
|
|
36
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgGroupe extends ZikoSvgElement{
|
|
3
3
|
constructor(...svgElement){
|
|
4
4
|
super();
|
|
@@ -26,4 +26,7 @@ class ZikoSvgGroupe extends ZikoSvgElement{
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const svgGroupe=(...svgElement)=>new ZikoSvgGroupe(...svgElement)
|
|
29
|
-
export {
|
|
29
|
+
export {
|
|
30
|
+
svgGroupe,
|
|
31
|
+
ZikoSvgGroupe
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgImage extends ZikoSvgElement{
|
|
3
3
|
constructor(src="",w="100%",h="100%",x=0,y=0){
|
|
4
4
|
super()
|
|
@@ -30,4 +30,7 @@ class ZikoSvgImage extends ZikoSvgElement{
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
const svgImage=(src,w,h,x,y)=>new ZikoSvgImage(src,w,h,x,y);
|
|
33
|
-
export {
|
|
33
|
+
export {
|
|
34
|
+
svgImage,
|
|
35
|
+
ZikoSvgImage
|
|
36
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./circle.js";
|
|
2
|
+
export * from "./ellipse.js";
|
|
3
|
+
export * from "./foreign-object.js";
|
|
4
|
+
export * from "./groupe.js";
|
|
5
|
+
export * from "./image.js";
|
|
6
|
+
export * from "./line.js";
|
|
7
|
+
export * from "./link.js";
|
|
8
|
+
export * from "./path.js";
|
|
9
|
+
export * from "./polygon.js";
|
|
10
|
+
export * from "./rect.js";
|
|
11
|
+
export * from "./text.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgLine extends ZikoSvgElement{
|
|
3
3
|
constructor(x1,y1,x2,y2){
|
|
4
4
|
super()
|
|
@@ -26,4 +26,7 @@ class ZikoSvgLine extends ZikoSvgElement{
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const svgLine=(x1,y1,x2,y2)=>new ZikoSvgLine(x1,y1,x2,y2);
|
|
29
|
-
export{
|
|
29
|
+
export{
|
|
30
|
+
svgLine,
|
|
31
|
+
ZikoSvgLine
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgLink extends ZikoSvgElement{
|
|
3
3
|
constructor(href,...svgElement){
|
|
4
4
|
super();
|
|
@@ -27,4 +27,7 @@ class ZikoSvgLink extends ZikoSvgElement{
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
const svgLink=(href,...svgElement)=>new ZikoSvgLink(href,...svgElement)
|
|
30
|
-
export{
|
|
30
|
+
export{
|
|
31
|
+
svgLink,
|
|
32
|
+
ZikoSvgLink
|
|
33
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgPath extends ZikoSvgElement{
|
|
3
3
|
constructor(){
|
|
4
4
|
super()
|
|
@@ -56,4 +56,7 @@ class ZikoSvgPath extends ZikoSvgElement{
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const svgPath=()=>new ZikoSvgPath();
|
|
59
|
-
export{
|
|
59
|
+
export{
|
|
60
|
+
svgPath,
|
|
61
|
+
ZikoSvgPath
|
|
62
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import ZikoSvgELement from "../
|
|
2
|
+
import ZikoSvgELement from "../ziko-svg-element.js";
|
|
3
3
|
class ZikoSvgRectangle extends ZikoSvgELement{
|
|
4
4
|
constructor(x,y,w,h,center=true){
|
|
5
5
|
super()
|
|
@@ -40,4 +40,7 @@ class ZikoSvgRectangle extends ZikoSvgELement{
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
const svgRect=(x,y,w,h,center)=>new ZikoSvgRectangle(x,y,w,h,center);
|
|
43
|
-
export{
|
|
43
|
+
export{
|
|
44
|
+
svgRect,
|
|
45
|
+
ZikoSvgRectangle
|
|
46
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ZikoSvgElement from "../
|
|
1
|
+
import ZikoSvgElement from "../ziko-svg-element.js";
|
|
2
2
|
class ZikoSvgText extends ZikoSvgElement{
|
|
3
3
|
constructor(text,x,y){
|
|
4
4
|
super()
|
|
@@ -23,4 +23,7 @@ class ZikoSvgText extends ZikoSvgElement{
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
const svgText=(text,x,y)=>new ZikoSvgText(text,x,y);
|
|
26
|
-
export{
|
|
26
|
+
export{
|
|
27
|
+
svgText,
|
|
28
|
+
ZikoSvgText
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./grid.js"
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ZikoUIElement } from "../../../ui";
|
|
2
|
+
class ZikoSvgElement extends ZikoUIElement{
|
|
2
3
|
constructor(type) {
|
|
3
|
-
|
|
4
|
+
super()
|
|
5
|
+
Object.assign(this.cache,{
|
|
4
6
|
type
|
|
5
|
-
}
|
|
7
|
+
})
|
|
6
8
|
}
|
|
7
9
|
pos(x,y){
|
|
8
10
|
return this.posX(x).posY(y);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./svg.js"
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./elements/index.js"
|