ziko 0.0.11 → 0.0.13
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/README.md +6 -3
- package/dist/ziko.cjs +5640 -4532
- package/dist/ziko.js +5640 -4532
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +5602 -4532
- package/package.json +39 -12
- package/src/__helpers__/index.js +41 -0
- package/src/app/accessibility/index.js +0 -0
- package/src/app/app.js +46 -0
- package/src/app/component/index.js +38 -0
- package/src/app/globals/index.js +20 -0
- package/src/app/index.js +12 -0
- package/src/app/params/index.js +40 -0
- package/src/app/router/index.js +67 -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/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/adoc.js +130 -0
- package/src/data/converter/array.js +43 -0
- package/src/data/converter/canvas.js +25 -0
- package/src/data/converter/csv.js +33 -0
- package/src/data/converter/idea.txt +10 -0
- package/src/data/converter/index.js +34 -0
- package/src/data/converter/json.js +80 -0
- package/src/data/converter/markdown.js +95 -0
- package/src/data/converter/object.js +70 -0
- package/src/data/converter/svg.js +11 -0
- package/src/data/decorators.js +0 -0
- package/src/data/index.js +74 -0
- package/src/data/parser/markdown.js +0 -0
- package/src/data/parser/xml.js +47 -0
- package/src/data/string/index.js +1 -0
- package/src/data/string/patterns.js +12 -0
- package/src/data/string/string.js +170 -0
- package/src/graphics/canvas/_canvas_offscreen +0 -0
- package/src/graphics/canvas/canvas.js +189 -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/index.js +15 -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/index.js +69 -0
- package/src/graphics/svg/Elements/Basic/circle.js +26 -0
- package/src/graphics/svg/Elements/Basic/ellipse.js +21 -0
- package/src/graphics/svg/Elements/Basic/foreignObject.js +33 -0
- package/src/graphics/svg/Elements/Basic/groupe.js +29 -0
- package/src/graphics/svg/Elements/Basic/image.js +33 -0
- package/src/graphics/svg/Elements/Basic/line.js +29 -0
- package/src/graphics/svg/Elements/Basic/link.js +30 -0
- package/src/graphics/svg/Elements/Basic/path.js +59 -0
- package/src/graphics/svg/Elements/Basic/polygon.js +32 -0
- package/src/graphics/svg/Elements/Basic/polyline.js +4 -0
- package/src/graphics/svg/Elements/Basic/rect.js +43 -0
- package/src/graphics/svg/Elements/Basic/text.js +26 -0
- package/src/graphics/svg/Elements/Derived/grid.js +9 -0
- package/src/graphics/svg/Elements/ZikoSvgElement.js +46 -0
- package/src/graphics/svg/Elements/index.js +14 -0
- package/src/graphics/svg/index.js +2 -0
- package/src/graphics/svg/svg.js +115 -0
- package/src/index.js +88 -0
- package/src/math/absract.js +1 -0
- package/src/math/calculus/index.js +1 -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/complex/Fractals/julia.js +0 -0
- package/src/math/complex/index.js +203 -0
- package/src/math/const.js +3 -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/power-set.js +15 -0
- package/src/math/discret/Set/sub-set.js +10 -0
- package/src/math/discret/index.js +23 -0
- package/src/math/functions/index.js +182 -0
- package/src/math/index.js +189 -0
- package/src/math/matrix/Decomposition.js +90 -0
- package/src/math/matrix/LinearSystem.js +10 -0
- package/src/math/matrix/Matrix.js +717 -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 +29 -0
- package/src/math/utils/comparaison.js +1 -0
- package/src/math/utils/conversions.js +19 -0
- package/src/math/utils/discret.js +51 -0
- package/src/math/utils/index.js +102 -0
- package/src/math/utils/mapfun.js +50 -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/Mouse.js +230 -0
- package/src/reactivity/events/Global/Pointer.js +234 -0
- package/src/reactivity/events/Global/Swipe.js +147 -0
- package/src/reactivity/events/Global/Touch.js +0 -0
- package/src/reactivity/events/Global/Wheel.js +44 -0
- package/src/reactivity/events/Partiel/Hash.js +44 -0
- package/src/reactivity/events/Partiel/Input.js +59 -0
- package/src/reactivity/events/Partiel/Media.js +1 -0
- package/src/reactivity/events/ZikoEvent.js +91 -0
- package/src/reactivity/events/index.js +63 -0
- package/src/reactivity/hooks/Contexte/index.js +1 -0
- package/src/reactivity/hooks/Contexte/useSuccesifKeys.js +14 -0
- package/src/reactivity/hooks/Decorators/index.js +6 -0
- package/src/reactivity/hooks/Decorators/time.js +17 -0
- package/src/reactivity/hooks/Decorators/type.js +88 -0
- package/src/reactivity/hooks/Interactions/index.js +4 -0
- package/src/reactivity/hooks/Interactions/useBluetooth.js +48 -0
- package/src/reactivity/hooks/Interactions/useChannel.js +50 -0
- package/src/reactivity/hooks/Interactions/useEventEmmiter.js +64 -0
- package/src/reactivity/hooks/Interactions/useSerial.js +0 -0
- package/src/reactivity/hooks/Interactions/useThread.js +44 -0
- package/src/reactivity/hooks/Interactions/useUsb.js +0 -0
- package/src/reactivity/hooks/Sensors/index.js +2 -0
- package/src/reactivity/hooks/Sensors/useBattery.js +36 -0
- package/src/reactivity/hooks/Sensors/useCamera.js +0 -0
- package/src/reactivity/hooks/Sensors/useGeolocation.js +17 -0
- package/src/reactivity/hooks/Sensors/useMicro.js +0 -0
- package/src/reactivity/hooks/Sensors/useOrientation.js +0 -0
- package/src/reactivity/hooks/Storage/index.js +1 -0
- package/src/reactivity/hooks/Storage/useCookie.js +0 -0
- package/src/reactivity/hooks/Storage/useIndexedDb.js +0 -0
- package/src/reactivity/hooks/Storage/useStorage.js +73 -0
- package/src/reactivity/hooks/UI/index.js +5 -0
- package/src/reactivity/hooks/UI/useCssLink.js +0 -0
- package/src/reactivity/hooks/UI/useCssText.js +21 -0
- package/src/reactivity/hooks/UI/useFavIcon.js +38 -0
- package/src/reactivity/hooks/UI/useLinearGradient.js +0 -0
- package/src/reactivity/hooks/UI/useMediaQuery.js +43 -0
- package/src/reactivity/hooks/UI/useRadialGradient.js +0 -0
- package/src/reactivity/hooks/UI/useStyle.js +79 -0
- package/src/reactivity/hooks/UI/useTheme.js +62 -0
- package/src/reactivity/hooks/UI/useTitle.js +30 -0
- package/src/reactivity/hooks/index.js +85 -0
- package/src/reactivity/hooks/todo.md +26 -0
- package/src/reactivity/idea +2 -0
- package/src/reactivity/index.js +22 -0
- package/src/reactivity/observer/attributes.js +28 -0
- package/src/reactivity/observer/children.js +37 -0
- package/src/reactivity/observer/index.js +44 -0
- package/src/reactivity/observer/intersection.js +44 -0
- package/src/reactivity/observer/mutation.js +113 -0
- package/src/reactivity/observer/resize.js +47 -0
- package/src/reactivity/observer/screen.js +45 -0
- package/src/reactivity/observer/screen.js.txt +84 -0
- package/src/reactivity/observer/screen.txt +13 -0
- package/src/time/animation.js +76 -0
- package/src/time/index.js +54 -0
- package/src/time/loop.js +87 -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/user-interface/elements/derived/Flex.js +103 -0
- package/src/user-interface/elements/derived/Grid.js +33 -0
- package/src/user-interface/elements/derived/elements/Notification.js +0 -0
- package/src/user-interface/elements/derived/elements/Popover.js +0 -0
- package/src/user-interface/elements/derived/elements/Popup.js +0 -0
- package/src/user-interface/elements/derived/elements/Swipper.js +4 -0
- package/src/user-interface/elements/derived/elements/Timeline.js +0 -0
- package/src/user-interface/elements/derived/elements/Toast.js +0 -0
- package/src/user-interface/elements/derived/elements/Treeview.js +0 -0
- package/src/user-interface/elements/derived/elements/accordion/accordion.js +45 -0
- package/src/user-interface/elements/derived/elements/accordion/collapsible.js +82 -0
- package/src/user-interface/elements/derived/elements/accordion/index.js +2 -0
- package/src/user-interface/elements/derived/elements/alert/alert.js +80 -0
- package/src/user-interface/elements/derived/elements/alert/index.js +1 -0
- package/src/user-interface/elements/derived/elements/alert/palette.js +52 -0
- package/src/user-interface/elements/derived/elements/carousel/index.js +50 -0
- package/src/user-interface/elements/derived/elements/code-note/SubElements.js.txt +105 -0
- package/src/user-interface/elements/derived/elements/code-note/code-cell.js +195 -0
- package/src/user-interface/elements/derived/elements/code-note/code-note.js +72 -0
- package/src/user-interface/elements/derived/elements/code-note/index.js +2 -0
- package/src/user-interface/elements/derived/elements/code-note/sub-elements.js +67 -0
- package/src/user-interface/elements/derived/elements/columns.js +1 -0
- package/src/user-interface/elements/derived/elements/fab.js +0 -0
- package/src/user-interface/elements/derived/elements/index.js +9 -0
- package/src/user-interface/elements/derived/elements/menu/index.js +1 -0
- package/src/user-interface/elements/derived/elements/menu/menu3d.js +260 -0
- package/src/user-interface/elements/derived/elements/modal/index.js +92 -0
- package/src/user-interface/elements/derived/elements/pagination/breadcrumbs.js +54 -0
- package/src/user-interface/elements/derived/elements/pagination/index.js +1 -0
- package/src/user-interface/elements/derived/elements/splitter/__ZikoUISplitter__.js +62 -0
- package/src/user-interface/elements/derived/elements/splitter/hsplitter.js +40 -0
- package/src/user-interface/elements/derived/elements/splitter/index.js +2 -0
- package/src/user-interface/elements/derived/elements/splitter/vsplitter.js +40 -0
- package/src/user-interface/elements/derived/elements/tabs/index.js +180 -0
- package/src/user-interface/elements/derived/index.js +3 -0
- package/src/user-interface/elements/primitives/ZikoUIContainerElement.js +127 -0
- package/src/user-interface/elements/primitives/ZikoUIElement.js +478 -0
- package/src/user-interface/elements/primitives/embaded/index.js +1 -0
- package/src/user-interface/elements/primitives/index.js +8 -0
- package/src/user-interface/elements/primitives/io/Form/index.js +42 -0
- package/src/user-interface/elements/primitives/io/Form/index.js.txt +104 -0
- package/src/user-interface/elements/primitives/io/Inputs/__helpers__.js +52 -0
- package/src/user-interface/elements/primitives/io/Inputs/index.js +12 -0
- package/src/user-interface/elements/primitives/io/Inputs/input/index.js +98 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-camera/index.js +26 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-checkbox/index.js +26 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-color/index.js +16 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/index.js +3 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-date-time.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-date.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-time.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-email-password/index.js +2 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-email-password/input-email.js +15 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-email-password/input-password.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-file/index.js +1 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-file/input-file.js +0 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-file/input-image.js +43 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-number/index.js +37 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-radio/index.js +26 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-search/index.js +45 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-slider/index.js +34 -0
- package/src/user-interface/elements/primitives/io/Select/index.js +20 -0
- package/src/user-interface/elements/primitives/io/Textarea/index.js +18 -0
- package/src/user-interface/elements/primitives/io/index.js +4 -0
- package/src/user-interface/elements/primitives/list/elements.js +0 -0
- package/src/user-interface/elements/primitives/list/index.js +139 -0
- package/src/user-interface/elements/primitives/media/Audio/index.js +17 -0
- package/src/user-interface/elements/primitives/media/Image/figure.js +19 -0
- package/src/user-interface/elements/primitives/media/Image/image.js +36 -0
- package/src/user-interface/elements/primitives/media/Image/index.js +2 -0
- package/src/user-interface/elements/primitives/media/Video/index.js +27 -0
- package/src/user-interface/elements/primitives/media/__ZikoUIDynamicMediaELement__.js +47 -0
- package/src/user-interface/elements/primitives/media/index.js +3 -0
- package/src/user-interface/elements/primitives/misc/index.js +99 -0
- package/src/user-interface/elements/primitives/semantic/index.js +82 -0
- package/src/user-interface/elements/primitives/table/elements.js +94 -0
- package/src/user-interface/elements/primitives/table/index.js +3 -0
- package/src/user-interface/elements/primitives/table/table.js +115 -0
- package/src/user-interface/elements/primitives/table/utils.js +12 -0
- package/src/user-interface/elements/primitives/text/__ZikoUIText__.js +71 -0
- package/src/user-interface/elements/primitives/text/heading.js +36 -0
- package/src/user-interface/elements/primitives/text/index.js +3 -0
- package/src/user-interface/elements/primitives/text/p.js +26 -0
- package/src/user-interface/elements/primitives/text/pre.js +0 -0
- package/src/user-interface/elements/primitives/text/text.js +81 -0
- package/src/user-interface/index.js +188 -0
- package/src/user-interface/style/index.js +510 -0
- package/src/user-interface/utils/index.js +70 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ZikoSvgElement from "../ZikoSvgElement.js";
|
|
2
|
+
class ZikoSvgLink extends ZikoSvgElement{
|
|
3
|
+
constructor(href,...svgElement){
|
|
4
|
+
super();
|
|
5
|
+
this.items=[];
|
|
6
|
+
this.element=document?.createElementNS(
|
|
7
|
+
"http://www.w3.org/2000/svg",
|
|
8
|
+
"a",
|
|
9
|
+
);
|
|
10
|
+
this.element.etAttribute("href",href)
|
|
11
|
+
this.add(...svgElement)
|
|
12
|
+
}
|
|
13
|
+
add(...svgElement){
|
|
14
|
+
for(let i=0;i<svgElement.length;i++){
|
|
15
|
+
this.element.ppendChild(svgElement[i].element);
|
|
16
|
+
this.items.push(svgElement[i])
|
|
17
|
+
}
|
|
18
|
+
if(svgElement.length===1)return svgElement[0]
|
|
19
|
+
return svgElement;
|
|
20
|
+
}
|
|
21
|
+
remove(...svgElement){
|
|
22
|
+
for(let i=0;i<svgElement.length;i++){
|
|
23
|
+
this.element.moveChild(svgElement[i].element);
|
|
24
|
+
this.items=this.items.filter(n=>n!=svgElement)
|
|
25
|
+
}
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const svgLink=(href,...svgElement)=>new ZikoSvgLink(href,...svgElement)
|
|
30
|
+
export{ svgLink }
|
|
@@ -0,0 +1,59 @@
|
|
|
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.etAttribute("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=()=>new ZikoSvgPath();
|
|
59
|
+
export{ svgPath }
|
|
@@ -0,0 +1,32 @@
|
|
|
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?.createElementtNS(
|
|
8
|
+
"http://www.w3.org/2000/svg",
|
|
9
|
+
"polygon",
|
|
10
|
+
);
|
|
11
|
+
this.element?.setAttribute("points","");
|
|
12
|
+
this.addPoints(X,Y)
|
|
13
|
+
}
|
|
14
|
+
addPoint(x,y){
|
|
15
|
+
let p=this.element.parentElement.createSVGPoint();
|
|
16
|
+
p.x=x;
|
|
17
|
+
p.y=y;
|
|
18
|
+
this.element.points.appendItem(p);
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
addPoints(X,Y){
|
|
22
|
+
for(let i=0;i<X.length;i++){
|
|
23
|
+
let p=this.element.parentElement.createSVGPoint();
|
|
24
|
+
p.x=X[i];
|
|
25
|
+
p.y=Y[i];
|
|
26
|
+
this.element.oints.appendItem(p)
|
|
27
|
+
}
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const svgPolygon=(X,Y)=>new ZikoSvgPolygon(X,Y);
|
|
32
|
+
export{ svgPolygon }
|
|
@@ -0,0 +1,43 @@
|
|
|
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{ svgRect }
|
|
@@ -0,0 +1,26 @@
|
|
|
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{ svgText }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { svgPath } from "../Basic/path"
|
|
2
|
+
const 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{ svgGrid };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
class ZikoSvgElement {
|
|
2
|
+
constructor(type) {
|
|
3
|
+
this.cache = {
|
|
4
|
+
type
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
pos(x,y){
|
|
8
|
+
return this.posX(x).posY(y);
|
|
9
|
+
}
|
|
10
|
+
posX(x){
|
|
11
|
+
if(["circle","ellipse"].includes(this.cache.type))this.element.cx.baseVal.value=x;
|
|
12
|
+
else this.element.x.baseVal.value=x;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
posY(y){
|
|
16
|
+
if(["circle","ellipse"].includes(this.cache.type))this.element.cy.baseVal.value=y;
|
|
17
|
+
else this.element.y.baseVal.value=y;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
translate(x,y){
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
color({ stroke, fill }) {
|
|
24
|
+
this.element?.setAttribute("stroke", stroke);
|
|
25
|
+
this.element?.setAttribute("fill", fill);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
fill(color = "none") {
|
|
29
|
+
this.element?.setAttribute("fill", color);
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
stroke(color = "none", width) {
|
|
33
|
+
this.element?.setAttribute("stroke", color);
|
|
34
|
+
width && this.strokeWidth(width);
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
strokeWidth(width = 1) {
|
|
38
|
+
this.element?.setAttribute("stroke-width", width);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
opacity(value = 1) {
|
|
42
|
+
this.element?.setAttribute("opacity", value);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export default ZikoSvgElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { svgRect } from "./Basic/rect.js";
|
|
2
|
+
export { svgCircle } from "./Basic/circle.js";
|
|
3
|
+
export { svgEllipse } from "./Basic/ellipse.js";
|
|
4
|
+
export { svgLine } from "./Basic/line.js";
|
|
5
|
+
export { svgPolyLine } from "./Basic/polyline.js";
|
|
6
|
+
export { svgPath } from "./Basic/path.js";
|
|
7
|
+
export { svgPolygon } from "./Basic/polygon.js";
|
|
8
|
+
export { svgText } from "./Basic/text.js";
|
|
9
|
+
export { svgImage } from "./Basic/image.js";
|
|
10
|
+
export { svgObject } from "./Basic/foreignObject.js";
|
|
11
|
+
export { svgGroupe } from "./Basic/groupe.js";
|
|
12
|
+
export { svgLink } from "./Basic/link.js";
|
|
13
|
+
|
|
14
|
+
export { svgGrid } from "./Derived/grid.js";
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import ZikoUIElement from "../../user-interface/elements/primitives/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 svgLink from "./Elements/link.js";
|
|
12
|
+
// //import svgObject from "./Elements/foreignObject.js";
|
|
13
|
+
// //import svgGrid from "./Elements/grid.js";
|
|
14
|
+
|
|
15
|
+
class ZikoUISvg extends ZikoUIElement {
|
|
16
|
+
constructor(w=360,h=300) {
|
|
17
|
+
super("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
|
+
}
|
|
25
|
+
view(x1,y1,x2,y2){
|
|
26
|
+
let width=Math.abs(x2-x1);
|
|
27
|
+
let height=Math.abs(y2-y1);
|
|
28
|
+
this.setAttr("viewBox",[x1,y1,width,height].join(" "));
|
|
29
|
+
this.st.scaleY(-1);
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
add(...svgElement){
|
|
33
|
+
for(let i=0;i<svgElement.length;i++){
|
|
34
|
+
this.element?.appendChildddddddd(svgElement[i].element);
|
|
35
|
+
this.items.push(svgElement[i])
|
|
36
|
+
}
|
|
37
|
+
this.maintain()
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
remove(...svgElement){
|
|
41
|
+
for(let i=0;i<svgElement.length;i++){
|
|
42
|
+
this.element?.removeChild(svgElement[i].element);
|
|
43
|
+
this.items=this.items.filter(n=>!svgElement)
|
|
44
|
+
}
|
|
45
|
+
this.maintain();
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
// text(text,x,y){
|
|
49
|
+
// let item=svgText(text,x,y);
|
|
50
|
+
// this.element?.appendChildd(item.element);
|
|
51
|
+
// item.x(x-item.element.getComputedTextLength()/2);
|
|
52
|
+
// return item;
|
|
53
|
+
// }
|
|
54
|
+
// rect(x,y,w,h){
|
|
55
|
+
// let item=svgRect(x,y,w,h);
|
|
56
|
+
// this.add(item);
|
|
57
|
+
// return item;
|
|
58
|
+
// }
|
|
59
|
+
// line(x1,y1,x2,y2){
|
|
60
|
+
// let item=svgLine(x1,y1,x2,y2);
|
|
61
|
+
// this.element?.appendChildd(item.element);
|
|
62
|
+
// return item;
|
|
63
|
+
// }
|
|
64
|
+
// circle(cx,cy,r){
|
|
65
|
+
// let item=svgCircle(cx,cy,r);
|
|
66
|
+
// this.element?.appendChildd(item.element);
|
|
67
|
+
// return item;
|
|
68
|
+
// }
|
|
69
|
+
// ellipse(cx,cy,rx,ry){
|
|
70
|
+
// let item=svgEllipse(cx,cy,rx,ry);
|
|
71
|
+
// this.element?.appendChildd(item.element);
|
|
72
|
+
// return item;
|
|
73
|
+
// }
|
|
74
|
+
// polygon(X,Y){
|
|
75
|
+
// let item=svgPolygon(X,Y);
|
|
76
|
+
// this.element?.appendChildd(item.element);
|
|
77
|
+
// item.addPoints(X,Y)
|
|
78
|
+
// return item;
|
|
79
|
+
// }
|
|
80
|
+
// image(src,w,h,x,y){
|
|
81
|
+
// let item=svgImage(src,w,h,x,y);
|
|
82
|
+
// this.element?.appendddChild(item.element);
|
|
83
|
+
// return item;
|
|
84
|
+
// }
|
|
85
|
+
mask(){
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
toString(){
|
|
89
|
+
return (new XMLSerializer()).serializeToString(this.element);
|
|
90
|
+
}
|
|
91
|
+
btoa(){
|
|
92
|
+
return btoa(this.toString())
|
|
93
|
+
}
|
|
94
|
+
toImg(){
|
|
95
|
+
return 'data:image/svg+xml;base64,'+this.btoa()
|
|
96
|
+
}
|
|
97
|
+
toImg2(){
|
|
98
|
+
return "data:image/svg+xml;charset=utf8,"+this.toString().replaceAll("<","%3C").replaceAll(">","%3E").replaceAll("#","%23").replaceAll('"',"'");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const Svg =(w,h)=>new ZikoUISvg(w,h);
|
|
103
|
+
export{
|
|
104
|
+
Svg,
|
|
105
|
+
ZikoUISvg,
|
|
106
|
+
// svgLink,
|
|
107
|
+
// svgCircle,
|
|
108
|
+
// svgEllipse,
|
|
109
|
+
// svgImage,
|
|
110
|
+
// svgLine,
|
|
111
|
+
// svgPolygon,
|
|
112
|
+
// svgRect,
|
|
113
|
+
// svgText,
|
|
114
|
+
// svgGroupe
|
|
115
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import Math from "./math/index.js";
|
|
2
|
+
import UI from "./user-interface/index.js";
|
|
3
|
+
import Time from "./time/index.js";
|
|
4
|
+
import Data from "./data/index.js";
|
|
5
|
+
import Reactivity from "./reactivity/index.js";
|
|
6
|
+
import Graphics from "./graphics/index.js";
|
|
7
|
+
import {SPA} from "./app/router/index.js";
|
|
8
|
+
import {
|
|
9
|
+
__UI__,
|
|
10
|
+
__Config__
|
|
11
|
+
} from "./app/globals/index.js";
|
|
12
|
+
import ZikoUIElement from "./user-interface/elements/primitives/ZikoUIElement.js";
|
|
13
|
+
import {
|
|
14
|
+
App,
|
|
15
|
+
} from "./app";
|
|
16
|
+
const Ziko={
|
|
17
|
+
App,
|
|
18
|
+
Math,
|
|
19
|
+
UI,
|
|
20
|
+
Time,
|
|
21
|
+
Graphics,
|
|
22
|
+
Reactivity,
|
|
23
|
+
Data,
|
|
24
|
+
SPA,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// if ( globalThis.__Ziko__ ) {
|
|
28
|
+
// console.warn( 'WARNING: Multiple instances of Ziko.js being imported.' );
|
|
29
|
+
// } else {
|
|
30
|
+
// globalThis.__Ziko__={
|
|
31
|
+
// ...Ziko,
|
|
32
|
+
// __UI__,
|
|
33
|
+
// __Config__,
|
|
34
|
+
// ExtractAll,
|
|
35
|
+
// RemoveAll
|
|
36
|
+
// };
|
|
37
|
+
// }
|
|
38
|
+
globalThis.__Ziko__={
|
|
39
|
+
...Ziko,
|
|
40
|
+
__UI__,
|
|
41
|
+
__Config__,
|
|
42
|
+
ExtractAll,
|
|
43
|
+
RemoveAll
|
|
44
|
+
};
|
|
45
|
+
if(globalThis?.document){
|
|
46
|
+
document?.addEventListener("DOMContentLoaded", __Ziko__.__Config__.init());
|
|
47
|
+
}
|
|
48
|
+
function ExtractAll(){
|
|
49
|
+
UI.ExtractAll();
|
|
50
|
+
Math.ExtractAll();
|
|
51
|
+
Time.ExtractAll();
|
|
52
|
+
Reactivity.ExtractAll();
|
|
53
|
+
Graphics.ExtractAll();
|
|
54
|
+
Data.ExtractAll()
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
function RemoveAll(){
|
|
58
|
+
UI.RemoveAll();
|
|
59
|
+
Math.RemoveAll();
|
|
60
|
+
Time.RemoveAll();
|
|
61
|
+
Reactivity.RemoveAll();
|
|
62
|
+
Graphics.RemoveAll();
|
|
63
|
+
Data.RemoveAll()
|
|
64
|
+
}
|
|
65
|
+
export * from "./math/index.js";
|
|
66
|
+
export * from "./user-interface/index.js";
|
|
67
|
+
export * from "./graphics/index.js";
|
|
68
|
+
export * from "./time/index.js";
|
|
69
|
+
export * from "./data/index.js";
|
|
70
|
+
export * from "./app";
|
|
71
|
+
export * from "./reactivity/index.js"
|
|
72
|
+
export {
|
|
73
|
+
App,
|
|
74
|
+
Math,
|
|
75
|
+
UI,
|
|
76
|
+
Time,
|
|
77
|
+
Graphics,
|
|
78
|
+
Reactivity,
|
|
79
|
+
Data,
|
|
80
|
+
ZikoUIElement,
|
|
81
|
+
SPA,
|
|
82
|
+
ExtractAll,
|
|
83
|
+
RemoveAll
|
|
84
|
+
};
|
|
85
|
+
export default Ziko;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default class ZikoMath {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./special-functions/index.js"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { mapfun } from "../../utils/index.js";
|
|
2
|
+
import { fact } from "../../functions/index.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { mapfun } from "../../utils/index.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { mapfun } from "../../utils/mapfun.js";
|
|
2
|
+
const _gamma=x=>{
|
|
3
|
+
// Coefficients for the Lanczos approximation
|
|
4
|
+
const g = 7;
|
|
5
|
+
const p = [
|
|
6
|
+
0.99999999999980993,
|
|
7
|
+
676.5203681218851,
|
|
8
|
+
-1259.1392167224028,
|
|
9
|
+
771.32342877765313,
|
|
10
|
+
-176.61502916214059,
|
|
11
|
+
12.507343278686905,
|
|
12
|
+
-0.13857109526572012,
|
|
13
|
+
9.9843695780195716e-6,
|
|
14
|
+
1.5056327351493116e-7
|
|
15
|
+
];
|
|
16
|
+
if (x < 0.5) {
|
|
17
|
+
return +(Math.PI / (Math.sin(Math.PI * x) * _gamma(1 - x))).toFixed(10);
|
|
18
|
+
}
|
|
19
|
+
x -= 1;
|
|
20
|
+
let a = p[0];
|
|
21
|
+
for (let i = 1; i < g + 2; i++) {
|
|
22
|
+
a += p[i] / (x + i);
|
|
23
|
+
}
|
|
24
|
+
const t = x + g + 0.5;
|
|
25
|
+
return +(Math.sqrt(2 * Math.PI) * Math.pow(t, (x + 0.5)) * Math.exp(-t) * a).toFixed(10);
|
|
26
|
+
}
|
|
27
|
+
const gamma=(...x)=>mapfun(_gamma,...x);
|
|
28
|
+
export{
|
|
29
|
+
gamma
|
|
30
|
+
}
|
|
File without changes
|