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.
Files changed (61) hide show
  1. package/dist/ziko.cjs +479 -1901
  2. package/dist/ziko.js +7648 -8185
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +7614 -8182
  5. package/package.json +1 -1
  6. package/readme.md +137 -0
  7. package/src/app/spa-file-based-routing.js +0 -1
  8. package/src/data/datatypes/color.js +11 -0
  9. package/src/graphics/canvas/canvas.js +13 -26
  10. package/src/graphics/canvas/elements/{Basic → basic}/arc.js +1 -1
  11. package/src/graphics/canvas/elements/{Basic → basic}/line.js +1 -1
  12. package/src/graphics/canvas/elements/{Basic → basic}/points.js +1 -1
  13. package/src/graphics/canvas/elements/{Basic → basic}/rect.js +1 -1
  14. package/src/graphics/canvas/elements/index.js +4 -4
  15. package/src/graphics/canvas/index.js +2 -15
  16. package/src/graphics/index.js +9 -68
  17. package/src/graphics/svg/{Elements/Basic → elements/basic}/circle.js +5 -2
  18. package/src/graphics/svg/{Elements/Basic → elements/basic}/ellipse.js +5 -2
  19. package/src/graphics/svg/{Elements/Basic/foreignObject.js → elements/basic/foreign-object.js} +7 -4
  20. package/src/graphics/svg/{Elements/Basic → elements/basic}/groupe.js +5 -2
  21. package/src/graphics/svg/{Elements/Basic → elements/basic}/image.js +5 -2
  22. package/src/graphics/svg/elements/basic/index.js +11 -0
  23. package/src/graphics/svg/{Elements/Basic → elements/basic}/line.js +5 -2
  24. package/src/graphics/svg/{Elements/Basic → elements/basic}/link.js +5 -2
  25. package/src/graphics/svg/{Elements/Basic → elements/basic}/path.js +5 -2
  26. package/src/graphics/svg/{Elements/Basic → elements/basic}/polygon.js +1 -1
  27. package/src/graphics/svg/{Elements/Basic → elements/basic}/polyline.js +4 -1
  28. package/src/graphics/svg/{Elements/Basic → elements/basic}/rect.js +5 -2
  29. package/src/graphics/svg/{Elements/Basic → elements/basic}/text.js +5 -2
  30. package/src/graphics/svg/{Elements/Derived → elements/derived}/grid.js +1 -1
  31. package/src/graphics/svg/elements/derived/index.js +1 -0
  32. package/src/graphics/svg/elements/index.js +2 -0
  33. package/src/graphics/svg/{Elements/ZikoSvgElement.js → elements/ziko-svg-element.js} +5 -3
  34. package/src/graphics/svg/index.js +1 -1
  35. package/src/graphics/svg/svg.js +19 -65
  36. package/src/index.js +2 -1
  37. package/src/reactivity/events/index.js +12 -63
  38. package/src/reactivity/hooks/index.js +8 -91
  39. package/src/reactivity/hooks/ui/index.js +2 -1
  40. package/src/reactivity/hooks/ui/useRoot.js +39 -0
  41. package/src/reactivity/index.js +2 -2
  42. package/src/ui/elements/primitives/ZikoUIContainerElement.js +155 -118
  43. package/src/ui/elements/primitives/ZikoUIElement.js +3 -3
  44. package/src/ui/elements/primitives/misc/xml-wrapper.js +3 -2
  45. package/src/ui/index.js +10 -1
  46. package/README.md +0 -246
  47. package/src/graphics/canvas/elements/Groupe.js +0 -0
  48. package/src/graphics/canvas/elements/grid.js +0 -0
  49. package/src/graphics/canvas/filter/index.js +0 -0
  50. package/src/graphics/canvas/paint/index.js +0 -0
  51. package/src/graphics/svg/Elements/index.js +0 -14
  52. /package/src/graphics/canvas/elements/{Basic → basic}/image.js +0 -0
  53. /package/src/graphics/canvas/elements/{Basic → basic}/path.js +0 -0
  54. /package/src/graphics/canvas/elements/{Basic → basic}/polygon.js +0 -0
  55. /package/src/graphics/canvas/elements/{Basic → basic}/polyline.js +0 -0
  56. /package/src/graphics/canvas/elements/{Basic → basic}/text.js +0 -0
  57. /package/src/graphics/canvas/elements/{Chart → chart}/histogram.js +0 -0
  58. /package/src/graphics/canvas/elements/{Chart → chart}/plot.js +0 -0
  59. /package/src/graphics/canvas/elements/{Chart → chart}/scatter.js +0 -0
  60. /package/src/graphics/canvas/elements/{Chart → chart}/stem.js +0 -0
  61. /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.16",
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
+ [![Star](https://img.shields.io/github/stars/zakarialaoui10/ziko.js?style=social)](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]]()
@@ -0,0 +1,11 @@
1
+ class Color {
2
+ constructor(){
3
+
4
+ }
5
+ static rgb(){
6
+
7
+ }
8
+ static rgba(){
9
+
10
+ }
11
+ }
@@ -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.render(globalThis.__Ziko__.__Config__.default.render);
24
- setTimeout(()=>this.resize(w,h),0);
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.Width/(xMax-xMin); // scaleX
93
- this.transformMatrix[1][1]=-this.Height/(yMax-yMin); // scaleY
94
- this.transformMatrix[0][2]=this.Width/2;
95
- this.transformMatrix[1][2]=this.Height/2;
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.Width, this.Height);
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.Width,h=this.Height){
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.Width, this.Height);
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.Width)
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,4 +1,4 @@
1
- import ZikoCanvasElement from "../Element.js";
1
+ import ZikoCanvasElement from "../element.js";
2
2
  class CanvasArc extends ZikoCanvasElement{
3
3
  constructor(x,y,r,angle){
4
4
  super(x,y);
@@ -1,4 +1,4 @@
1
- import ZikoCanvasElement from "../Element.js";
1
+ import ZikoCanvasElement from "../element.js";
2
2
  class CanvasLine extends ZikoCanvasElement{
3
3
  constructor(x0,y0,x1,y1){
4
4
  super();
@@ -1,4 +1,4 @@
1
- import ZikoCanvasElement from "../Element.js";
1
+ import ZikoCanvasElement from "../element.js";
2
2
  import { matrix } from "../../../../math/matrix/index.js";
3
3
  class CanvasPoints extends ZikoCanvasElement{
4
4
  constructor(ptsX,ptsY){
@@ -1,4 +1,4 @@
1
- import ZikoCanvasElement from "../Element.js";
1
+ import ZikoCanvasElement from "../element.js";
2
2
  class CanvasRect extends ZikoCanvasElement{
3
3
  constructor(x,y,w,h){
4
4
  super(x,y);
@@ -1,13 +1,13 @@
1
1
  export {
2
2
  canvasArc,
3
3
  canvasCircle
4
- } from "./Basic/arc.js";
4
+ } from "./basic/arc.js";
5
5
  export {
6
6
  canvasPoints
7
- } from "./Basic/points.js";
7
+ } from "./basic/points.js";
8
8
  export {
9
9
  canvasLine
10
- }from "./Basic/line.js"
10
+ }from "./basic/line.js"
11
11
  export {
12
12
  canvasRect
13
- } from "./Basic/rect.js"
13
+ } from "./basic/rect.js"
@@ -1,15 +1,2 @@
1
- import Canvas from "./canvas.js";
2
- import {
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"
@@ -1,69 +1,10 @@
1
- import{
2
- Svg,
3
- ZikoUISvg,
4
- svgCircle,
5
- svgEllipse,
6
- svgImage,
7
- svgLine,
8
- svgPolygon,
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 * from "./svg/index.js"
68
- export * from "./canvas/index.js"
69
- export default Graphics;
10
+ export default Graphics
@@ -1,4 +1,4 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
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 { svgCircle }
26
+ export {
27
+ svgCircle,
28
+ ZikoSvgCircle
29
+ }
@@ -1,4 +1,4 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
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{ svgEllipse }
21
+ export{
22
+ svgEllipse,
23
+ ZikoSvgEllipse
24
+ }
@@ -1,5 +1,5 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
2
- import { Flex } from "../../../../ui/elements/derived/flex"
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,r)=>new ZikoSvgForeignObject(x,y,r);
33
- export { svgObject }
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 "../ZikoSvgElement.js";
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 { svgGroupe }
29
+ export {
30
+ svgGroupe,
31
+ ZikoSvgGroupe
32
+ }
@@ -1,4 +1,4 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
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 { svgImage }
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 "../ZikoSvgElement.js";
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{ svgLine }
29
+ export{
30
+ svgLine,
31
+ ZikoSvgLine
32
+ }
@@ -1,4 +1,4 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
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{ svgLink }
30
+ export{
31
+ svgLink,
32
+ ZikoSvgLink
33
+ }
@@ -1,4 +1,4 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
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{ svgPath }
59
+ export{
60
+ svgPath,
61
+ ZikoSvgPath
62
+ }
@@ -1,4 +1,4 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
1
+ import ZikoSvgElement from "../ziko-svg-element.js";
2
2
  class ZikoSvgPolygon extends ZikoSvgElement{
3
3
  constructor(X=[],Y=[]){
4
4
  super()
@@ -1,4 +1,7 @@
1
1
  import ZikoSvgElement from "../ZikoSvgElement.js";
2
2
  class ZikoSvgPolyLine extends ZikoSvgElement{}
3
3
  const svgPolyLine=(X,Y)=>new ZikoSvgPolyLine(X,Y);
4
- export { svgPolyLine }
4
+ export {
5
+ svgPolyLine,
6
+ ZikoSvgPolyLine
7
+ }
@@ -1,5 +1,5 @@
1
1
 
2
- import ZikoSvgELement from "../ZikoSvgElement.js";
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{ svgRect }
43
+ export{
44
+ svgRect,
45
+ ZikoSvgRectangle
46
+ }
@@ -1,4 +1,4 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
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{ svgText }
26
+ export{
27
+ svgText,
28
+ ZikoSvgText
29
+ }
@@ -1,4 +1,4 @@
1
- import { svgPath } from "../Basic/path"
1
+ import { svgPath } from "../basic/path"
2
2
  const svgGrid=(w,h,r=10,c=10)=>{
3
3
  let path=svgPath().fill("none").stroke("coral").strokeWidth(0.6)
4
4
  console.log({x:w/r,y:h/c})
@@ -0,0 +1 @@
1
+ export * from "./grid.js"
@@ -0,0 +1,2 @@
1
+ export * from "./basic/index.js"
2
+ export { svgGrid } from "./derived/grid.js";
@@ -1,8 +1,10 @@
1
- class ZikoSvgElement {
1
+ import { ZikoUIElement } from "../../../ui";
2
+ class ZikoSvgElement extends ZikoUIElement{
2
3
  constructor(type) {
3
- this.cache = {
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 "./Elements/index.js"
2
+ export * from "./elements/index.js"