@sentropic/design-system-vue 0.36.18 → 0.36.20
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/dist/AppHeader.d.ts +70 -0
- package/dist/AppHeader.d.ts.map +1 -1
- package/dist/AppHeader.js +34 -1
- package/dist/AppHeader.js.map +1 -1
- package/dist/Avatar.d.ts +1 -1
- package/dist/HLCChart.d.ts +64 -0
- package/dist/HLCChart.d.ts.map +1 -0
- package/dist/HLCChart.js +185 -0
- package/dist/HLCChart.js.map +1 -0
- package/dist/ItemChart.d.ts +80 -0
- package/dist/ItemChart.d.ts.map +1 -0
- package/dist/ItemChart.js +185 -0
- package/dist/ItemChart.js.map +1 -0
- package/dist/VennChart.d.ts +63 -0
- package/dist/VennChart.d.ts.map +1 -0
- package/dist/VennChart.js +199 -0
- package/dist/VennChart.js.map +1 -0
- package/dist/WordCloudChart.d.ts +63 -0
- package/dist/WordCloudChart.d.ts.map +1 -0
- package/dist/WordCloudChart.js +171 -0
- package/dist/WordCloudChart.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +443 -0
- package/package.json +1 -1
package/dist/AppHeader.d.ts
CHANGED
|
@@ -7,6 +7,22 @@ export type AppHeaderProps = {
|
|
|
7
7
|
* Auto-généré et stable si non fourni.
|
|
8
8
|
*/
|
|
9
9
|
drawerId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Marque structurée (décision actée : logo SENT + sous-titre). Rend le bloc
|
|
12
|
+
* canonique « logo carré + nom + sous-titre produit ». Si le slot `logo` est
|
|
13
|
+
* fourni, il a priorité (contrôle total).
|
|
14
|
+
*/
|
|
15
|
+
brandName?: string;
|
|
16
|
+
/** Sous-titre produit affiché sous le nom (ex. « Design System », « dataviz »). */
|
|
17
|
+
productName?: string;
|
|
18
|
+
/** Source de l'image du logo carré (ex. `/SENT-logo-squared.svg`). */
|
|
19
|
+
logoSrc?: string;
|
|
20
|
+
/** Texte alternatif du logo (décoratif par défaut). */
|
|
21
|
+
logoAlt?: string;
|
|
22
|
+
/** Cible du lien de la marque. Défaut : `/`. */
|
|
23
|
+
brandHref?: string;
|
|
24
|
+
/** aria-label du lien de marque (sinon dérivé de `brandName` + `productName`). */
|
|
25
|
+
brandLabel?: string;
|
|
10
26
|
class?: string;
|
|
11
27
|
};
|
|
12
28
|
export declare const AppHeader: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -26,6 +42,30 @@ export declare const AppHeader: import("vue").DefineComponent<import("vue").Extr
|
|
|
26
42
|
type: StringConstructor;
|
|
27
43
|
default: undefined;
|
|
28
44
|
};
|
|
45
|
+
brandName: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
productName: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
logoSrc: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
logoAlt: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
brandHref: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
brandLabel: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: undefined;
|
|
68
|
+
};
|
|
29
69
|
class: {
|
|
30
70
|
type: StringConstructor;
|
|
31
71
|
default: undefined;
|
|
@@ -51,6 +91,30 @@ export declare const AppHeader: import("vue").DefineComponent<import("vue").Extr
|
|
|
51
91
|
type: StringConstructor;
|
|
52
92
|
default: undefined;
|
|
53
93
|
};
|
|
94
|
+
brandName: {
|
|
95
|
+
type: StringConstructor;
|
|
96
|
+
default: undefined;
|
|
97
|
+
};
|
|
98
|
+
productName: {
|
|
99
|
+
type: StringConstructor;
|
|
100
|
+
default: undefined;
|
|
101
|
+
};
|
|
102
|
+
logoSrc: {
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
default: undefined;
|
|
105
|
+
};
|
|
106
|
+
logoAlt: {
|
|
107
|
+
type: StringConstructor;
|
|
108
|
+
default: string;
|
|
109
|
+
};
|
|
110
|
+
brandHref: {
|
|
111
|
+
type: StringConstructor;
|
|
112
|
+
default: string;
|
|
113
|
+
};
|
|
114
|
+
brandLabel: {
|
|
115
|
+
type: StringConstructor;
|
|
116
|
+
default: undefined;
|
|
117
|
+
};
|
|
54
118
|
class: {
|
|
55
119
|
type: StringConstructor;
|
|
56
120
|
default: undefined;
|
|
@@ -63,5 +127,11 @@ export declare const AppHeader: import("vue").DefineComponent<import("vue").Extr
|
|
|
63
127
|
menuOpen: boolean;
|
|
64
128
|
menuLabel: string;
|
|
65
129
|
drawerId: string;
|
|
130
|
+
brandName: string;
|
|
131
|
+
productName: string;
|
|
132
|
+
logoSrc: string;
|
|
133
|
+
logoAlt: string;
|
|
134
|
+
brandHref: string;
|
|
135
|
+
brandLabel: string;
|
|
66
136
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
67
137
|
//# sourceMappingURL=AppHeader.d.ts.map
|
package/dist/AppHeader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../src/AppHeader.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgDF,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../src/AppHeader.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgDF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAgHpB,CAAC"}
|
package/dist/AppHeader.js
CHANGED
|
@@ -46,6 +46,12 @@ export const AppHeader = defineComponent({
|
|
|
46
46
|
menuOpen: { type: Boolean, default: false },
|
|
47
47
|
menuLabel: { type: String, default: "Menu" },
|
|
48
48
|
drawerId: { type: String, default: undefined },
|
|
49
|
+
brandName: { type: String, default: undefined },
|
|
50
|
+
productName: { type: String, default: undefined },
|
|
51
|
+
logoSrc: { type: String, default: undefined },
|
|
52
|
+
logoAlt: { type: String, default: "" },
|
|
53
|
+
brandHref: { type: String, default: "/" },
|
|
54
|
+
brandLabel: { type: String, default: undefined },
|
|
49
55
|
class: { type: String, default: undefined },
|
|
50
56
|
},
|
|
51
57
|
emits: ["menuToggle"],
|
|
@@ -54,11 +60,38 @@ export const AppHeader = defineComponent({
|
|
|
54
60
|
// Id stable du tiroir : prop fournie sinon compteur module (SSR-safe).
|
|
55
61
|
const resolvedDrawerId = props.drawerId ?? `st-appHeader-drawer-${++appHeaderIdCounter}`;
|
|
56
62
|
return () => {
|
|
63
|
+
const hasDefaultBrand = !slots.logo && Boolean(props.brandName || props.productName || props.logoSrc);
|
|
64
|
+
const resolvedBrandLabel = props.brandLabel ?? [props.brandName, props.productName].filter(Boolean).join(" ");
|
|
57
65
|
const bar = h("div", { class: "st-appHeader__bar" }, [
|
|
58
66
|
// Logo SENT à GAUCHE (+ sous-titre).
|
|
59
67
|
slots.logo
|
|
60
68
|
? h("div", { class: "st-appHeader__logo" }, slots.logo())
|
|
61
|
-
:
|
|
69
|
+
: hasDefaultBrand
|
|
70
|
+
? h("a", {
|
|
71
|
+
class: "st-appHeader__brand",
|
|
72
|
+
href: props.brandHref,
|
|
73
|
+
"aria-label": resolvedBrandLabel || undefined,
|
|
74
|
+
}, [
|
|
75
|
+
props.logoSrc
|
|
76
|
+
? h("img", {
|
|
77
|
+
class: "st-appHeader__brandMark",
|
|
78
|
+
src: props.logoSrc,
|
|
79
|
+
alt: props.logoAlt,
|
|
80
|
+
"aria-hidden": props.logoAlt ? undefined : "true",
|
|
81
|
+
})
|
|
82
|
+
: null,
|
|
83
|
+
props.brandName || props.productName
|
|
84
|
+
? h("span", { class: "st-appHeader__brandCopy" }, [
|
|
85
|
+
props.brandName
|
|
86
|
+
? h("span", { class: "st-appHeader__brandName" }, props.brandName)
|
|
87
|
+
: null,
|
|
88
|
+
props.productName
|
|
89
|
+
? h("span", { class: "st-appHeader__brandProduct" }, props.productName)
|
|
90
|
+
: null,
|
|
91
|
+
])
|
|
92
|
+
: null,
|
|
93
|
+
])
|
|
94
|
+
: null,
|
|
62
95
|
// Nav desktop + actions (masqués en mode compact).
|
|
63
96
|
!props.compact
|
|
64
97
|
? h("nav", { class: "st-appHeader__nav", "aria-label": "Primary" }, slots.nav?.())
|
package/dist/AppHeader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../src/AppHeader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,uEAAuE;AACvE,4DAA4D;AAC5D,IAAI,kBAAkB,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../src/AppHeader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,uEAAuE;AACvE,4DAA4D;AAC5D,IAAI,kBAAkB,GAAG,CAAC,CAAC;AA8B3B,gFAAgF;AAChF,gEAAgE;AAChE,SAAS,QAAQ;IACf,OAAO,CAAC,CACN,KAAK,EACL;QACE,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,WAAW;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,cAAc;QACtB,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,OAAO;QACzB,iBAAiB,EAAE,OAAO;QAC1B,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,OAAO;QAClB,KAAK,EAAE,0BAA0B;KAClC,EACD;QACE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC;QAC3B,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC;QAC5B,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC;KAC7B,CACF,CAAC;AACJ,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,CAAC,CACN,KAAK,EACL;QACE,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,WAAW;QAC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C,YAAY,EAAE,KAAK,CAAC,SAAS;4BAC7B,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;4BAClD,eAAe,EAAE,gBAAgB;4BACjC,eAAe,EAAE,MAAM;4BACvB,OAAO,EAAE,QAAQ;yBAClB,EACD,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CACxC;qBACF,CAAC;oBACJ,CAAC,CAAC,IAAI;aACT,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,CAAC,CACd,QAAQ,EACR,EAAE,KAAK,EAAE,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAClD,CAAC,GAAG,CAAC,CACN,CAAC;YAEF,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBACpD,OAAO;oBACL,MAAM;oBACN,CAAC,CAAC,QAAQ,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,qBAAqB;wBAC5B,YAAY,EAAE,KAAK,CAAC,SAAS;wBAC7B,OAAO,EAAE,QAAQ;qBAClB,CAAC;oBACF,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;iBACpF,CAAC;YACJ,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/dist/Avatar.d.ts
CHANGED
|
@@ -78,8 +78,8 @@ export declare const Avatar: import("vue").DefineComponent<import("vue").Extract
|
|
|
78
78
|
size: AvatarSize;
|
|
79
79
|
class: string;
|
|
80
80
|
tone: AvatarTone;
|
|
81
|
-
shape: AvatarShape;
|
|
82
81
|
src: string;
|
|
83
82
|
alt: string;
|
|
83
|
+
shape: AvatarShape;
|
|
84
84
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
85
85
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type HLCChartDatum = {
|
|
2
|
+
label: string;
|
|
3
|
+
high: number;
|
|
4
|
+
low: number;
|
|
5
|
+
close: number;
|
|
6
|
+
};
|
|
7
|
+
export type HLCChartProps = {
|
|
8
|
+
data: HLCChartDatum[];
|
|
9
|
+
label: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
class?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const HLCChart: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
data: {
|
|
16
|
+
type: () => HLCChartDatum[];
|
|
17
|
+
default: () => never[];
|
|
18
|
+
};
|
|
19
|
+
label: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
width: {
|
|
24
|
+
type: NumberConstructor;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
height: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
class: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
data: {
|
|
39
|
+
type: () => HLCChartDatum[];
|
|
40
|
+
default: () => never[];
|
|
41
|
+
};
|
|
42
|
+
label: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
width: {
|
|
47
|
+
type: NumberConstructor;
|
|
48
|
+
default: number;
|
|
49
|
+
};
|
|
50
|
+
height: {
|
|
51
|
+
type: NumberConstructor;
|
|
52
|
+
default: number;
|
|
53
|
+
};
|
|
54
|
+
class: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: undefined;
|
|
57
|
+
};
|
|
58
|
+
}>> & Readonly<{}>, {
|
|
59
|
+
class: string;
|
|
60
|
+
data: HLCChartDatum[];
|
|
61
|
+
height: number;
|
|
62
|
+
width: number;
|
|
63
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
|
+
//# sourceMappingURL=HLCChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HLCChart.d.ts","sourceRoot":"","sources":["../src/HLCChart.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAsCF,eAAO,MAAM,QAAQ;;cAGM,MAAM,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;cAArB,MAAM,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;4EAgL9C,CAAC"}
|
package/dist/HLCChart.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { defineComponent, h, ref } from "vue";
|
|
2
|
+
import { classNames } from "./classNames.js";
|
|
3
|
+
import { chartDataList } from "./chartScale.js";
|
|
4
|
+
const MARGIN = { top: 12, right: 16, bottom: 32, left: 52 };
|
|
5
|
+
function scaleLinear(v, d0, d1, r0, r1) {
|
|
6
|
+
if (d1 === d0)
|
|
7
|
+
return r0;
|
|
8
|
+
return r0 + ((v - d0) * (r1 - r0)) / (d1 - d0);
|
|
9
|
+
}
|
|
10
|
+
function niceTicks(min, max, target = 5) {
|
|
11
|
+
if (!Number.isFinite(min) || !Number.isFinite(max) || min === max) {
|
|
12
|
+
const base = Number.isFinite(max) ? max : 0;
|
|
13
|
+
return [base];
|
|
14
|
+
}
|
|
15
|
+
const range = max - min;
|
|
16
|
+
const rough = range / Math.max(target - 1, 1);
|
|
17
|
+
const pow = Math.pow(10, Math.floor(Math.log10(rough)));
|
|
18
|
+
const norm = rough / pow;
|
|
19
|
+
let step;
|
|
20
|
+
if (norm < 1.5)
|
|
21
|
+
step = 1 * pow;
|
|
22
|
+
else if (norm < 3)
|
|
23
|
+
step = 2 * pow;
|
|
24
|
+
else if (norm < 7)
|
|
25
|
+
step = 5 * pow;
|
|
26
|
+
else
|
|
27
|
+
step = 10 * pow;
|
|
28
|
+
const start = Math.floor(min / step) * step;
|
|
29
|
+
const end = Math.ceil(max / step) * step;
|
|
30
|
+
const ticks = [];
|
|
31
|
+
for (let v = start; v <= end + step / 2; v += step) {
|
|
32
|
+
ticks.push(Number(v.toFixed(10)));
|
|
33
|
+
}
|
|
34
|
+
return ticks;
|
|
35
|
+
}
|
|
36
|
+
function formatTick(v) {
|
|
37
|
+
if (Math.abs(v) >= 1000)
|
|
38
|
+
return `${(v / 1000).toFixed(v % 1000 === 0 ? 0 : 1)}k`;
|
|
39
|
+
if (Number.isInteger(v))
|
|
40
|
+
return String(v);
|
|
41
|
+
return v.toFixed(1);
|
|
42
|
+
}
|
|
43
|
+
export const HLCChart = defineComponent({
|
|
44
|
+
name: "HLCChart",
|
|
45
|
+
props: {
|
|
46
|
+
data: { type: Array, default: () => [] },
|
|
47
|
+
label: { type: String, required: true },
|
|
48
|
+
width: { type: Number, default: 480 },
|
|
49
|
+
height: { type: Number, default: 240 },
|
|
50
|
+
class: { type: String, default: undefined },
|
|
51
|
+
},
|
|
52
|
+
setup(props, { attrs }) {
|
|
53
|
+
const hoveredIndex = ref(null);
|
|
54
|
+
function handleLeave() {
|
|
55
|
+
hoveredIndex.value = null;
|
|
56
|
+
}
|
|
57
|
+
function handlePointerMove(event) {
|
|
58
|
+
const target = event.target;
|
|
59
|
+
if (!(target instanceof Element)) {
|
|
60
|
+
hoveredIndex.value = null;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const idx = Number(target.getAttribute("data-chart-index"));
|
|
64
|
+
hoveredIndex.value = Number.isInteger(idx) ? idx : null;
|
|
65
|
+
}
|
|
66
|
+
return () => {
|
|
67
|
+
const data = props.data ?? [];
|
|
68
|
+
const label = props.label;
|
|
69
|
+
const width = props.width ?? 480;
|
|
70
|
+
const height = props.height ?? 240;
|
|
71
|
+
const plotWidth = Math.max(width - MARGIN.left - MARGIN.right, 1);
|
|
72
|
+
const plotHeight = Math.max(height - MARGIN.top - MARGIN.bottom, 1);
|
|
73
|
+
// Filter invalid bars BEFORE domain
|
|
74
|
+
const validData = data.filter((d) => Number.isFinite(d.high) &&
|
|
75
|
+
Number.isFinite(d.low) &&
|
|
76
|
+
Number.isFinite(d.close));
|
|
77
|
+
const allVals = [];
|
|
78
|
+
for (const d of validData) {
|
|
79
|
+
// Domain includes high/low/close (no open)
|
|
80
|
+
allVals.push(d.high, d.low, d.close);
|
|
81
|
+
}
|
|
82
|
+
const rawMin = allVals.length === 0 ? 0 : Math.min(...allVals);
|
|
83
|
+
const rawMax = allVals.length === 0 ? 1 : Math.max(...allVals);
|
|
84
|
+
// Flat domain → fallback range 1 to avoid division by zero
|
|
85
|
+
const safeRawMax = rawMax === rawMin ? rawMin + 1 : rawMax;
|
|
86
|
+
const ticks = niceTicks(rawMin, safeRawMax, 5);
|
|
87
|
+
const domainMin = ticks[0] ?? rawMin;
|
|
88
|
+
const domainMax = ticks[ticks.length - 1] ?? safeRawMax;
|
|
89
|
+
const band = validData.length > 0 ? plotWidth / validData.length : plotWidth;
|
|
90
|
+
// length of the close tick (right of the bar)
|
|
91
|
+
const tickW = Math.min(band * 0.3, 12);
|
|
92
|
+
const bars = validData.map((d, i) => {
|
|
93
|
+
// clamp high/low to guarantee high≥close and low≤close
|
|
94
|
+
const clampedHigh = Math.max(d.high, d.close);
|
|
95
|
+
const clampedLow = Math.min(d.low, d.close);
|
|
96
|
+
// up/down = close vs. previous close (first bar = up)
|
|
97
|
+
const prevClose = i > 0 ? validData[i - 1].close : d.close;
|
|
98
|
+
const bullish = d.close >= prevClose;
|
|
99
|
+
const centerX = MARGIN.left + band * i + band / 2;
|
|
100
|
+
const highY = MARGIN.top + scaleLinear(clampedHigh, domainMin, domainMax, plotHeight, 0);
|
|
101
|
+
const lowY = MARGIN.top + scaleLinear(clampedLow, domainMin, domainMax, plotHeight, 0);
|
|
102
|
+
const closeY = MARGIN.top + scaleLinear(d.close, domainMin, domainMax, plotHeight, 0);
|
|
103
|
+
return {
|
|
104
|
+
datum: d, index: i, bullish, centerX,
|
|
105
|
+
barHighY: highY, barLowY: lowY,
|
|
106
|
+
closeY,
|
|
107
|
+
closeX: centerX + tickW,
|
|
108
|
+
tooltipY: Math.min(highY, closeY),
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
const dataValueItems = validData.map((d) => `${d.label}: H ${d.high} L ${d.low} C ${d.close}`);
|
|
112
|
+
const svgChildren = [];
|
|
113
|
+
// gridlines + tick labels
|
|
114
|
+
for (const tick of ticks) {
|
|
115
|
+
const ty = MARGIN.top + scaleLinear(tick, domainMin, domainMax, plotHeight, 0);
|
|
116
|
+
svgChildren.push(h("line", { key: `g${tick}`, class: "st-hlcChart__grid", x1: MARGIN.left, x2: width - MARGIN.right, y1: ty, y2: ty }));
|
|
117
|
+
svgChildren.push(h("text", { key: `t${tick}`, class: "st-hlcChart__tickLabel", x: MARGIN.left - 6, y: ty, "text-anchor": "end", "dominant-baseline": "middle" }, formatTick(tick)));
|
|
118
|
+
}
|
|
119
|
+
// axes
|
|
120
|
+
svgChildren.push(h("line", { class: "st-hlcChart__axis", x1: MARGIN.left, x2: MARGIN.left, y1: MARGIN.top, y2: height - MARGIN.bottom }));
|
|
121
|
+
svgChildren.push(h("line", { class: "st-hlcChart__axis", x1: MARGIN.left, x2: width - MARGIN.right, y1: height - MARGIN.bottom, y2: height - MARGIN.bottom }));
|
|
122
|
+
// composite key to avoid duplicates
|
|
123
|
+
for (const b of bars) {
|
|
124
|
+
const i = b.index;
|
|
125
|
+
const isDim = hoveredIndex.value !== null && hoveredIndex.value !== i;
|
|
126
|
+
svgChildren.push(h("g", {
|
|
127
|
+
key: `bar${i}-${b.datum.label}`,
|
|
128
|
+
class: classNames("st-hlcChart__bar", `st-hlcChart__bar--${b.bullish ? "up" : "down"}`, isDim ? "st-hlcChart__bar--dim" : undefined),
|
|
129
|
+
}, [
|
|
130
|
+
// vertical low → high range
|
|
131
|
+
h("line", {
|
|
132
|
+
class: "st-hlcChart__range",
|
|
133
|
+
x1: b.centerX, x2: b.centerX,
|
|
134
|
+
y1: b.barHighY, y2: b.barLowY,
|
|
135
|
+
"data-chart-index": i,
|
|
136
|
+
}),
|
|
137
|
+
// close tick (right)
|
|
138
|
+
h("line", {
|
|
139
|
+
class: "st-hlcChart__close",
|
|
140
|
+
x1: b.centerX, x2: b.closeX,
|
|
141
|
+
y1: b.closeY, y2: b.closeY,
|
|
142
|
+
"data-chart-index": i,
|
|
143
|
+
}),
|
|
144
|
+
]));
|
|
145
|
+
// category label
|
|
146
|
+
svgChildren.push(h("text", {
|
|
147
|
+
key: `lbl${i}`,
|
|
148
|
+
class: "st-hlcChart__categoryLabel",
|
|
149
|
+
x: b.centerX, y: height - MARGIN.bottom + 16,
|
|
150
|
+
"text-anchor": "middle",
|
|
151
|
+
}, b.datum.label));
|
|
152
|
+
}
|
|
153
|
+
const hoveredBar = hoveredIndex.value !== null ? bars[hoveredIndex.value] : undefined;
|
|
154
|
+
const children = [
|
|
155
|
+
h("div", {
|
|
156
|
+
class: "st-hlcChart__visual",
|
|
157
|
+
role: "img",
|
|
158
|
+
"aria-label": label,
|
|
159
|
+
onPointermove: handlePointerMove,
|
|
160
|
+
onPointerleave: handleLeave,
|
|
161
|
+
}, [
|
|
162
|
+
h("svg", {
|
|
163
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
164
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
165
|
+
width: "100%", height: "100%",
|
|
166
|
+
focusable: "false", "aria-hidden": "true",
|
|
167
|
+
}, svgChildren),
|
|
168
|
+
]),
|
|
169
|
+
chartDataList(label, dataValueItems),
|
|
170
|
+
];
|
|
171
|
+
if (hoveredBar) {
|
|
172
|
+
children.push(h("div", {
|
|
173
|
+
class: "st-hlcChart__tooltip",
|
|
174
|
+
role: "presentation",
|
|
175
|
+
style: `left:${(hoveredBar.centerX / width) * 100}%;top:${(hoveredBar.tooltipY / height) * 100}%`,
|
|
176
|
+
}, [
|
|
177
|
+
h("span", { class: "st-hlcChart__tooltipLabel" }, hoveredBar.datum.label),
|
|
178
|
+
h("span", { class: "st-hlcChart__tooltipValue" }, `H ${hoveredBar.datum.high} L ${hoveredBar.datum.low} C ${hoveredBar.datum.close}`),
|
|
179
|
+
]));
|
|
180
|
+
}
|
|
181
|
+
return h("div", { ...attrs, class: classNames("st-hlcChart", props.class) }, children);
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
//# sourceMappingURL=HLCChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HLCChart.js","sourceRoot":"","sources":["../src/HLCChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAiBhD,MAAM,MAAM,GA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|
|
|
1
|
+
export type ItemChartTone = "category1" | "category2" | "category3" | "category4" | "category5" | "category6" | "category7" | "category8";
|
|
2
|
+
export type ItemChartDatum = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
tone?: ItemChartTone;
|
|
6
|
+
};
|
|
7
|
+
export type ItemChartSeat = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
r: number;
|
|
11
|
+
tone: ItemChartTone;
|
|
12
|
+
groupIndex: number;
|
|
13
|
+
};
|
|
14
|
+
export type ItemChartProps = {
|
|
15
|
+
data: ItemChartDatum[];
|
|
16
|
+
width?: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
label: string;
|
|
19
|
+
class?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function seatCount(value: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Construit la liste ordonnée des sièges de l'hémicycle, puis affecte chaque
|
|
24
|
+
* siège à un groupe dans l'ordre fourni (blocs contigus). Pur, sans état.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildSeats(counts: number[], width: number, height: number): {
|
|
27
|
+
seats: ItemChartSeat[];
|
|
28
|
+
cx: number;
|
|
29
|
+
cy: number;
|
|
30
|
+
};
|
|
31
|
+
export declare const ItemChart: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
32
|
+
data: {
|
|
33
|
+
type: () => ItemChartDatum[];
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
width: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: number;
|
|
39
|
+
};
|
|
40
|
+
height: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
label: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
class: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
|
+
data: {
|
|
56
|
+
type: () => ItemChartDatum[];
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
width: {
|
|
60
|
+
type: NumberConstructor;
|
|
61
|
+
default: number;
|
|
62
|
+
};
|
|
63
|
+
height: {
|
|
64
|
+
type: NumberConstructor;
|
|
65
|
+
default: number;
|
|
66
|
+
};
|
|
67
|
+
label: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
class: {
|
|
72
|
+
type: StringConstructor;
|
|
73
|
+
default: undefined;
|
|
74
|
+
};
|
|
75
|
+
}>> & Readonly<{}>, {
|
|
76
|
+
class: string;
|
|
77
|
+
height: number;
|
|
78
|
+
width: number;
|
|
79
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
80
|
+
//# sourceMappingURL=ItemChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemChart.d.ts","sourceRoot":"","sources":["../src/ItemChart.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,aAAa,CAA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