@sentropic/design-system-vue 0.14.0 → 0.15.0
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/BulletChart.d.ts +74 -0
- package/dist/BulletChart.d.ts.map +1 -0
- package/dist/BulletChart.js +321 -0
- package/dist/BulletChart.js.map +1 -0
- package/dist/BumpChart.d.ts +74 -0
- package/dist/BumpChart.d.ts.map +1 -0
- package/dist/BumpChart.js +231 -0
- package/dist/BumpChart.js.map +1 -0
- package/dist/CalendarHeatmapChart.d.ts +62 -0
- package/dist/CalendarHeatmapChart.d.ts.map +1 -0
- package/dist/CalendarHeatmapChart.js +203 -0
- package/dist/CalendarHeatmapChart.js.map +1 -0
- package/dist/CandlestickChart.d.ts +65 -0
- package/dist/CandlestickChart.d.ts.map +1 -0
- package/dist/CandlestickChart.js +183 -0
- package/dist/CandlestickChart.js.map +1 -0
- package/dist/MarimekkoChart.d.ts +69 -0
- package/dist/MarimekkoChart.d.ts.map +1 -0
- package/dist/MarimekkoChart.js +165 -0
- package/dist/MarimekkoChart.js.map +1 -0
- package/dist/ParallelCoordinatesChart.d.ts +85 -0
- package/dist/ParallelCoordinatesChart.d.ts.map +1 -0
- package/dist/ParallelCoordinatesChart.js +190 -0
- package/dist/ParallelCoordinatesChart.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +505 -0
- package/package.json +1 -1
|
@@ -0,0 +1,183 @@
|
|
|
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 CandlestickChart = defineComponent({
|
|
44
|
+
name: "CandlestickChart",
|
|
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
|
+
// FIX: filter invalid candles BEFORE domain
|
|
74
|
+
const validData = data.filter((d) => Number.isFinite(d.open) &&
|
|
75
|
+
Number.isFinite(d.high) &&
|
|
76
|
+
Number.isFinite(d.low) &&
|
|
77
|
+
Number.isFinite(d.close));
|
|
78
|
+
const allVals = [];
|
|
79
|
+
for (const d of validData) {
|
|
80
|
+
// Domain includes open/high/low/close (not just high/low)
|
|
81
|
+
allVals.push(d.open, d.high, d.low, d.close);
|
|
82
|
+
}
|
|
83
|
+
const rawMin = allVals.length === 0 ? 0 : Math.min(...allVals);
|
|
84
|
+
const rawMax = allVals.length === 0 ? 1 : Math.max(...allVals);
|
|
85
|
+
// Flat domain → fallback range 1 to avoid division by zero
|
|
86
|
+
const safeRawMax = rawMax === rawMin ? rawMin + 1 : rawMax;
|
|
87
|
+
const ticks = niceTicks(rawMin, safeRawMax, 5);
|
|
88
|
+
const domainMin = ticks[0] ?? rawMin;
|
|
89
|
+
const domainMax = ticks[ticks.length - 1] ?? safeRawMax;
|
|
90
|
+
const band = validData.length > 0 ? plotWidth / validData.length : plotWidth;
|
|
91
|
+
const bodyW = band * 0.55;
|
|
92
|
+
const candles = validData.map((d, i) => {
|
|
93
|
+
// FIX: clamp high/low to guarantee high≥max(O,C) and low≤min(O,C)
|
|
94
|
+
const clampedHigh = Math.max(d.high, d.open, d.close);
|
|
95
|
+
const clampedLow = Math.min(d.low, d.open, d.close);
|
|
96
|
+
const bullish = d.close >= d.open;
|
|
97
|
+
const centerX = MARGIN.left + band * i + band / 2;
|
|
98
|
+
const bodyTop = MARGIN.top + scaleLinear(Math.max(d.open, d.close), domainMin, domainMax, plotHeight, 0);
|
|
99
|
+
const bodyBot = MARGIN.top + scaleLinear(Math.min(d.open, d.close), domainMin, domainMax, plotHeight, 0);
|
|
100
|
+
const highY = MARGIN.top + scaleLinear(clampedHigh, domainMin, domainMax, plotHeight, 0);
|
|
101
|
+
const lowY = MARGIN.top + scaleLinear(clampedLow, domainMin, domainMax, plotHeight, 0);
|
|
102
|
+
return {
|
|
103
|
+
datum: d, index: i, bullish, centerX,
|
|
104
|
+
bodyX: centerX - bodyW / 2,
|
|
105
|
+
bodyY: bodyTop,
|
|
106
|
+
bodyW,
|
|
107
|
+
bodyH: Math.max(bodyBot - bodyTop, 0.5),
|
|
108
|
+
wickHighY: highY, wickLowY: lowY,
|
|
109
|
+
tooltipY: bodyTop,
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
const dataValueItems = validData.map((d) => `${d.label}: O ${d.open} H ${d.high} L ${d.low} C ${d.close}`);
|
|
113
|
+
const svgChildren = [];
|
|
114
|
+
// gridlines + tick labels
|
|
115
|
+
for (const tick of ticks) {
|
|
116
|
+
const ty = MARGIN.top + scaleLinear(tick, domainMin, domainMax, plotHeight, 0);
|
|
117
|
+
svgChildren.push(h("line", { key: `g${tick}`, class: "st-candlestickChart__grid", x1: MARGIN.left, x2: width - MARGIN.right, y1: ty, y2: ty }));
|
|
118
|
+
svgChildren.push(h("text", { key: `t${tick}`, class: "st-candlestickChart__tickLabel", x: MARGIN.left - 6, y: ty, "text-anchor": "end", "dominant-baseline": "middle" }, formatTick(tick)));
|
|
119
|
+
}
|
|
120
|
+
// axes
|
|
121
|
+
svgChildren.push(h("line", { class: "st-candlestickChart__axis", x1: MARGIN.left, x2: MARGIN.left, y1: MARGIN.top, y2: height - MARGIN.bottom }));
|
|
122
|
+
svgChildren.push(h("line", { class: "st-candlestickChart__axis", x1: MARGIN.left, x2: width - MARGIN.right, y1: height - MARGIN.bottom, y2: height - MARGIN.bottom }));
|
|
123
|
+
// FIX: composite key to avoid duplicates
|
|
124
|
+
for (const c of candles) {
|
|
125
|
+
const i = c.index;
|
|
126
|
+
// wick
|
|
127
|
+
svgChildren.push(h("line", {
|
|
128
|
+
key: `w${i}-${c.datum.label}`,
|
|
129
|
+
class: `st-candlestickChart__wick st-candlestickChart__wick--${c.bullish ? "up" : "down"}`,
|
|
130
|
+
x1: c.centerX, x2: c.centerX,
|
|
131
|
+
y1: c.wickHighY, y2: c.wickLowY,
|
|
132
|
+
"data-chart-index": i,
|
|
133
|
+
}));
|
|
134
|
+
// body
|
|
135
|
+
const isDim = hoveredIndex.value !== null && hoveredIndex.value !== i;
|
|
136
|
+
svgChildren.push(h("rect", {
|
|
137
|
+
key: `b${i}-${c.datum.label}`,
|
|
138
|
+
class: classNames("st-candlestickChart__body", `st-candlestickChart__body--${c.bullish ? "up" : "down"}`, isDim ? "st-candlestickChart__body--dim" : undefined),
|
|
139
|
+
x: c.bodyX, y: c.bodyY, width: c.bodyW, height: c.bodyH,
|
|
140
|
+
rx: 1,
|
|
141
|
+
"data-chart-index": i,
|
|
142
|
+
}));
|
|
143
|
+
// category label
|
|
144
|
+
svgChildren.push(h("text", {
|
|
145
|
+
key: `lbl${i}`,
|
|
146
|
+
class: "st-candlestickChart__categoryLabel",
|
|
147
|
+
x: c.centerX, y: height - MARGIN.bottom + 16,
|
|
148
|
+
"text-anchor": "middle",
|
|
149
|
+
}, c.datum.label));
|
|
150
|
+
}
|
|
151
|
+
const hoveredCandle = hoveredIndex.value !== null ? candles[hoveredIndex.value] : undefined;
|
|
152
|
+
const children = [
|
|
153
|
+
h("div", {
|
|
154
|
+
class: "st-candlestickChart__visual",
|
|
155
|
+
role: "img",
|
|
156
|
+
"aria-label": label,
|
|
157
|
+
onPointermove: handlePointerMove,
|
|
158
|
+
onPointerleave: handleLeave,
|
|
159
|
+
}, [
|
|
160
|
+
h("svg", {
|
|
161
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
162
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
163
|
+
width: "100%", height: "100%",
|
|
164
|
+
focusable: "false", "aria-hidden": "true",
|
|
165
|
+
}, svgChildren),
|
|
166
|
+
]),
|
|
167
|
+
chartDataList(label, dataValueItems),
|
|
168
|
+
];
|
|
169
|
+
if (hoveredCandle) {
|
|
170
|
+
children.push(h("div", {
|
|
171
|
+
class: "st-candlestickChart__tooltip",
|
|
172
|
+
role: "presentation",
|
|
173
|
+
style: `left:${(hoveredCandle.centerX / width) * 100}%;top:${(hoveredCandle.tooltipY / height) * 100}%`,
|
|
174
|
+
}, [
|
|
175
|
+
h("span", { class: "st-candlestickChart__tooltipLabel" }, hoveredCandle.datum.label),
|
|
176
|
+
h("span", { class: "st-candlestickChart__tooltipValue" }, `O ${hoveredCandle.datum.open} H ${hoveredCandle.datum.high} L ${hoveredCandle.datum.low} C ${hoveredCandle.datum.close}`),
|
|
177
|
+
]));
|
|
178
|
+
}
|
|
179
|
+
return h("div", { ...attrs, class: classNames("st-candlestickChart", props.class) }, children);
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
//# sourceMappingURL=CandlestickChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CandlestickChart.js","sourceRoot":"","sources":["../src/CandlestickChart.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,E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,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,mCAAmC,EAAE,EAAE,KAAK,aAAa,CAAC,KAAK,CAAC,IAAI,MAAM,aAAa,CAAC,KAAK,CAAC,IAAI,MAAM,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;iBACrL,CAAC,CAAC,CAAC;YACN,CAAC;YAED,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,qBAAqB,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACjG,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type MarimekkoChartTone = "category1" | "category2" | "category3" | "category4" | "category5" | "category6" | "category7" | "category8";
|
|
2
|
+
export type MarimekkoChartSegment = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
tone?: MarimekkoChartTone;
|
|
6
|
+
};
|
|
7
|
+
export type MarimekkoChartDatum = {
|
|
8
|
+
label: string;
|
|
9
|
+
width: number;
|
|
10
|
+
segments: MarimekkoChartSegment[];
|
|
11
|
+
};
|
|
12
|
+
export type MarimekkoChartProps = {
|
|
13
|
+
data: MarimekkoChartDatum[];
|
|
14
|
+
label: string;
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
class?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const MarimekkoChart: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
20
|
+
data: {
|
|
21
|
+
type: () => MarimekkoChartDatum[];
|
|
22
|
+
default: () => never[];
|
|
23
|
+
};
|
|
24
|
+
label: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
width: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
height: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
class: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
data: {
|
|
44
|
+
type: () => MarimekkoChartDatum[];
|
|
45
|
+
default: () => never[];
|
|
46
|
+
};
|
|
47
|
+
label: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
width: {
|
|
52
|
+
type: NumberConstructor;
|
|
53
|
+
default: number;
|
|
54
|
+
};
|
|
55
|
+
height: {
|
|
56
|
+
type: NumberConstructor;
|
|
57
|
+
default: number;
|
|
58
|
+
};
|
|
59
|
+
class: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: undefined;
|
|
62
|
+
};
|
|
63
|
+
}>> & Readonly<{}>, {
|
|
64
|
+
class: string;
|
|
65
|
+
data: MarimekkoChartDatum[];
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
|
+
//# sourceMappingURL=MarimekkoChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarimekkoChart.d.ts","sourceRoot":"","sources":["../src/MarimekkoChart.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAC1B,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,qBAAqB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AASF,eAAO,MAAM,cAAc;;cAGA,MAAM,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;cAA3B,MAAM,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;4EA2LpD,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { defineComponent, h, ref } from "vue";
|
|
2
|
+
import { classNames } from "./classNames.js";
|
|
3
|
+
import { chartDataList } from "./chartScale.js";
|
|
4
|
+
import { contrastTextForTone } from "./chartContrast.js";
|
|
5
|
+
const TONES = [
|
|
6
|
+
"category1", "category2", "category3", "category4",
|
|
7
|
+
"category5", "category6", "category7", "category8",
|
|
8
|
+
];
|
|
9
|
+
const MARGIN = { top: 12, right: 16, bottom: 32, left: 8 };
|
|
10
|
+
export const MarimekkoChart = defineComponent({
|
|
11
|
+
name: "MarimekkoChart",
|
|
12
|
+
props: {
|
|
13
|
+
data: { type: Array, default: () => [] },
|
|
14
|
+
label: { type: String, required: true },
|
|
15
|
+
width: { type: Number, default: 480 },
|
|
16
|
+
height: { type: Number, default: 300 },
|
|
17
|
+
class: { type: String, default: undefined },
|
|
18
|
+
},
|
|
19
|
+
setup(props, { attrs }) {
|
|
20
|
+
const hoveredKey = ref(null);
|
|
21
|
+
function handleLeave() {
|
|
22
|
+
hoveredKey.value = null;
|
|
23
|
+
}
|
|
24
|
+
function handlePointerMove(event) {
|
|
25
|
+
const target = event.target;
|
|
26
|
+
if (!(target instanceof Element)) {
|
|
27
|
+
hoveredKey.value = null;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
hoveredKey.value = target.getAttribute("data-chart-key") ?? null;
|
|
31
|
+
}
|
|
32
|
+
return () => {
|
|
33
|
+
const data = props.data ?? [];
|
|
34
|
+
const label = props.label;
|
|
35
|
+
const width = props.width ?? 480;
|
|
36
|
+
const height = props.height ?? 300;
|
|
37
|
+
const plotWidth = Math.max(width - MARGIN.left - MARGIN.right, 1);
|
|
38
|
+
const plotHeight = Math.max(height - MARGIN.top - MARGIN.bottom, 1);
|
|
39
|
+
// FIX: ignore (skip) non-finite or <=0 widths, NO Math.abs
|
|
40
|
+
let totalWidth = 0;
|
|
41
|
+
for (const d of data) {
|
|
42
|
+
const w = d.width;
|
|
43
|
+
if (Number.isFinite(w) && w > 0)
|
|
44
|
+
totalWidth += w;
|
|
45
|
+
}
|
|
46
|
+
if (totalWidth <= 0)
|
|
47
|
+
totalWidth = 1;
|
|
48
|
+
const cells = [];
|
|
49
|
+
let xCursor = MARGIN.left;
|
|
50
|
+
for (const datum of data) {
|
|
51
|
+
const safeW = Number.isFinite(datum.width) && datum.width > 0 ? datum.width : 0;
|
|
52
|
+
// FIX: skip invalid columns
|
|
53
|
+
if (safeW <= 0)
|
|
54
|
+
continue;
|
|
55
|
+
const colW = (safeW / totalWidth) * plotWidth;
|
|
56
|
+
const colPct = safeW / totalWidth;
|
|
57
|
+
// FIX: ignore non-finite or <=0 segments (NO Math.abs, NO 0.5px floor)
|
|
58
|
+
const validSegs = datum.segments.filter((s) => Number.isFinite(s.value) && s.value > 0);
|
|
59
|
+
const segSum = validSegs.reduce((acc, s) => acc + s.value, 0);
|
|
60
|
+
const safeSum = segSum > 0 ? segSum : 1;
|
|
61
|
+
let yCursor = MARGIN.top;
|
|
62
|
+
for (let si = 0; si < validSegs.length; si++) {
|
|
63
|
+
const seg = validSegs[si];
|
|
64
|
+
const pct = seg.value / safeSum;
|
|
65
|
+
const segH = pct * plotHeight;
|
|
66
|
+
const tone = seg.tone ?? TONES[si % TONES.length];
|
|
67
|
+
cells.push({
|
|
68
|
+
key: `${datum.label}-${seg.label}`,
|
|
69
|
+
catLabel: datum.label,
|
|
70
|
+
segLabel: seg.label,
|
|
71
|
+
tone,
|
|
72
|
+
x: xCursor,
|
|
73
|
+
y: yCursor,
|
|
74
|
+
// FIX: no floor at 0.5px for zeros (they are filtered)
|
|
75
|
+
w: Math.max(colW - 1, 1),
|
|
76
|
+
h: Math.max(segH, 1),
|
|
77
|
+
cx: xCursor + colW / 2,
|
|
78
|
+
cy: yCursor + segH / 2,
|
|
79
|
+
pct,
|
|
80
|
+
colPct,
|
|
81
|
+
});
|
|
82
|
+
yCursor += segH;
|
|
83
|
+
}
|
|
84
|
+
xCursor += colW;
|
|
85
|
+
}
|
|
86
|
+
// FIX a11y: SR includes column width share (colPct) in addition to segment %
|
|
87
|
+
const dataValueItems = cells.map((c) => `${c.catLabel}, ${c.segLabel}: ${Math.round(c.pct * 100)}% (colonne ${Math.round(c.colPct * 100)}%)`);
|
|
88
|
+
const svgChildren = [];
|
|
89
|
+
// axis
|
|
90
|
+
svgChildren.push(h("line", {
|
|
91
|
+
class: "st-marimekkoChart__axis",
|
|
92
|
+
x1: MARGIN.left, x2: width - MARGIN.right,
|
|
93
|
+
y1: height - MARGIN.bottom, y2: height - MARGIN.bottom,
|
|
94
|
+
}));
|
|
95
|
+
// cells
|
|
96
|
+
for (const cell of cells) {
|
|
97
|
+
const isDim = hoveredKey.value !== null && hoveredKey.value !== cell.key;
|
|
98
|
+
svgChildren.push(h("rect", {
|
|
99
|
+
key: cell.key,
|
|
100
|
+
class: classNames("st-marimekkoChart__cell", `st-marimekkoChart__cell--${cell.tone}`, isDim ? "st-marimekkoChart__cell--dim" : undefined),
|
|
101
|
+
x: cell.x, y: cell.y, width: cell.w, height: cell.h,
|
|
102
|
+
"data-chart-key": cell.key,
|
|
103
|
+
}));
|
|
104
|
+
if (cell.w > 28 && cell.h > 14) {
|
|
105
|
+
svgChildren.push(h("text", {
|
|
106
|
+
key: `lbl-${cell.key}`,
|
|
107
|
+
class: "st-marimekkoChart__cellLabel",
|
|
108
|
+
x: cell.cx, y: cell.cy,
|
|
109
|
+
"text-anchor": "middle",
|
|
110
|
+
"dominant-baseline": "middle",
|
|
111
|
+
style: `fill:${contrastTextForTone(cell.tone)}`,
|
|
112
|
+
"pointer-events": "none",
|
|
113
|
+
}, `${Math.round(cell.pct * 100)}%`));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// category labels below axis
|
|
117
|
+
let xCursor2 = MARGIN.left;
|
|
118
|
+
for (const datum of data) {
|
|
119
|
+
const safeW = Number.isFinite(datum.width) && datum.width > 0 ? datum.width : 0;
|
|
120
|
+
if (safeW <= 0)
|
|
121
|
+
continue;
|
|
122
|
+
const colW = (safeW / totalWidth) * plotWidth;
|
|
123
|
+
const startX = cells.find((c) => c.catLabel === datum.label)?.x ?? MARGIN.left;
|
|
124
|
+
svgChildren.push(h("text", {
|
|
125
|
+
key: `cat-${datum.label}`,
|
|
126
|
+
class: "st-marimekkoChart__catLabel",
|
|
127
|
+
x: startX + colW / 2,
|
|
128
|
+
y: height - MARGIN.bottom + 16,
|
|
129
|
+
"text-anchor": "middle",
|
|
130
|
+
}, datum.label));
|
|
131
|
+
xCursor2 += colW;
|
|
132
|
+
}
|
|
133
|
+
const hoveredCell = hoveredKey.value !== null ? cells.find((c) => c.key === hoveredKey.value) ?? null : null;
|
|
134
|
+
const children = [
|
|
135
|
+
h("div", {
|
|
136
|
+
class: "st-marimekkoChart__visual",
|
|
137
|
+
role: "img",
|
|
138
|
+
"aria-label": label,
|
|
139
|
+
onPointermove: handlePointerMove,
|
|
140
|
+
onPointerleave: handleLeave,
|
|
141
|
+
}, [
|
|
142
|
+
h("svg", {
|
|
143
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
144
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
145
|
+
width: "100%", height: "100%",
|
|
146
|
+
focusable: "false", "aria-hidden": "true",
|
|
147
|
+
}, svgChildren),
|
|
148
|
+
]),
|
|
149
|
+
chartDataList(label, dataValueItems),
|
|
150
|
+
];
|
|
151
|
+
if (hoveredCell) {
|
|
152
|
+
children.push(h("div", {
|
|
153
|
+
class: "st-marimekkoChart__tooltip",
|
|
154
|
+
role: "presentation",
|
|
155
|
+
style: `left:${(hoveredCell.cx / width) * 100}%;top:${(hoveredCell.cy / height) * 100}%`,
|
|
156
|
+
}, [
|
|
157
|
+
h("span", { class: "st-marimekkoChart__tooltipLabel" }, `${hoveredCell.catLabel} / ${hoveredCell.segLabel}`),
|
|
158
|
+
h("span", { class: "st-marimekkoChart__tooltipValue" }, `${Math.round(hoveredCell.pct * 100)}%`),
|
|
159
|
+
]));
|
|
160
|
+
}
|
|
161
|
+
return h("div", { ...attrs, class: classNames("st-marimekkoChart", props.class) }, children);
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=MarimekkoChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarimekkoChart.js","sourceRoot":"","sources":["../src/MarimekkoChart.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;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAgCzD,MAAM,KAAK,GAAyB;IAClC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW;IAClD,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW;CACnD,CAAC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AAa,CAAC,KAAK,EAAE,cAAc,CAAC;aACrC,CAAC;YAEF,IAAI,WAAW,EAAE,CAAC;gBAChB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;oBACrB,KAAK,EAAE,4BAA4B;oBACnC,IAAI,EAAE,cAAc;oBACpB,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG;iBACzF,EAAE;oBACD,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE,EAAE,GAAG,WAAW,CAAC,QAAQ,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;oBAC5G,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;iBACjG,CAAC,CAAC,CAAC;YACN,CAAC;YAED,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,mBAAmB,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC/F,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export type ParallelCoordinatesChartTone = "category1" | "category2" | "category3" | "category4" | "category5" | "category6" | "category7" | "category8";
|
|
2
|
+
export type ParallelAxis = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
};
|
|
8
|
+
export type ParallelCoordinatesChartProps = {
|
|
9
|
+
axes: ParallelAxis[];
|
|
10
|
+
data: Record<string, unknown>[];
|
|
11
|
+
label: string;
|
|
12
|
+
tones?: ParallelCoordinatesChartTone[];
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
class?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const ParallelCoordinatesChart: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
18
|
+
axes: {
|
|
19
|
+
type: () => ParallelAxis[];
|
|
20
|
+
default: () => never[];
|
|
21
|
+
};
|
|
22
|
+
data: {
|
|
23
|
+
type: () => Record<string, unknown>[];
|
|
24
|
+
default: () => never[];
|
|
25
|
+
};
|
|
26
|
+
label: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
tones: {
|
|
31
|
+
type: () => ParallelCoordinatesChartTone[];
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
width: {
|
|
35
|
+
type: NumberConstructor;
|
|
36
|
+
default: number;
|
|
37
|
+
};
|
|
38
|
+
height: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
class: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: undefined;
|
|
45
|
+
};
|
|
46
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
|
+
axes: {
|
|
50
|
+
type: () => ParallelAxis[];
|
|
51
|
+
default: () => never[];
|
|
52
|
+
};
|
|
53
|
+
data: {
|
|
54
|
+
type: () => Record<string, unknown>[];
|
|
55
|
+
default: () => never[];
|
|
56
|
+
};
|
|
57
|
+
label: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
tones: {
|
|
62
|
+
type: () => ParallelCoordinatesChartTone[];
|
|
63
|
+
default: undefined;
|
|
64
|
+
};
|
|
65
|
+
width: {
|
|
66
|
+
type: NumberConstructor;
|
|
67
|
+
default: number;
|
|
68
|
+
};
|
|
69
|
+
height: {
|
|
70
|
+
type: NumberConstructor;
|
|
71
|
+
default: number;
|
|
72
|
+
};
|
|
73
|
+
class: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: undefined;
|
|
76
|
+
};
|
|
77
|
+
}>> & Readonly<{}>, {
|
|
78
|
+
class: string;
|
|
79
|
+
data: Record<string, unknown>[];
|
|
80
|
+
width: number;
|
|
81
|
+
height: number;
|
|
82
|
+
axes: ParallelAxis[];
|
|
83
|
+
tones: ParallelCoordinatesChartTone[];
|
|
84
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
85
|
+
//# sourceMappingURL=ParallelCoordinatesChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParallelCoordinatesChart.d.ts","sourceRoot":"","sources":["../src/ParallelCoordinatesChart.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,4BAA4B,GACpC,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,CAAC,EAAE,4BAA4B,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAoDF,eAAO,MAAM,wBAAwB;;cAGV,MAAM,YAAY,EAAE;;;;cACpB,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;;;;cAG9B,MAAM,4BAA4B,EAAE;;;;;;;;;;;;;;;;;;;cAJrC,MAAM,YAAY,EAAE;;;;cACpB,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;;;;cAG9B,MAAM,4BAA4B,EAAE;;;;;;;;;;;;;;;;;;;;;;4EA2J9D,CAAC"}
|