ziko 0.0.4 → 0.0.6

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 (234) hide show
  1. package/dist/ziko.cjs +10000 -9874
  2. package/dist/ziko.js +10001 -9875
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +9998 -9873
  5. package/package.json +15 -5
  6. package/starter/bin/index.js +10 -0
  7. package/wrapper/react/README.md +26 -0
  8. package/wrapper/react/index.jsx +22 -0
  9. package/wrapper/svelte/ZikoUI.svelte +15 -0
  10. package/wrapper/vue/ZikoUI.vue +23 -0
  11. package/src/App/Accessibility/index.js +0 -0
  12. package/src/App/Globals/__Target__.js +0 -3
  13. package/src/App/Globals/__UI__.js +0 -38
  14. package/src/App/Globals/__init__.js +0 -8
  15. package/src/App/Globals/index.js +0 -3
  16. package/src/App/Router/index.js +0 -40
  17. package/src/App/Seo/index.js +0 -43
  18. package/src/App/Themes/dark.js +0 -885
  19. package/src/App/Themes/index.js +0 -11
  20. package/src/App/Themes/light.js +0 -255
  21. package/src/App/app.js +0 -46
  22. package/src/App/index.js +0 -11
  23. package/src/Data/Api/fetchdom.js +0 -14
  24. package/src/Data/Api/index.js +0 -4
  25. package/src/Data/Api/preload.js +0 -11
  26. package/src/Data/Converter/canvas.js +0 -25
  27. package/src/Data/Converter/csv.js +0 -33
  28. package/src/Data/Converter/index.js +0 -25
  29. package/src/Data/Converter/json.js +0 -80
  30. package/src/Data/Converter/markdown.js +0 -83
  31. package/src/Data/Converter/svg.js +0 -11
  32. package/src/Data/Parser/markdown.js +0 -0
  33. package/src/Data/Parser/xml.js +0 -47
  34. package/src/Data/Strings/index.js +0 -26
  35. package/src/Data/decorators.js +0 -0
  36. package/src/Data/index.js +0 -64
  37. package/src/Graphics/Canvas/Elements/Basic/arc.js +0 -43
  38. package/src/Graphics/Canvas/Elements/Basic/image.js +0 -0
  39. package/src/Graphics/Canvas/Elements/Basic/line.js +0 -26
  40. package/src/Graphics/Canvas/Elements/Basic/path.js +0 -0
  41. package/src/Graphics/Canvas/Elements/Basic/points.js +0 -48
  42. package/src/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
  43. package/src/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  44. package/src/Graphics/Canvas/Elements/Basic/rect.js +0 -46
  45. package/src/Graphics/Canvas/Elements/Basic/text.js +0 -0
  46. package/src/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  47. package/src/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  48. package/src/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
  49. package/src/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  50. package/src/Graphics/Canvas/Elements/Element.js +0 -115
  51. package/src/Graphics/Canvas/Elements/Groupe.js +0 -0
  52. package/src/Graphics/Canvas/Elements/grid.js +0 -0
  53. package/src/Graphics/Canvas/Elements/index.js +0 -13
  54. package/src/Graphics/Canvas/Filter/index.js +0 -0
  55. package/src/Graphics/Canvas/Paint/index.js +0 -0
  56. package/src/Graphics/Canvas/Utils/color.js +0 -8
  57. package/src/Graphics/Canvas/Utils/floodFill.js +0 -58
  58. package/src/Graphics/Canvas/_canvas_offscreen +0 -0
  59. package/src/Graphics/Canvas/canvas.js +0 -189
  60. package/src/Graphics/Canvas/index.js +0 -15
  61. package/src/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
  62. package/src/Graphics/Svg/Elements/circle.js +0 -34
  63. package/src/Graphics/Svg/Elements/ellipse.js +0 -29
  64. package/src/Graphics/Svg/Elements/foreignObject.js +0 -46
  65. package/src/Graphics/Svg/Elements/grid.js +0 -9
  66. package/src/Graphics/Svg/Elements/groupe.js +0 -29
  67. package/src/Graphics/Svg/Elements/image.js +0 -33
  68. package/src/Graphics/Svg/Elements/line.js +0 -29
  69. package/src/Graphics/Svg/Elements/path.js +0 -59
  70. package/src/Graphics/Svg/Elements/polygon.js +0 -31
  71. package/src/Graphics/Svg/Elements/polyline.js +0 -4
  72. package/src/Graphics/Svg/Elements/rect.js +0 -43
  73. package/src/Graphics/Svg/Elements/text.js +0 -26
  74. package/src/Graphics/Svg/index.js +0 -1
  75. package/src/Graphics/Svg/svg.js +0 -117
  76. package/src/Graphics/index.js +0 -61
  77. package/src/Math/Calculus/Special Functions/bessel.js +0 -31
  78. package/src/Math/Calculus/Special Functions/beta.js +0 -38
  79. package/src/Math/Calculus/Special Functions/gamma.js +0 -30
  80. package/src/Math/Calculus/Special Functions/index.js +0 -4
  81. package/src/Math/Calculus/index.js +0 -1
  82. package/src/Math/Complex/Fractals/julia.js +0 -0
  83. package/src/Math/Complex/index.js +0 -191
  84. package/src/Math/Discret/Combinaison/index.js +0 -34
  85. package/src/Math/Discret/Conversion/index.js +0 -86
  86. package/src/Math/Discret/Logic/index.js +0 -46
  87. package/src/Math/Discret/Permutation/index.js +0 -31
  88. package/src/Math/Discret/Set/index.js +0 -2
  89. package/src/Math/Discret/Set/powerSet.js +0 -15
  90. package/src/Math/Discret/Set/subSet.js +0 -10
  91. package/src/Math/Discret/index.js +0 -23
  92. package/src/Math/Functions/index.js +0 -182
  93. package/src/Math/Matrix/Decomposition.js +0 -90
  94. package/src/Math/Matrix/LinearSystem.js +0 -10
  95. package/src/Math/Matrix/Matrix.js +0 -712
  96. package/src/Math/Matrix/index.js +0 -3
  97. package/src/Math/Numeric/index.js +0 -0
  98. package/src/Math/Random/index.js +0 -173
  99. package/src/Math/Signal/__np.py.txt +0 -40
  100. package/src/Math/Signal/conv.js +0 -175
  101. package/src/Math/Signal/fft.js +0 -55
  102. package/src/Math/Signal/filter.js +0 -39
  103. package/src/Math/Signal/functions.js +0 -146
  104. package/src/Math/Signal/index.js +0 -110
  105. package/src/Math/Statistics/Functions/index.js +0 -100
  106. package/src/Math/Statistics/index.js +0 -16
  107. package/src/Math/Utils/arithmetic.js +0 -139
  108. package/src/Math/Utils/checkers.js +0 -11
  109. package/src/Math/Utils/comparaison.js +0 -1
  110. package/src/Math/Utils/conversions.js +0 -7
  111. package/src/Math/Utils/discret.js +0 -28
  112. package/src/Math/Utils/index.js +0 -102
  113. package/src/Math/Utils/mapfun.js +0 -43
  114. package/src/Math/absract.js +0 -1
  115. package/src/Math/const.js +0 -3
  116. package/src/Math/index.js +0 -193
  117. package/src/Reactivity/Events/Global/Click.js +0 -56
  118. package/src/Reactivity/Events/Global/Clipboard.js +0 -84
  119. package/src/Reactivity/Events/Global/CustomEvent.js +0 -53
  120. package/src/Reactivity/Events/Global/Drag.js +0 -137
  121. package/src/Reactivity/Events/Global/Focus.js +0 -56
  122. package/src/Reactivity/Events/Global/Key.js +0 -104
  123. package/src/Reactivity/Events/Global/Mouse.js +0 -230
  124. package/src/Reactivity/Events/Global/Pointer.js +0 -214
  125. package/src/Reactivity/Events/Global/Touch.js +0 -0
  126. package/src/Reactivity/Events/Global/Wheel.js +0 -44
  127. package/src/Reactivity/Events/Partiel/Hash.js +0 -44
  128. package/src/Reactivity/Events/Partiel/Input.js +0 -59
  129. package/src/Reactivity/Events/Partiel/MediaEvent.js +0 -1
  130. package/src/Reactivity/Events/ZikoEvent.js +0 -91
  131. package/src/Reactivity/Events/index.js +0 -60
  132. package/src/Reactivity/Observer/index.js +0 -3
  133. package/src/Reactivity/Observer/intersection.js +0 -40
  134. package/src/Reactivity/Observer/mutation.js +0 -90
  135. package/src/Reactivity/Observer/resize.js +0 -47
  136. package/src/Reactivity/Use/Contexte/index.js +0 -1
  137. package/src/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
  138. package/src/Reactivity/Use/Decorators/index.js +0 -4
  139. package/src/Reactivity/Use/Interactions/index.js +0 -4
  140. package/src/Reactivity/Use/Interactions/useBluetooth.js +0 -48
  141. package/src/Reactivity/Use/Interactions/useChannel.js +0 -50
  142. package/src/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
  143. package/src/Reactivity/Use/Interactions/useSerial.js +0 -0
  144. package/src/Reactivity/Use/Interactions/useThread.js +0 -44
  145. package/src/Reactivity/Use/Interactions/useUsb.js +0 -0
  146. package/src/Reactivity/Use/Sensors/index.js +0 -2
  147. package/src/Reactivity/Use/Sensors/useBattery.js +0 -36
  148. package/src/Reactivity/Use/Sensors/useCamera.js +0 -0
  149. package/src/Reactivity/Use/Sensors/useGeolocation.js +0 -17
  150. package/src/Reactivity/Use/Sensors/useMicro.js +0 -0
  151. package/src/Reactivity/Use/Sensors/useOrientation.js +0 -0
  152. package/src/Reactivity/Use/Storage/index.js +0 -1
  153. package/src/Reactivity/Use/Storage/useCookie.js +0 -0
  154. package/src/Reactivity/Use/Storage/useIndexedDb.js +0 -0
  155. package/src/Reactivity/Use/Storage/useStorage.js +0 -74
  156. package/src/Reactivity/Use/UI/index.js +0 -4
  157. package/src/Reactivity/Use/UI/useCssLink.js +0 -0
  158. package/src/Reactivity/Use/UI/useCssText.js +0 -21
  159. package/src/Reactivity/Use/UI/useFavIcon.js +0 -38
  160. package/src/Reactivity/Use/UI/useLinearGradient.js +0 -0
  161. package/src/Reactivity/Use/UI/useMediaQuery.js +0 -1
  162. package/src/Reactivity/Use/UI/useRadialGradient.js +0 -0
  163. package/src/Reactivity/Use/UI/useStyle.js +0 -54
  164. package/src/Reactivity/Use/UI/useTheme.js +0 -62
  165. package/src/Reactivity/Use/UI/useTitle.js +0 -30
  166. package/src/Reactivity/Use/index.js +0 -82
  167. package/src/Reactivity/Use/todo.md +0 -26
  168. package/src/Reactivity/index.js +0 -3
  169. package/src/Time/animation.js +0 -76
  170. package/src/Time/index.js +0 -54
  171. package/src/Time/loop.js +0 -83
  172. package/src/Time/utils/decorators.js +0 -17
  173. package/src/Time/utils/ease.js +0 -144
  174. package/src/Time/utils/index.js +0 -18
  175. package/src/Time/utils/performance.js +0 -16
  176. package/src/Time/utils/ui.js +0 -26
  177. package/src/UI/CustomElement/Elements/Accordion/index.js +0 -62
  178. package/src/UI/CustomElement/Elements/Carousel/index.js +0 -47
  179. package/src/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
  180. package/src/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
  181. package/src/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
  182. package/src/UI/CustomElement/Elements/CodeNote/index.js +0 -2
  183. package/src/UI/CustomElement/Elements/Columns.js +0 -1
  184. package/src/UI/CustomElement/Elements/FAB.js +0 -0
  185. package/src/UI/CustomElement/Elements/Menu.js +0 -0
  186. package/src/UI/CustomElement/Elements/Notification.js +0 -0
  187. package/src/UI/CustomElement/Elements/Popover.js +0 -0
  188. package/src/UI/CustomElement/Elements/Popup.js +0 -0
  189. package/src/UI/CustomElement/Elements/Swipper.js +0 -4
  190. package/src/UI/CustomElement/Elements/Tabs/index.js +0 -111
  191. package/src/UI/CustomElement/Elements/Timeline.js +0 -0
  192. package/src/UI/CustomElement/Elements/Toast.js +0 -0
  193. package/src/UI/CustomElement/Elements/Treeview.js +0 -0
  194. package/src/UI/CustomElement/Elements/index.js +0 -4
  195. package/src/UI/CustomElement/Flex.js +0 -97
  196. package/src/UI/CustomElement/Grid.js +0 -30
  197. package/src/UI/CustomElement/index.js +0 -3
  198. package/src/UI/Embaded/index.js +0 -1
  199. package/src/UI/Inputs/Primitives/btn.js +0 -31
  200. package/src/UI/Inputs/Primitives/elements.js +0 -28
  201. package/src/UI/Inputs/Primitives/inputs.js +0 -334
  202. package/src/UI/Inputs/Primitives/select.js +0 -15
  203. package/src/UI/Inputs/Primitives/textarea.js +0 -16
  204. package/src/UI/Inputs/camera.js +0 -23
  205. package/src/UI/Inputs/index.js +0 -20
  206. package/src/UI/List/elements.js +0 -0
  207. package/src/UI/List/index.js +0 -130
  208. package/src/UI/Media/Audio/index.js +0 -39
  209. package/src/UI/Media/Image/figure.js +0 -17
  210. package/src/UI/Media/Image/image.js +0 -34
  211. package/src/UI/Media/Image/index.js +0 -2
  212. package/src/UI/Media/Video/index.js +0 -50
  213. package/src/UI/Media/index.js +0 -3
  214. package/src/UI/Misc/index.js +0 -49
  215. package/src/UI/Semantic/index.js +0 -68
  216. package/src/UI/Style/index.js +0 -499
  217. package/src/UI/Table/elements.js +0 -94
  218. package/src/UI/Table/index.js +0 -3
  219. package/src/UI/Table/table.js +0 -113
  220. package/src/UI/Table/utils.js +0 -12
  221. package/src/UI/Text/heading.js +0 -35
  222. package/src/UI/Text/index.js +0 -3
  223. package/src/UI/Text/p.js +0 -37
  224. package/src/UI/Text/pre.js +0 -0
  225. package/src/UI/Text/text.js +0 -66
  226. package/src/UI/Utils/index.js +0 -70
  227. package/src/UI/ZikoUIElement.js +0 -501
  228. package/src/UI/index.js +0 -154
  229. package/src/__proto__/Array.js +0 -74
  230. package/src/__proto__/Function.js +0 -0
  231. package/src/__proto__/Number.js +0 -76
  232. package/src/__proto__/Object.js +0 -0
  233. package/src/__proto__/String.js +0 -0
  234. package/src/index.js +0 -70
@@ -1,15 +0,0 @@
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,28 +0,0 @@
1
- class ZikoSvgElement {
2
- constructor() {
3
- this.cache = {};
4
- }
5
- color({ stroke, fill }) {
6
- this.element.setAttribute("stroke", stroke);
7
- this.element.setAttribute("fill", fill);
8
- return this;
9
- }
10
- fill(color = "none") {
11
- this.element.setAttribute("fill", color);
12
- return this;
13
- }
14
- stroke(color = "none", width) {
15
- this.element.setAttribute("stroke", color);
16
- width && this.strokeWidth(width);
17
- return this;
18
- }
19
- strokeWidth(width = 1) {
20
- this.element.setAttribute("stroke-width", width);
21
- return this;
22
- }
23
- opacity(value = 1) {
24
- this.element.setAttribute("opacity", value);
25
- return this;
26
- }
27
- }
28
- export default ZikoSvgElement;
@@ -1,34 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgCircle extends ZikoSvgElement{
3
- constructor(cx,cy,r){
4
- super()
5
- this.element=document.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "circle",
8
- );
9
- this.cx(cx).cy(cy).r(r);
10
- }
11
- cx(cx){
12
- this.element.cx.baseVal.value=cx;
13
- return this;
14
- }
15
- cy(cy){
16
- this.element.cy.baseVal.value=cy;
17
- return this;
18
- }
19
- r(r){
20
- this.element.r.baseVal.value=r;
21
- return this;
22
- }
23
- get R(){
24
- return this.element.r.baseVal.value;
25
- }
26
- get Cx(){
27
- return this.element.cx.baseVal.value;
28
- }
29
- get Cy(){
30
- return this.element.cy.baseVal.value;
31
- }
32
- }
33
- const svgCircle=(x,y,r)=>new ZikoSvgCircle(x,y,r);
34
- export default svgCircle
@@ -1,29 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgEllipse extends ZikoSvgElement{
3
- constructor(cx,cy,rx,ry){
4
- super()
5
- this.element=document.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "ellipse",
8
- );
9
- this.cx(cx).cy(cy).rx(rx).ry(ry);
10
- }
11
- cx(cx){
12
- this.element.cx.baseVal.value=cx;
13
- return this;
14
- }
15
- cy(cy){
16
- this.element.cy.baseVal.value=cy;
17
- return this;
18
- }
19
- rx(rx){
20
- this.element.rx.baseVal.value=rx;
21
- return this;
22
- }
23
- ry(ry){
24
- this.element.ry.baseVal.value=ry;
25
- return this;
26
- }
27
- }
28
- const svgEllipse=(x,y,rx,ry)=>new ZikoSvgEllipse(x,y,rx,ry);
29
- export default svgEllipse
@@ -1,46 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement";
2
- class ZikoSvgForeignObject extends ZikoSvgElement{
3
- constructor(x=0,y=0,w="100%",h="100%",...ZikoUIElement){
4
- super()
5
- this.items=[];
6
- this.element=document.createElementNS(
7
- "http://www.w3.org/2000/svg",
8
- "foreignObject",
9
- );
10
- this.x(x).y(y).width(w).height(h);
11
- this.add(...ZikoUIElement)
12
- }
13
- x(x){
14
- this.element.setAttribute("x",x)
15
- return this;
16
- }
17
- y(y){
18
- this.element.setAttribute("y",y)
19
- return this;
20
- }
21
- width(w){
22
- this.element.setAttribute("width",w)
23
- return this;
24
- }
25
- height(h){
26
- this.element.setAttribute("height",h)
27
- return this;
28
- }
29
- add(...ZikoUIElement){
30
- for(let i=0;i<ZikoUIElement.length;i++){
31
- this.element.appendChild(ZikoUIElement[i].element);
32
- this.items.push(ZikoUIElement[i])
33
- }
34
- if(ZikoUIElement.length===1)return ZikoUIElement[0]
35
- return ZikoUIElement;
36
- }
37
- remove(...ZikoUIElement){
38
- for(let i=0;i<ZikoUIElement.length;i++){
39
- this.element.removeChild(ZikoUIElement[i].element);
40
- this.items=this.items.filter(n=>!ZikoUIElement)
41
- }
42
- return this;
43
- }
44
- }
45
- const svgObject=(x,y,r)=>new ZikoSvgForeignObject(x,y,r);
46
- export default svgObject
@@ -1,9 +0,0 @@
1
- import svgPath from "./path.js"
2
- var svgGrid=(w,h,r=10,c=10)=>{
3
- let path=svgPath().fill("none").stroke("coral").strokeWidth(0.6)
4
- console.log({x:w/r,y:h/c})
5
- for(let i=0;i<w;i++) path.moveTo(0,i*w/r).hr(w)
6
- for(let j=0;j<h;j++) path.moveTo(j*h/c,0).vr(h)
7
- return path
8
- }
9
- export default svgGrid;
@@ -1,29 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgGroupe extends ZikoSvgElement{
3
- constructor(...svgElement){
4
- super();
5
- this.items=[];
6
- this.element=document.createElementNS(
7
- "http://www.w3.org/2000/svg",
8
- "g",
9
- );
10
- this.add(...svgElement)
11
- }
12
- add(...svgElement){
13
- for(let i=0;i<svgElement.length;i++){
14
- this.element.appendChild(svgElement[i].element);
15
- this.items.push(svgElement[i])
16
- }
17
- if(svgElement.length===1)return svgElement[0]
18
- return svgElement;
19
- }
20
- remove(...svgElement){
21
- for(let i=0;i<svgElement.length;i++){
22
- this.element.removeChild(svgElement[i].element);
23
- this.items=this.items.filter(n=>!svgElement)
24
- }
25
- return this;
26
- }
27
- }
28
- const svgGroupe=(...svgElement)=>new ZikoSvgGroupe(...svgElement)
29
- export default svgGroupe
@@ -1,33 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgImage extends ZikoSvgElement{
3
- constructor(src="",w="100%",h="100%",x=0,y=0){
4
- super()
5
- this.element=document.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "image",
8
- );
9
- this.setSrc(src).width(w).height(h).x(x).y(y);
10
- }
11
- x(x){
12
- this.element.x.baseVal.value=x;
13
- return this;
14
- }
15
- y(y){
16
- this.element.y.baseVal.value=y;
17
- return this;
18
- }
19
- width(w){
20
- this.element.setAttribute("width",w);
21
- return this;
22
- }
23
- height(h){
24
- this.element.setAttribute("height",h);
25
- return this;
26
- }
27
- setSrc(src=""){
28
- this.element.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', src)
29
- return this;
30
- }
31
- }
32
- const svgImage=(src,w,h,x,y)=>new ZikoSvgImage(src,w,h,x,y);
33
- export default svgImage
@@ -1,29 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgLine extends ZikoSvgElement{
3
- constructor(x1,y1,x2,y2){
4
- super()
5
- this.element=document.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "line",
8
- );
9
- this.x1(x1).y1(y1).x2(x2).y2(y2).stroke("black");
10
- }
11
- x1(x1){
12
- this.element.x1.baseVal.value=x1;
13
- return this;
14
- }
15
- y1(y1){
16
- this.element.y1.baseVal.value=y1;
17
- return this;
18
- }
19
- x2(x2){
20
- this.element.x2.baseVal.value=x2;
21
- return this;
22
- }
23
- y2(y2){
24
- this.element.y2.baseVal.value=y2;
25
- return this;
26
- }
27
- }
28
- const svgLine=(x1,y1,x2,y2)=>new ZikoSvgLine(x1,y1,x2,y2);
29
- export default svgLine
@@ -1,59 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgPath extends ZikoSvgElement{
3
- constructor(){
4
- super()
5
- this.element=document.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "path",
8
- );
9
- this.path="";
10
-
11
- }
12
- setPath(){
13
- this.element.setAttribute("d",this.path);
14
- return this;
15
- }
16
- clear(){
17
- this.path="";
18
- this.setPath();
19
- return this;
20
- }
21
- moveTo(x,y){
22
- this.path+=`M${x} ${y} `;
23
- this.setPath();
24
- return this;
25
- }
26
- lineTo(x,y){
27
- this.path+=`L${x} ${y} `;
28
- this.setPath();
29
- return this;
30
- }
31
- hr(x){
32
- this.path+=`H${x} `;
33
- this.setPath();
34
- return this;
35
- }
36
- vr(y){
37
- this.path+=`V${y} `;
38
- this.setPath();
39
- return this;
40
- }
41
- bezier(x1,y1,x2,y2,x,y){
42
- this.path+=`C ${x1} ${y1},${x2} ${y2},${x} ${y} `;
43
- this.setPath();
44
- return this;
45
- }
46
- quadratic(x1,y1,x,y){
47
- this.path+=`Q ${x1} ${y1} ${x} ${y} `;
48
- this.setPath();
49
- return this;
50
- }
51
- close(){
52
- this.path+="Z";
53
- this.setPath();
54
- return this;
55
- }
56
- }
57
-
58
- const svgPath=(x,y,r)=>new ZikoSvgPath(x,y,r);
59
- export default svgPath
@@ -1,31 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgPolygon extends ZikoSvgElement{
3
- constructor(X=[],Y=[]){
4
- super()
5
- this.X=X;
6
- this.Y=Y
7
- this.element=document.createElementNS(
8
- "http://www.w3.org/2000/svg",
9
- "polygon",
10
- );
11
- this.element.setAttribute("points","")
12
- }
13
- addPoint(x,y){
14
- let p=this.element.parentElement.createSVGPoint();
15
- p.x=x;
16
- p.y=y;
17
- this.element.points.appendItem(p);
18
- return this;
19
- }
20
- addPoints(X,Y){
21
- for(let i=0;i<X.length;i++){
22
- let p=this.element.parentElement.createSVGPoint();
23
- p.x=X[i];
24
- p.y=Y[i];
25
- this.element.points.appendItem(p)
26
- }
27
- return this;
28
- }
29
- }
30
- const svgPolygon=(X,Y)=>new ZikoSvgPolygon(X,Y);
31
- export default svgPolygon
@@ -1,4 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgLine extends ZikoSvgElement{}
3
- const svgLine=(X,Y)=>new ZikoSvgLine(X,Y);
4
- export default svgLine
@@ -1,43 +0,0 @@
1
-
2
- import ZikoSvgELement from "./ZikoSvgElement.js";
3
- class ZikoSvgRectangle extends ZikoSvgELement{
4
- constructor(x,y,w,h,center=true){
5
- super()
6
- this.element=document.createElementNS(
7
- "http://www.w3.org/2000/svg",
8
- "rect",
9
- );
10
- this.setX(x).setY(y).width(w).height(h);
11
- this.rx=this.x+this.w/2;
12
- this.ty=this.y+this.h/2;
13
- }
14
- setX(x){
15
- this.element.x.baseVal.value=x;
16
- this.x=x;
17
- return this;
18
- }
19
- setY(y){
20
- this.element.y.baseVal.value=y;
21
- this.y=y;
22
- return this;
23
- }
24
- r(rx,ry){
25
- this.rx=rx;
26
- this.ry=ry;
27
- this.setX(this.rx-this.w/2);
28
- this.setY(this.ry-this.h/2);
29
- return this;
30
- }
31
- width(w){
32
- this.element.width.baseVal.value=w;
33
- this.w=w;
34
- return this;
35
- }
36
- height(h){
37
- this.element.height.baseVal.value=h;
38
- this.h=h;
39
- return this;
40
- }
41
- }
42
- const svgRect=(x,y,w,h,center)=>new ZikoSvgRectangle(x,y,w,h,center);
43
- export default svgRect
@@ -1,26 +0,0 @@
1
- import ZikoSvgElement from "./ZikoSvgElement.js";
2
- class ZikoSvgText extends ZikoSvgElement{
3
- constructor(text,x,y){
4
- super()
5
- this.element=document.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "text",
8
- );
9
- this.setText(text)
10
- this.x(x).y(y);
11
- }
12
- x(x){
13
- this.element.setAttribute("x",x);
14
- return this;
15
- }
16
- y(y){
17
- this.element.setAttribute("y",y);
18
- return this;
19
- }
20
- setText(text=""){
21
- this.element.textContent=text;
22
- return this;
23
- }
24
- }
25
- const svgText=(text,x,y)=>new ZikoSvgText(text,x,y);
26
- export default svgText
@@ -1 +0,0 @@
1
- export* from "./svg.js"
@@ -1,117 +0,0 @@
1
- import ZikoUIElement from "../../UI/ZikoUIElement.js";
2
- import svgRect from "./Elements/rect.js";
3
- import svgCircle from "./Elements/circle.js";
4
- import svgEllipse from "./Elements/ellipse.js";
5
- import svgLine from "./Elements/line.js";
6
- //import svgPath from "./Elements/path.js";
7
- import svgPolygon from "./Elements/polygon.js";
8
- import svgImage from "./Elements/image.js";
9
- import svgText from "./Elements/text.js";
10
- import svgGroupe from "./Elements/groupe.js";
11
- //import svgObject from "./Elements/foreignObject.js";
12
- //import svgGrid from "./Elements/grid.js";
13
-
14
- class ZikoUISvg extends ZikoUIElement {
15
- constructor(w=360,h=300) {
16
- super();
17
- this.element=document.createElementNS("http://www.w3.org/2000/svg", "svg");
18
- //this.cache={};
19
- this.setAttr("width",w);
20
- this.setAttr("height",h);
21
- this.style({border:"1px black solid"});
22
- //this.view(-w/2,-h/2,w/2,h/2)
23
- //this.view(-10,-10,10,10);
24
- this.render();
25
- }
26
- view(x1,y1,x2,y2){
27
- let width=Math.abs(x2-x1);
28
- let height=Math.abs(y2-y1);
29
- //this.element.style.transform="scale("+Math.sign(x2-x1)+","+(-Math.sign(y2-y1))+")";
30
- this.setAttr("viewBox",[x1,y1,width,height].join(" "));
31
- //console.log({width:width,height:height})
32
- return this;
33
-
34
- }
35
- add(...svgElement){
36
- for(let i=0;i<svgElement.length;i++){
37
- this.element.appendChild(svgElement[i].element);
38
- this.items.push(svgElement[i])
39
- }
40
- this.maintain()
41
- return this;
42
- }
43
- remove(...svgElement){
44
- for(let i=0;i<svgElement.length;i++){
45
- this.element.removeChild(svgElement[i].element);
46
- this.items=this.items.filter(n=>!svgElement)
47
- }
48
- this.maintain();
49
- return this;
50
- }
51
- // text(text,x,y){
52
- // let item=svgText(text,x,y);
53
- // this.element.appendChild(item.element);
54
- // item.x(x-item.element.getComputedTextLength()/2);
55
- // return item;
56
- // }
57
- // rect(x,y,w,h){
58
- // let item=svgRect(x,y,w,h);
59
- // this.add(item);
60
- // return item;
61
- // }
62
- // line(x1,y1,x2,y2){
63
- // let item=svgLine(x1,y1,x2,y2);
64
- // this.element.appendChild(item.element);
65
- // return item;
66
- // }
67
- // circle(cx,cy,r){
68
- // let item=svgCircle(cx,cy,r);
69
- // this.element.appendChild(item.element);
70
- // return item;
71
- // }
72
- // ellipse(cx,cy,rx,ry){
73
- // let item=svgEllipse(cx,cy,rx,ry);
74
- // this.element.appendChild(item.element);
75
- // return item;
76
- // }
77
- // polygon(X,Y){
78
- // let item=svgPolygon(X,Y);
79
- // this.element.appendChild(item.element);
80
- // item.addPoints(X,Y)
81
- // return item;
82
- // }
83
- // image(src,w,h,x,y){
84
- // let item=svgImage(src,w,h,x,y);
85
- // this.element.appendChild(item.element);
86
- // return item;
87
- // }
88
- mask(){
89
-
90
- }
91
- toString(){
92
- return (new XMLSerializer()).serializeToString(this.element);
93
- }
94
- btoa(){
95
- return btoa(this.toString())
96
- }
97
- toImg(){
98
- return 'data:image/svg+xml;base64,'+this.btoa()
99
- }
100
- toImg2(){
101
- return "data:image/svg+xml;charset=utf8,"+this.toString().replaceAll("<","%3C").replaceAll(">","%3E").replaceAll("#","%23").replaceAll('"',"'");
102
- }
103
- }
104
-
105
- const Svg =(w,h)=>new ZikoUISvg(w,h);
106
- export{
107
- Svg,
108
- ZikoUISvg,
109
- svgCircle,
110
- svgEllipse,
111
- svgImage,
112
- svgLine,
113
- svgPolygon,
114
- svgRect,
115
- svgText,
116
- svgGroupe
117
- }
@@ -1,61 +0,0 @@
1
- import{
2
- Svg,
3
- ZikoUISvg,
4
- svgCircle,
5
- svgEllipse,
6
- svgImage,
7
- svgLine,
8
- svgPolygon,
9
- svgRect,
10
- svgText,
11
- svgGroupe
12
- } from "./Svg";
13
- import {
14
- Canvas,
15
- canvasArc,
16
- canvasCircle,
17
- canvasPoints,
18
- canvasLine,
19
- canvasRect
20
- } from "./Canvas";
21
- const Graphics={
22
- Svg,
23
- ZikoUISvg,
24
- svgCircle,
25
- svgEllipse,
26
- svgImage,
27
- svgLine,
28
- svgPolygon,
29
- svgRect,
30
- svgText,
31
- svgGroupe,
32
- Canvas,
33
- canvasArc,
34
- canvasCircle,
35
- canvasPoints,
36
- canvasLine,
37
- canvasRect,
38
- ExtractAll: function () {
39
- const keys = Object.keys(this);
40
- for (let i = 0; i < keys.length; i++) {
41
- const key = keys[i];
42
- if (key !== 'ExtractAll' && key !== 'RemoveAll') {
43
- globalThis[key] = this[key];
44
- }
45
- }
46
- return this;
47
- },
48
- RemoveAll: function () {
49
- const keys = Object.keys(this);
50
- for (let i = 0; i < keys.length; i++) {
51
- const key = keys[i];
52
- if (key !== 'RemoveAll') {
53
- delete globalThis[key];
54
- }
55
- }
56
- return this;
57
- }
58
- }
59
- export * from "./Svg"
60
- export * from "./Canvas"
61
- export default Graphics;
@@ -1,31 +0,0 @@
1
- import { mapfun } from "../../Utils";
2
- import { fact } from "../../Functions";
3
- const _bessel=(n, x)=>{
4
- const maxTerms = 100;
5
- let result = 0;
6
- for (let k = 0; k < maxTerms; k++) {
7
- const numerator = Math.pow(-1, k) * Math.pow(x / 2, n + 2 * k);
8
- const denominator = fact(k) * fact(n + k);
9
- result += numerator / denominator;
10
- }
11
- return result;
12
- }
13
- const bessel=(n,x)=>{
14
- if(typeof n === "number"){
15
- if(typeof n === "number")return _bessel(n,x);
16
- else console.warn("Not supported yet")
17
- }
18
- else if(n instanceof Array){
19
- if(typeof x === "number") return mapfun(a=>_bessel(a,x),...n);
20
- else if(x instanceof Array){
21
- const Y=[];
22
- for(let i=0;i<n.length;i++){
23
- Y.push(mapfun(a=>_bessel(n[i],a),...x))
24
- }
25
- return Y;
26
- }
27
- }
28
- }
29
- export{
30
- bessel
31
- }
@@ -1,38 +0,0 @@
1
- import { mapfun } from "../../Utils";
2
- const _beta=(x, y)=>{
3
- const lowerLimit = 0;
4
- const upperLimit = 1;
5
- const intervals = 1000;
6
- let result = 0;
7
-
8
- const f = (t) => Math.pow(t, x - 1) * Math.pow(1 - t, y - 1);
9
- const h = (upperLimit - lowerLimit) / intervals;
10
-
11
- result += 0.5 * (f(lowerLimit) + f(upperLimit));
12
-
13
- for (let i = 1; i < intervals; i++) {
14
- const xi = lowerLimit + i * h;
15
- result += f(xi);
16
- }
17
-
18
- return result * h;
19
- }
20
- const beta=(x,y)=>{
21
- if(typeof x === "number"){
22
- if(typeof x === "number")return _beta(x,y);
23
- else console.warn("Not supported yet")
24
- }
25
- else if(x instanceof Array){
26
- if(typeof y === "number") return mapfun(a=>_beta(a,y),...x);
27
- else if(y instanceof Array){
28
- const Z=[];
29
- for(let i=0;i<x.length;i++){
30
- Z.push(mapfun(a=>_beta(x[i],a),...y))
31
- }
32
- return Z;
33
- }
34
- }
35
- }
36
- export{
37
- beta
38
- }