ziko 0.0.5 → 0.0.7

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 (236) hide show
  1. package/README.md +171 -182
  2. package/dist/ziko.cjs +10022 -9853
  3. package/dist/ziko.js +10023 -9854
  4. package/dist/ziko.min.js +2 -2
  5. package/dist/ziko.mjs +10021 -9853
  6. package/package.json +12 -4
  7. package/starter/bin/index.js +11 -0
  8. package/wrapper/react/README.md +26 -0
  9. package/wrapper/react/index.jsx +7 -1
  10. package/wrapper/svelte/ZikoUI.svelte +15 -0
  11. package/wrapper/vue/ZikoUI.vue +8 -2
  12. package/core/App/Accessibility/index.js +0 -0
  13. package/core/App/Globals/__Target__.js +0 -3
  14. package/core/App/Globals/__UI__.js +0 -38
  15. package/core/App/Globals/__init__.js +0 -8
  16. package/core/App/Globals/index.js +0 -18
  17. package/core/App/Router/index.js +0 -40
  18. package/core/App/Seo/index.js +0 -43
  19. package/core/App/Themes/dark.js +0 -885
  20. package/core/App/Themes/index.js +0 -11
  21. package/core/App/Themes/light.js +0 -255
  22. package/core/App/app.js +0 -46
  23. package/core/App/index.js +0 -12
  24. package/core/Data/Api/fetchdom.js +0 -14
  25. package/core/Data/Api/index.js +0 -4
  26. package/core/Data/Api/preload.js +0 -11
  27. package/core/Data/Converter/canvas.js +0 -25
  28. package/core/Data/Converter/csv.js +0 -33
  29. package/core/Data/Converter/index.js +0 -25
  30. package/core/Data/Converter/json.js +0 -80
  31. package/core/Data/Converter/markdown.js +0 -83
  32. package/core/Data/Converter/svg.js +0 -11
  33. package/core/Data/Parser/markdown.js +0 -0
  34. package/core/Data/Parser/xml.js +0 -47
  35. package/core/Data/Strings/index.js +0 -26
  36. package/core/Data/decorators.js +0 -0
  37. package/core/Data/index.js +0 -64
  38. package/core/Graphics/Canvas/Elements/Basic/arc.js +0 -43
  39. package/core/Graphics/Canvas/Elements/Basic/image.js +0 -0
  40. package/core/Graphics/Canvas/Elements/Basic/line.js +0 -26
  41. package/core/Graphics/Canvas/Elements/Basic/path.js +0 -0
  42. package/core/Graphics/Canvas/Elements/Basic/points.js +0 -48
  43. package/core/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
  44. package/core/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  45. package/core/Graphics/Canvas/Elements/Basic/rect.js +0 -46
  46. package/core/Graphics/Canvas/Elements/Basic/text.js +0 -0
  47. package/core/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  48. package/core/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  49. package/core/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
  50. package/core/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  51. package/core/Graphics/Canvas/Elements/Element.js +0 -115
  52. package/core/Graphics/Canvas/Elements/Groupe.js +0 -0
  53. package/core/Graphics/Canvas/Elements/grid.js +0 -0
  54. package/core/Graphics/Canvas/Elements/index.js +0 -13
  55. package/core/Graphics/Canvas/Filter/index.js +0 -0
  56. package/core/Graphics/Canvas/Paint/index.js +0 -0
  57. package/core/Graphics/Canvas/Utils/color.js +0 -8
  58. package/core/Graphics/Canvas/Utils/floodFill.js +0 -58
  59. package/core/Graphics/Canvas/_canvas_offscreen +0 -0
  60. package/core/Graphics/Canvas/canvas.js +0 -189
  61. package/core/Graphics/Canvas/index.js +0 -15
  62. package/core/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
  63. package/core/Graphics/Svg/Elements/circle.js +0 -34
  64. package/core/Graphics/Svg/Elements/ellipse.js +0 -29
  65. package/core/Graphics/Svg/Elements/foreignObject.js +0 -46
  66. package/core/Graphics/Svg/Elements/grid.js +0 -9
  67. package/core/Graphics/Svg/Elements/groupe.js +0 -29
  68. package/core/Graphics/Svg/Elements/image.js +0 -33
  69. package/core/Graphics/Svg/Elements/line.js +0 -29
  70. package/core/Graphics/Svg/Elements/path.js +0 -59
  71. package/core/Graphics/Svg/Elements/polygon.js +0 -31
  72. package/core/Graphics/Svg/Elements/polyline.js +0 -4
  73. package/core/Graphics/Svg/Elements/rect.js +0 -43
  74. package/core/Graphics/Svg/Elements/text.js +0 -26
  75. package/core/Graphics/Svg/index.js +0 -1
  76. package/core/Graphics/Svg/svg.js +0 -117
  77. package/core/Graphics/index.js +0 -61
  78. package/core/Math/Calculus/Special Functions/bessel.js +0 -31
  79. package/core/Math/Calculus/Special Functions/beta.js +0 -38
  80. package/core/Math/Calculus/Special Functions/gamma.js +0 -30
  81. package/core/Math/Calculus/Special Functions/index.js +0 -4
  82. package/core/Math/Calculus/index.js +0 -1
  83. package/core/Math/Complex/Fractals/julia.js +0 -0
  84. package/core/Math/Complex/index.js +0 -191
  85. package/core/Math/Discret/Combinaison/index.js +0 -34
  86. package/core/Math/Discret/Conversion/index.js +0 -86
  87. package/core/Math/Discret/Logic/index.js +0 -46
  88. package/core/Math/Discret/Permutation/index.js +0 -31
  89. package/core/Math/Discret/Set/index.js +0 -2
  90. package/core/Math/Discret/Set/powerSet.js +0 -15
  91. package/core/Math/Discret/Set/subSet.js +0 -10
  92. package/core/Math/Discret/index.js +0 -23
  93. package/core/Math/Functions/index.js +0 -182
  94. package/core/Math/Matrix/Decomposition.js +0 -90
  95. package/core/Math/Matrix/LinearSystem.js +0 -10
  96. package/core/Math/Matrix/Matrix.js +0 -712
  97. package/core/Math/Matrix/index.js +0 -3
  98. package/core/Math/Numeric/index.js +0 -0
  99. package/core/Math/Random/index.js +0 -173
  100. package/core/Math/Signal/__np.py.txt +0 -40
  101. package/core/Math/Signal/conv.js +0 -175
  102. package/core/Math/Signal/fft.js +0 -55
  103. package/core/Math/Signal/filter.js +0 -39
  104. package/core/Math/Signal/functions.js +0 -146
  105. package/core/Math/Signal/index.js +0 -110
  106. package/core/Math/Statistics/Functions/index.js +0 -100
  107. package/core/Math/Statistics/index.js +0 -16
  108. package/core/Math/Utils/arithmetic.js +0 -139
  109. package/core/Math/Utils/checkers.js +0 -11
  110. package/core/Math/Utils/comparaison.js +0 -1
  111. package/core/Math/Utils/conversions.js +0 -7
  112. package/core/Math/Utils/discret.js +0 -28
  113. package/core/Math/Utils/index.js +0 -102
  114. package/core/Math/Utils/mapfun.js +0 -43
  115. package/core/Math/absract.js +0 -1
  116. package/core/Math/const.js +0 -3
  117. package/core/Math/index.js +0 -193
  118. package/core/Reactivity/Events/Global/Click.js +0 -56
  119. package/core/Reactivity/Events/Global/Clipboard.js +0 -84
  120. package/core/Reactivity/Events/Global/CustomEvent.js +0 -53
  121. package/core/Reactivity/Events/Global/Drag.js +0 -137
  122. package/core/Reactivity/Events/Global/Focus.js +0 -56
  123. package/core/Reactivity/Events/Global/Key.js +0 -104
  124. package/core/Reactivity/Events/Global/Mouse.js +0 -230
  125. package/core/Reactivity/Events/Global/Pointer.js +0 -214
  126. package/core/Reactivity/Events/Global/Touch.js +0 -0
  127. package/core/Reactivity/Events/Global/Wheel.js +0 -44
  128. package/core/Reactivity/Events/Partiel/Hash.js +0 -44
  129. package/core/Reactivity/Events/Partiel/Input.js +0 -59
  130. package/core/Reactivity/Events/Partiel/MediaEvent.js +0 -1
  131. package/core/Reactivity/Events/ZikoEvent.js +0 -91
  132. package/core/Reactivity/Events/index.js +0 -60
  133. package/core/Reactivity/Observer/index.js +0 -3
  134. package/core/Reactivity/Observer/intersection.js +0 -40
  135. package/core/Reactivity/Observer/mutation.js +0 -90
  136. package/core/Reactivity/Observer/resize.js +0 -47
  137. package/core/Reactivity/Use/Contexte/index.js +0 -1
  138. package/core/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
  139. package/core/Reactivity/Use/Decorators/index.js +0 -4
  140. package/core/Reactivity/Use/Interactions/index.js +0 -4
  141. package/core/Reactivity/Use/Interactions/useBluetooth.js +0 -48
  142. package/core/Reactivity/Use/Interactions/useChannel.js +0 -50
  143. package/core/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
  144. package/core/Reactivity/Use/Interactions/useSerial.js +0 -0
  145. package/core/Reactivity/Use/Interactions/useThread.js +0 -44
  146. package/core/Reactivity/Use/Interactions/useUsb.js +0 -0
  147. package/core/Reactivity/Use/Sensors/index.js +0 -2
  148. package/core/Reactivity/Use/Sensors/useBattery.js +0 -36
  149. package/core/Reactivity/Use/Sensors/useCamera.js +0 -0
  150. package/core/Reactivity/Use/Sensors/useGeolocation.js +0 -17
  151. package/core/Reactivity/Use/Sensors/useMicro.js +0 -0
  152. package/core/Reactivity/Use/Sensors/useOrientation.js +0 -0
  153. package/core/Reactivity/Use/Storage/index.js +0 -1
  154. package/core/Reactivity/Use/Storage/useCookie.js +0 -0
  155. package/core/Reactivity/Use/Storage/useIndexedDb.js +0 -0
  156. package/core/Reactivity/Use/Storage/useStorage.js +0 -74
  157. package/core/Reactivity/Use/UI/index.js +0 -4
  158. package/core/Reactivity/Use/UI/useCssLink.js +0 -0
  159. package/core/Reactivity/Use/UI/useCssText.js +0 -21
  160. package/core/Reactivity/Use/UI/useFavIcon.js +0 -38
  161. package/core/Reactivity/Use/UI/useLinearGradient.js +0 -0
  162. package/core/Reactivity/Use/UI/useMediaQuery.js +0 -1
  163. package/core/Reactivity/Use/UI/useRadialGradient.js +0 -0
  164. package/core/Reactivity/Use/UI/useStyle.js +0 -54
  165. package/core/Reactivity/Use/UI/useTheme.js +0 -62
  166. package/core/Reactivity/Use/UI/useTitle.js +0 -30
  167. package/core/Reactivity/Use/index.js +0 -82
  168. package/core/Reactivity/Use/todo.md +0 -26
  169. package/core/Reactivity/index.js +0 -3
  170. package/core/Time/animation.js +0 -76
  171. package/core/Time/index.js +0 -54
  172. package/core/Time/loop.js +0 -83
  173. package/core/Time/utils/decorators.js +0 -17
  174. package/core/Time/utils/ease.js +0 -144
  175. package/core/Time/utils/index.js +0 -18
  176. package/core/Time/utils/performance.js +0 -16
  177. package/core/Time/utils/ui.js +0 -26
  178. package/core/UI/CustomElement/Elements/Accordion/index.js +0 -62
  179. package/core/UI/CustomElement/Elements/Carousel/index.js +0 -47
  180. package/core/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
  181. package/core/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
  182. package/core/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
  183. package/core/UI/CustomElement/Elements/CodeNote/index.js +0 -2
  184. package/core/UI/CustomElement/Elements/Columns.js +0 -1
  185. package/core/UI/CustomElement/Elements/FAB.js +0 -0
  186. package/core/UI/CustomElement/Elements/Menu.js +0 -0
  187. package/core/UI/CustomElement/Elements/Notification.js +0 -0
  188. package/core/UI/CustomElement/Elements/Popover.js +0 -0
  189. package/core/UI/CustomElement/Elements/Popup.js +0 -0
  190. package/core/UI/CustomElement/Elements/Swipper.js +0 -4
  191. package/core/UI/CustomElement/Elements/Tabs/index.js +0 -111
  192. package/core/UI/CustomElement/Elements/Timeline.js +0 -0
  193. package/core/UI/CustomElement/Elements/Toast.js +0 -0
  194. package/core/UI/CustomElement/Elements/Treeview.js +0 -0
  195. package/core/UI/CustomElement/Elements/index.js +0 -4
  196. package/core/UI/CustomElement/Flex.js +0 -97
  197. package/core/UI/CustomElement/Grid.js +0 -30
  198. package/core/UI/CustomElement/index.js +0 -3
  199. package/core/UI/Embaded/index.js +0 -1
  200. package/core/UI/Inputs/Primitives/btn.js +0 -30
  201. package/core/UI/Inputs/Primitives/elements.js +0 -28
  202. package/core/UI/Inputs/Primitives/inputs.js +0 -324
  203. package/core/UI/Inputs/Primitives/select.js +0 -14
  204. package/core/UI/Inputs/Primitives/textarea.js +0 -15
  205. package/core/UI/Inputs/camera.js +0 -23
  206. package/core/UI/Inputs/index.js +0 -20
  207. package/core/UI/List/elements.js +0 -0
  208. package/core/UI/List/index.js +0 -127
  209. package/core/UI/Media/Audio/index.js +0 -38
  210. package/core/UI/Media/Image/figure.js +0 -16
  211. package/core/UI/Media/Image/image.js +0 -33
  212. package/core/UI/Media/Image/index.js +0 -2
  213. package/core/UI/Media/Video/index.js +0 -49
  214. package/core/UI/Media/index.js +0 -3
  215. package/core/UI/Misc/index.js +0 -45
  216. package/core/UI/Semantic/index.js +0 -61
  217. package/core/UI/Style/index.js +0 -499
  218. package/core/UI/Table/elements.js +0 -94
  219. package/core/UI/Table/index.js +0 -3
  220. package/core/UI/Table/table.js +0 -112
  221. package/core/UI/Table/utils.js +0 -12
  222. package/core/UI/Text/heading.js +0 -34
  223. package/core/UI/Text/index.js +0 -3
  224. package/core/UI/Text/p.js +0 -36
  225. package/core/UI/Text/pre.js +0 -0
  226. package/core/UI/Text/text.js +0 -65
  227. package/core/UI/Utils/index.js +0 -70
  228. package/core/UI/ZikoUIElement.js +0 -503
  229. package/core/UI/index.js +0 -154
  230. package/core/__proto__/Array.js +0 -74
  231. package/core/__proto__/Function.js +0 -0
  232. package/core/__proto__/Number.js +0 -76
  233. package/core/__proto__/Object.js +0 -0
  234. package/core/__proto__/String.js +0 -0
  235. package/core/index.js +0 -72
  236. package/wrapper/react/readme.md +0 -19
@@ -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
- }