ziko 0.0.1
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/LICENSE +21 -0
- package/README.md +316 -0
- package/dist/ziko.cjs +9786 -0
- package/dist/ziko.js +9792 -0
- package/dist/ziko.min.js +9 -0
- package/dist/ziko.mjs +9567 -0
- package/package.json +55 -0
- package/src/App/Accessibility/index.js +0 -0
- package/src/App/Globals/__Target__.js +3 -0
- package/src/App/Globals/__UI__.js +38 -0
- package/src/App/Globals/__init__.js +8 -0
- package/src/App/Globals/index.js +3 -0
- package/src/App/Router/index.js +40 -0
- package/src/App/Seo/index.js +43 -0
- package/src/App/Themes/dark.js +885 -0
- package/src/App/Themes/index.js +11 -0
- package/src/App/Themes/light.js +255 -0
- package/src/App/app.js +37 -0
- package/src/App/index.js +11 -0
- package/src/Data/Api/fetchdom.js +14 -0
- package/src/Data/Api/index.js +4 -0
- package/src/Data/Api/preload.js +11 -0
- package/src/Data/Converter/canvas.js +25 -0
- package/src/Data/Converter/csv.js +33 -0
- package/src/Data/Converter/index.js +25 -0
- package/src/Data/Converter/json.js +80 -0
- package/src/Data/Converter/markdown.js +83 -0
- package/src/Data/Converter/svg.js +11 -0
- package/src/Data/Parser/markdown.js +0 -0
- package/src/Data/Parser/xml.js +47 -0
- package/src/Data/Strings/index.js +26 -0
- package/src/Data/decorators.js +0 -0
- package/src/Data/index.js +64 -0
- package/src/Graphics/Canvas/Elements/Basic/arc.js +43 -0
- package/src/Graphics/Canvas/Elements/Basic/image.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/line.js +26 -0
- package/src/Graphics/Canvas/Elements/Basic/path.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/points.js +48 -0
- package/src/Graphics/Canvas/Elements/Basic/polygon.js +7 -0
- package/src/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/rect.js +46 -0
- package/src/Graphics/Canvas/Elements/Basic/text.js +0 -0
- package/src/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
- package/src/Graphics/Canvas/Elements/Chart/plot.js +0 -0
- package/src/Graphics/Canvas/Elements/Chart/scatter.js +2 -0
- package/src/Graphics/Canvas/Elements/Chart/stem.js +0 -0
- package/src/Graphics/Canvas/Elements/Element.js +115 -0
- package/src/Graphics/Canvas/Elements/Groupe.js +0 -0
- package/src/Graphics/Canvas/Elements/grid.js +0 -0
- package/src/Graphics/Canvas/Elements/index.js +13 -0
- package/src/Graphics/Canvas/Filter/index.js +0 -0
- package/src/Graphics/Canvas/Paint/index.js +0 -0
- package/src/Graphics/Canvas/Utils/color.js +8 -0
- package/src/Graphics/Canvas/Utils/floodFill.js +58 -0
- package/src/Graphics/Canvas/_canvas_offscreen +0 -0
- package/src/Graphics/Canvas/canvas.js +189 -0
- package/src/Graphics/Canvas/index.js +15 -0
- package/src/Graphics/Svg/Elements/ZikoSvgElement.js +28 -0
- package/src/Graphics/Svg/Elements/circle.js +34 -0
- package/src/Graphics/Svg/Elements/ellipse.js +29 -0
- package/src/Graphics/Svg/Elements/foreignObject.js +46 -0
- package/src/Graphics/Svg/Elements/grid.js +9 -0
- package/src/Graphics/Svg/Elements/groupe.js +29 -0
- package/src/Graphics/Svg/Elements/image.js +33 -0
- package/src/Graphics/Svg/Elements/line.js +29 -0
- package/src/Graphics/Svg/Elements/path.js +59 -0
- package/src/Graphics/Svg/Elements/polygon.js +31 -0
- package/src/Graphics/Svg/Elements/polyline.js +4 -0
- package/src/Graphics/Svg/Elements/rect.js +43 -0
- package/src/Graphics/Svg/Elements/text.js +26 -0
- package/src/Graphics/Svg/index.js +1 -0
- package/src/Graphics/Svg/svg.js +117 -0
- package/src/Graphics/index.js +61 -0
- package/src/Math/Calculus/Special Functions/bessel.js +31 -0
- package/src/Math/Calculus/Special Functions/beta.js +38 -0
- package/src/Math/Calculus/Special Functions/gamma.js +30 -0
- package/src/Math/Calculus/Special Functions/index.js +4 -0
- package/src/Math/Calculus/index.js +1 -0
- package/src/Math/Complex/Fractals/julia.js +0 -0
- package/src/Math/Complex/index.js +191 -0
- package/src/Math/Discret/Combinaison/index.js +34 -0
- package/src/Math/Discret/Conversion/index.js +86 -0
- package/src/Math/Discret/Logic/index.js +46 -0
- package/src/Math/Discret/Permutation/index.js +31 -0
- package/src/Math/Discret/Set/index.js +2 -0
- package/src/Math/Discret/Set/powerSet.js +15 -0
- package/src/Math/Discret/Set/subSet.js +10 -0
- package/src/Math/Discret/index.js +23 -0
- package/src/Math/Functions/index.js +182 -0
- package/src/Math/Matrix/Decomposition.js +90 -0
- package/src/Math/Matrix/LinearSystem.js +10 -0
- package/src/Math/Matrix/Matrix.js +712 -0
- package/src/Math/Matrix/index.js +3 -0
- package/src/Math/Numeric/index.js +0 -0
- package/src/Math/Random/index.js +173 -0
- package/src/Math/Signal/__np.py.txt +40 -0
- package/src/Math/Signal/conv.js +175 -0
- package/src/Math/Signal/fft.js +55 -0
- package/src/Math/Signal/filter.js +39 -0
- package/src/Math/Signal/functions.js +146 -0
- package/src/Math/Signal/index.js +110 -0
- package/src/Math/Statistics/Functions/index.js +100 -0
- package/src/Math/Statistics/index.js +16 -0
- package/src/Math/Utils/arithmetic.js +139 -0
- package/src/Math/Utils/checkers.js +11 -0
- package/src/Math/Utils/comparaison.js +1 -0
- package/src/Math/Utils/conversions.js +7 -0
- package/src/Math/Utils/discret.js +28 -0
- package/src/Math/Utils/index.js +102 -0
- package/src/Math/Utils/mapfun.js +43 -0
- package/src/Math/absract.js +1 -0
- package/src/Math/const.js +3 -0
- package/src/Math/index.js +193 -0
- package/src/Reactivity/Events/Global/Click.js +56 -0
- package/src/Reactivity/Events/Global/Clipboard.js +84 -0
- package/src/Reactivity/Events/Global/CustomEvent.js +53 -0
- package/src/Reactivity/Events/Global/Drag.js +137 -0
- package/src/Reactivity/Events/Global/Focus.js +56 -0
- package/src/Reactivity/Events/Global/Key.js +104 -0
- package/src/Reactivity/Events/Global/Pointer.js +214 -0
- package/src/Reactivity/Events/Partiel/Input.js +59 -0
- package/src/Reactivity/Events/ZikoEvent.js +91 -0
- package/src/Reactivity/Events/index.js +51 -0
- package/src/Reactivity/Observer/index.js +3 -0
- package/src/Reactivity/Observer/intersection.js +40 -0
- package/src/Reactivity/Observer/mutation.js +90 -0
- package/src/Reactivity/Observer/resize.js +47 -0
- package/src/Reactivity/Use/Contexte/index.js +1 -0
- package/src/Reactivity/Use/Contexte/useSuccesifKeys.js +14 -0
- package/src/Reactivity/Use/Decorators/index.js +4 -0
- package/src/Reactivity/Use/Interactions/index.js +4 -0
- package/src/Reactivity/Use/Interactions/useBluetooth.js +48 -0
- package/src/Reactivity/Use/Interactions/useChannel.js +50 -0
- package/src/Reactivity/Use/Interactions/useEventEmmiter.js +64 -0
- package/src/Reactivity/Use/Interactions/useSerial.js +0 -0
- package/src/Reactivity/Use/Interactions/useThread.js +44 -0
- package/src/Reactivity/Use/Interactions/useUsb.js +0 -0
- package/src/Reactivity/Use/Sensors/index.js +2 -0
- package/src/Reactivity/Use/Sensors/useBattery.js +36 -0
- package/src/Reactivity/Use/Sensors/useCamera.js +0 -0
- package/src/Reactivity/Use/Sensors/useGeolocation.js +17 -0
- package/src/Reactivity/Use/Sensors/useMicro.js +0 -0
- package/src/Reactivity/Use/Sensors/useOrientation.js +0 -0
- package/src/Reactivity/Use/Storage/index.js +1 -0
- package/src/Reactivity/Use/Storage/useCookie.js +0 -0
- package/src/Reactivity/Use/Storage/useIndexedDb.js +0 -0
- package/src/Reactivity/Use/Storage/useStorage.js +74 -0
- package/src/Reactivity/Use/UI/index.js +4 -0
- package/src/Reactivity/Use/UI/useCssLink.js +0 -0
- package/src/Reactivity/Use/UI/useCssText.js +21 -0
- package/src/Reactivity/Use/UI/useFavIcon.js +38 -0
- package/src/Reactivity/Use/UI/useLinearGradient.js +0 -0
- package/src/Reactivity/Use/UI/useMediaQuery.js +1 -0
- package/src/Reactivity/Use/UI/useRadialGradient.js +0 -0
- package/src/Reactivity/Use/UI/useStyle.js +54 -0
- package/src/Reactivity/Use/UI/useTheme.js +62 -0
- package/src/Reactivity/Use/UI/useTitle.js +30 -0
- package/src/Reactivity/Use/index.js +82 -0
- package/src/Reactivity/Use/todo.md +26 -0
- package/src/Reactivity/index.js +3 -0
- package/src/Time/animation.js +76 -0
- package/src/Time/index.js +54 -0
- package/src/Time/loop.js +83 -0
- package/src/Time/utils/decorators.js +17 -0
- package/src/Time/utils/ease.js +144 -0
- package/src/Time/utils/index.js +18 -0
- package/src/Time/utils/performance.js +16 -0
- package/src/Time/utils/ui.js +26 -0
- package/src/UI/CustomElement/Elements/Accordion/index.js +62 -0
- package/src/UI/CustomElement/Elements/Carousel/index.js +47 -0
- package/src/UI/CustomElement/Elements/CodeNote/CodeCell.js +176 -0
- package/src/UI/CustomElement/Elements/CodeNote/CodeNote.js +69 -0
- package/src/UI/CustomElement/Elements/CodeNote/SubElements.js +64 -0
- package/src/UI/CustomElement/Elements/CodeNote/index.js +2 -0
- package/src/UI/CustomElement/Elements/Columns.js +1 -0
- package/src/UI/CustomElement/Elements/FAB.js +0 -0
- package/src/UI/CustomElement/Elements/Menu.js +0 -0
- package/src/UI/CustomElement/Elements/Notification.js +0 -0
- package/src/UI/CustomElement/Elements/Popover.js +0 -0
- package/src/UI/CustomElement/Elements/Popup.js +0 -0
- package/src/UI/CustomElement/Elements/Swipper.js +4 -0
- package/src/UI/CustomElement/Elements/Tabs/index.js +111 -0
- package/src/UI/CustomElement/Elements/Timeline.js +0 -0
- package/src/UI/CustomElement/Elements/Toast.js +0 -0
- package/src/UI/CustomElement/Elements/Treeview.js +0 -0
- package/src/UI/CustomElement/Elements/index.js +4 -0
- package/src/UI/CustomElement/Flex.js +97 -0
- package/src/UI/CustomElement/Grid.js +30 -0
- package/src/UI/CustomElement/index.js +3 -0
- package/src/UI/Embaded/index.js +1 -0
- package/src/UI/Inputs/Primitives/btn.js +31 -0
- package/src/UI/Inputs/Primitives/elements.js +28 -0
- package/src/UI/Inputs/Primitives/inputs.js +334 -0
- package/src/UI/Inputs/Primitives/select.js +15 -0
- package/src/UI/Inputs/Primitives/textarea.js +16 -0
- package/src/UI/Inputs/camera.js +23 -0
- package/src/UI/Inputs/index.js +20 -0
- package/src/UI/List/elements.js +0 -0
- package/src/UI/List/index.js +130 -0
- package/src/UI/Media/Audio/index.js +26 -0
- package/src/UI/Media/Image/figure.js +17 -0
- package/src/UI/Media/Image/image.js +34 -0
- package/src/UI/Media/Image/index.js +2 -0
- package/src/UI/Media/Video/index.js +37 -0
- package/src/UI/Media/index.js +3 -0
- package/src/UI/Misc/index.js +49 -0
- package/src/UI/Semantic/index.js +68 -0
- package/src/UI/Style/index.js +499 -0
- package/src/UI/Table/elements.js +94 -0
- package/src/UI/Table/index.js +3 -0
- package/src/UI/Table/table.js +113 -0
- package/src/UI/Table/utils.js +12 -0
- package/src/UI/Text/heading.js +35 -0
- package/src/UI/Text/index.js +3 -0
- package/src/UI/Text/p.js +37 -0
- package/src/UI/Text/pre.js +0 -0
- package/src/UI/Text/text.js +66 -0
- package/src/UI/Utils/index.js +70 -0
- package/src/UI/ZikoUIElement.js +478 -0
- package/src/UI/index.js +154 -0
- package/src/__proto__/Array.js +74 -0
- package/src/__proto__/Function.js +0 -0
- package/src/__proto__/Number.js +76 -0
- package/src/__proto__/Object.js +0 -0
- package/src/__proto__/String.js +0 -0
- package/src/index.js +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 ZAKARIA ELALAOUI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
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
|
+
<br>
|
|
6
|
+
|
|
7
|
+
## ⚡ Get started
|
|
8
|
+
```html
|
|
9
|
+
<!DOCTYPE html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8">
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
14
|
+
<title>zikojs</title>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<script src="https://cdn.jsdelivr.net/npm/ziko@latest/dist/ziko.js"></script>
|
|
18
|
+
<script>
|
|
19
|
+
Ziko.ExtractAll()
|
|
20
|
+
const hello = p("Hello World").style({
|
|
21
|
+
color: "gold",
|
|
22
|
+
fontSize: "30px",
|
|
23
|
+
fontWeight: "bold"
|
|
24
|
+
})
|
|
25
|
+
.onPtrEnter(e=>e.target.st.color(Random.color()))
|
|
26
|
+
.onPtrLeave(e=>e.target.st.color("gold"))
|
|
27
|
+
Ziko.App(
|
|
28
|
+
hello
|
|
29
|
+
).style({
|
|
30
|
+
width: "100vw",
|
|
31
|
+
height: "100vh",
|
|
32
|
+
background: "darkblue"
|
|
33
|
+
}).vertical(0, "space-around")
|
|
34
|
+
|
|
35
|
+
</script>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 🎬 Demos
|
|
41
|
+
- ### [ Windows entanglement using zikojs and ziko-three ](https://www.linkedin.com/feed/update/urn:li:activity:7144023650394918913/)
|
|
42
|
+
|
|
43
|
+
## 📃 [wiki](https://github.com/zakarialaoui10/ziko.js/wiki/Math-Functions)
|
|
44
|
+
|
|
45
|
+
## 💡 [Features]()
|
|
46
|
+
<details>
|
|
47
|
+
<summary>
|
|
48
|
+
<strong> 🔰 Methodes Extracting </strong>
|
|
49
|
+
</summary>
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
Ziko.ExtractAll()
|
|
53
|
+
// if you want to extract only UI methodes you can use Ziko.UI.Extractll()
|
|
54
|
+
```
|
|
55
|
+
🏷️ This method simplifies syntax by extracting all UI, Math, Time, Graphics, and other methods within the Ziko framework. Instead of writing specific namespace prefixes like `Ziko.UI.text("Hi")` , `Ziko.Math.complex(1,2)` , `Ziko.Math.matrix([[1,2],[2,3]])`, you can directly use simplified syntax such as `text("Hi")` , `complex(1,1)` and `matrix([[1,2],[2,3]])`.
|
|
56
|
+
|
|
57
|
+
⚠️ Be careful with this method because it will overwrite any existing global or local variables and functions with the same names as the extracted methods.
|
|
58
|
+
</details>
|
|
59
|
+
|
|
60
|
+
<details>
|
|
61
|
+
<summary>
|
|
62
|
+
<strong> 🔰 Mathematical Utilities & Tips </strong>
|
|
63
|
+
</summary>
|
|
64
|
+
|
|
65
|
+
### mapfun
|
|
66
|
+
📝 Javascript provides a built-in Math module with various functions.
|
|
67
|
+
|
|
68
|
+
⚠️However, there is room for improvement in terms of efficiency. For instance, the Math.sqrt(x) function can calculate the square root of a number x, but it has limitations such as the inability to accept multiple parameters and the inability to map the function to different data types like Arrays and Objects.
|
|
69
|
+
|
|
70
|
+
💡 In zikojs, I have addressed these limitations, providing a more versatile and efficient solution.
|
|
71
|
+
|
|
72
|
+
📋 Example :
|
|
73
|
+
|zikojs|Vanilla js Equivalent|
|
|
74
|
+
|-|-|
|
|
75
|
+
|`sqrt(9)`|`sqrt(9)`|
|
|
76
|
+
|`sqrt(4,9,16)`|`[Math.sqrt(4),Math.sqrt(9),Math.sqrt(16)]`|
|
|
77
|
+
|`sqrt([4,9,16])`|`[Math.sqrt(4),Math.sqrt(9),Math.sqrt(16)]`|
|
|
78
|
+
|`sqrt([4,9],16)`|`[[Math.sqrt(4),Math.sqrt(9)],Math.sqrt(16)]`|
|
|
79
|
+
|`sqrt({x:4,y:9})`|`{x:sqrt(4),sqrt(9)}`|
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
📢 Generally, zikojs allows you to input an infinite number of parameters, including deep arrays, objects, Maps, Sets, and more. The return value retains the input structure and calculates the result for each element accordingly.
|
|
83
|
+
|
|
84
|
+
📋 For Example :
|
|
85
|
+
```js
|
|
86
|
+
sqrt({
|
|
87
|
+
a:1,
|
|
88
|
+
b:2,
|
|
89
|
+
c:[3,4],
|
|
90
|
+
d:[[
|
|
91
|
+
[5,6]
|
|
92
|
+
]],
|
|
93
|
+
e:{
|
|
94
|
+
f:[
|
|
95
|
+
{g:7}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
h:new Map([["i",8],["j",9]]),
|
|
99
|
+
k:{
|
|
100
|
+
l:{
|
|
101
|
+
m:new Set([10,11])
|
|
102
|
+
},
|
|
103
|
+
n:[12]
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
```
|
|
107
|
+
This would return :
|
|
108
|
+
```js
|
|
109
|
+
{
|
|
110
|
+
a:sqrt(1),
|
|
111
|
+
b:sqrt(2),
|
|
112
|
+
c:[sqrt(3),sqrt(4)],
|
|
113
|
+
d:[[
|
|
114
|
+
[sqrt(5),sqrt(6)]
|
|
115
|
+
]],
|
|
116
|
+
e:{
|
|
117
|
+
f:[
|
|
118
|
+
{g:sqrt(7)}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
h:new Map([["i",sqrt(8)],["j",sqrt(9)]]),
|
|
122
|
+
k:{
|
|
123
|
+
l:{
|
|
124
|
+
m:new Set([sqrt(10),sqrt(11)])
|
|
125
|
+
},
|
|
126
|
+
n:[sqrt(12)]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
💡 You can apply this approach to build your custom function ;
|
|
132
|
+
```js
|
|
133
|
+
import {mapfun} from "ziko";
|
|
134
|
+
const parabolic_func=(a,b,c,x)=>a*(x**2)+b*x+c;
|
|
135
|
+
const parabol=(a,b,c,...X)=>mapfun(n=>parabolic_func(a,b,c,n),...X)
|
|
136
|
+
const a=-1.5,b=2,c=3;
|
|
137
|
+
X0=[0,1,2,3];
|
|
138
|
+
X1={x10:0,x11:1,x12:2,x13:3}
|
|
139
|
+
console.log(parabol(a,b,c,X0));
|
|
140
|
+
// [3,3,1,3]
|
|
141
|
+
console.log(parabol(a,b,c,X1));
|
|
142
|
+
// {x10: 3,x11: 3,x12: 1,x13: -3}
|
|
143
|
+
console.log(parabol(a,b,c,X0,X1))
|
|
144
|
+
/*
|
|
145
|
+
[
|
|
146
|
+
[3,3,1,3],
|
|
147
|
+
{x10: 3,x11: 3,x12: 1,x13: -3}
|
|
148
|
+
]
|
|
149
|
+
*/
|
|
150
|
+
```
|
|
151
|
+
Or you can use the currying syntaxe :
|
|
152
|
+
```js
|
|
153
|
+
import {mapfun} from "ziko";
|
|
154
|
+
const parabolic_func=(a,b,c,x)=>a*(x**2)+b*x+c;
|
|
155
|
+
const map_parabolic_func=(a,b,c)=>(...X)=>mapfun(n=>parabolic_func(a,b,c,n),...X);
|
|
156
|
+
const a=-1.5,b=2,c=3;
|
|
157
|
+
const X=[0,1,2,3];
|
|
158
|
+
console.log(parabolic_func(a,b,c)(X));
|
|
159
|
+
// [3,3,1,3]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
You may not necessarily rely on the mapfun utility every time, as ZikoJS offers a variety of built-in mathematical functions that built on the top of `mapfun` and the Math module in javascript .
|
|
163
|
+
|
|
164
|
+
Here you will find the built in Mathematic functions in zikojs
|
|
165
|
+
|
|
166
|
+
`abs(...x)`,`sqrt(...x)`,`pow(x,n)`,`sqrtn(x,n)`,`e(...x)`,`ln(...x)`,`cos(...x)`,`sin(...x)`,`tan(...x)`,`sinc(...x)`,`acos(...x)`,`asin(...x)`,`atan(...x)`,`cosh(...x)`,`sinh(...x)`,`acosh(...x)`,`asinh(...x)`,`atanh(...x)`,`cot(...x)`,`sec(...x)`,`csc(...x)`,`acot(...x)`,`coth(...x)`,`acosh(...x)`,`asinh(...x)`,`atanh(...x)`,`atan2(x,y,?rad)`,`hypot(...x)`,`min(...x)`,`max(...x)`,`sign(...x)`,`sig(...x)`,`fact(...x)`,`round(...x)`,`floor(...x)`,`ceil(...x)`
|
|
167
|
+
|
|
168
|
+
### Matrix
|
|
169
|
+
### Complex
|
|
170
|
+
</details>
|
|
171
|
+
<details>
|
|
172
|
+
<summary>
|
|
173
|
+
<strong> 🔰 Rich UI elements </strong>
|
|
174
|
+
</summary>
|
|
175
|
+
</details>
|
|
176
|
+
<details>
|
|
177
|
+
<summary>
|
|
178
|
+
<strong> 🔰 Methodes Chaining </strong>
|
|
179
|
+
</summary>
|
|
180
|
+
|
|
181
|
+
```js
|
|
182
|
+
text("hello world")
|
|
183
|
+
.style({ color: "red" })
|
|
184
|
+
.onPtrMove(useThrottle(() => console.log("hi")));
|
|
185
|
+
```
|
|
186
|
+
</details>
|
|
187
|
+
|
|
188
|
+
<details>
|
|
189
|
+
<summary>
|
|
190
|
+
<strong> 🔰 Events Handling</strong>
|
|
191
|
+
</summary>
|
|
192
|
+
|
|
193
|
+
Example of creating simple Paint sketch using canvas and pointer events :
|
|
194
|
+
```js
|
|
195
|
+
const Scene=Canvas().view(-10,-10,10,10).size(500,500).adjust()
|
|
196
|
+
c.onPtrDown(e=>{
|
|
197
|
+
c.ctx.beginPath()
|
|
198
|
+
c.ctx.moveTo(
|
|
199
|
+
map(e.dx,0,c.element.offsetWidth,c.Xmin,c.Xmax),
|
|
200
|
+
map(e.dy,0,c.element.offseHeight,c.Ymin,c.Ymax)
|
|
201
|
+
)
|
|
202
|
+
})
|
|
203
|
+
c.onPtrMove(e=>{
|
|
204
|
+
if(e.isDown){
|
|
205
|
+
const x=map(e.mx,0,c.element.offsetWidth,c.axisMatrix[0][0],c.axisMatrix[1][0])
|
|
206
|
+
const y=map(e.my,0,c.element.offsetHeight,c.axisMatrix[1][1],c.axisMatrix[0][1])
|
|
207
|
+
c.append(canvasCircle(x,y,1).color({fill:"#5555AA"}).fill())
|
|
208
|
+
}
|
|
209
|
+
c.onPtrUp(()=>{})
|
|
210
|
+
```
|
|
211
|
+
</details>
|
|
212
|
+
|
|
213
|
+
<details>
|
|
214
|
+
<summary>
|
|
215
|
+
<strong> 🔰 Functions decorators </strong>
|
|
216
|
+
</summary>
|
|
217
|
+
|
|
218
|
+
```js
|
|
219
|
+
const inp=input().onKeyDown(throttle(e=>console.log(e.kd),1000));
|
|
220
|
+
```
|
|
221
|
+
</details>
|
|
222
|
+
|
|
223
|
+
<details>
|
|
224
|
+
<summary>
|
|
225
|
+
<strong> 🔰 Reactivity </strong>
|
|
226
|
+
</summary>
|
|
227
|
+
|
|
228
|
+
### Events
|
|
229
|
+
### Observers
|
|
230
|
+
### Use
|
|
231
|
+
|
|
232
|
+
</details>
|
|
233
|
+
|
|
234
|
+
<details>
|
|
235
|
+
<summary>
|
|
236
|
+
<strong> 🔰 Rich UI Elements Based on Math modules </strong>
|
|
237
|
+
</summary>
|
|
238
|
+
for example in `Table` you can use methodes like `hsatck` `vstack` `transpose` ...
|
|
239
|
+
</details>
|
|
240
|
+
|
|
241
|
+
<details>
|
|
242
|
+
<summary>
|
|
243
|
+
<strong> 🔰 Routing for Single Page Applications (SPA) </strong>
|
|
244
|
+
</summary>
|
|
245
|
+
|
|
246
|
+
```js
|
|
247
|
+
const main= Ziko.App()
|
|
248
|
+
const p1=Section()
|
|
249
|
+
const p2=Section()
|
|
250
|
+
S=Ziko.SPA(
|
|
251
|
+
main,{
|
|
252
|
+
"/page1":p1,
|
|
253
|
+
"/page2":p2
|
|
254
|
+
})
|
|
255
|
+
// You can use regex to define routes
|
|
256
|
+
S.get(
|
|
257
|
+
pattern,
|
|
258
|
+
path=>handler(path)
|
|
259
|
+
)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
***⚠️ Ensure that your server serves only the index page for all incoming requests.***
|
|
263
|
+
|
|
264
|
+
***💡 Example using expressjs :***
|
|
265
|
+
|
|
266
|
+
```js
|
|
267
|
+
app.get('*', (req , res) => {
|
|
268
|
+
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
|
269
|
+
});
|
|
270
|
+
```
|
|
271
|
+
</details>
|
|
272
|
+
|
|
273
|
+
<details>
|
|
274
|
+
<summary>
|
|
275
|
+
<strong>🔰 Multithreading supports</strong>
|
|
276
|
+
</summary>
|
|
277
|
+
|
|
278
|
+
```js
|
|
279
|
+
useThread(() => {
|
|
280
|
+
s = 0;
|
|
281
|
+
for (i = 0; i < 10000000000; i++) s += i;
|
|
282
|
+
return s;
|
|
283
|
+
}, console.log);
|
|
284
|
+
```
|
|
285
|
+
</details>
|
|
286
|
+
|
|
287
|
+
<details>
|
|
288
|
+
<summary>
|
|
289
|
+
<strong> 🔰 Responsive Design using Flex element and resize observer </strong>
|
|
290
|
+
</summary>
|
|
291
|
+
</details>
|
|
292
|
+
|
|
293
|
+
<details>
|
|
294
|
+
<summary>
|
|
295
|
+
<strong> 🔰 Loop and animations support </strong>
|
|
296
|
+
</summary>
|
|
297
|
+
</details>
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
## ⭐️ Show your support <a name="support"></a>
|
|
302
|
+
|
|
303
|
+
If you appreciate the library, kindly demonstrate your support by giving it a star!<br>
|
|
304
|
+
[](https://github.com/zakarialaoui10/ziko.js)
|
|
305
|
+
|
|
306
|
+
# License
|
|
307
|
+
This projet is licensed under the terms of MIT License
|
|
308
|
+
<img src="https://img.shields.io/github/license/zakarialaoui10/zikojs?color=rgb%2820%2C21%2C169%29" width="100" align="right">
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|