1- export default ( componentName ) => {
1+ export default ( componentName ) => {
22 const emitExamples = {
33 VueUiXy : [
44 {
@@ -19,10 +19,10 @@ export default(componentName) => {
1919 console.log({ legend });
2020 }` ,
2121 funcTs : `type VueUiXySelectedLegend = {
22- name: string
23- values: number[]
24- color: string
25- type: 'line' | 'bar' | 'plot'
22+ readonly name: string
23+ readonly values: number[]
24+ readonly color: string
25+ readonly type: 'line' | 'bar' | 'plot'
2626 }
2727 /*
2828 * @selectLegend - Returns the current visible series when selecting / unselecting the legend
@@ -60,13 +60,13 @@ export default(componentName) => {
6060 */
6161 type VueUiXySelectedX = {
6262 dataset: Array<{
63- name: string
64- value: number
65- color: string
66- type: 'line' | 'bar' | 'plot'
63+ readonly name: string
64+ readonly value: number
65+ readonly color: string
66+ readonly type: 'line' | 'bar' | 'plot'
6767 }>
68- index: number
69- indexLabel: string
68+ readonly index: number
69+ readonly indexLabel: string
7070 }
7171 function selectX(selectedX: VueUiXySelectedX) {
7272 console.log({ selectedX });
@@ -105,17 +105,17 @@ export default(componentName) => {
105105 */
106106 type VueUiXySelectedTimeLabel = {
107107 datapoint: Array<{
108- shape: 'circle' | 'triangle' | 'square' | 'dialond ' | 'pentagon' | 'star' | 'hexagon'
109- name: string
110- color: string
111- type: 'line' | 'bar' | 'plot'
112- value: number
113- comments: string[]
114- prefix: string
115- suffix: string
108+ readonly shape: 'circle' | 'triangle' | 'square' | 'diamond ' | 'pentagon' | 'star' | 'hexagon'
109+ readonly name: string
110+ readonly color: string
111+ readonly type: 'line' | 'bar' | 'plot'
112+ readonly value: number
113+ readonly comments: string[]
114+ readonly prefix: string
115+ readonly suffix: string
116116 }>
117- absoluteIndex: number
118- label: string
117+ readonly absoluteIndex: number
118+ readonly label: string
119119 }
120120 function selectTimeLabel(selectedTimeLabel: VueUiXySelectedTimeLabel) {
121121 console.log({ selectedTimeLabel })
@@ -125,31 +125,89 @@ export default(componentName) => {
125125 ] ,
126126 VueUiDonut : [
127127 {
128- name : 'selectLegend ' ,
128+ name : 'selectDatapoint ' ,
129129 func : `/**
130- * @selectLegend - Returns the current visible series when selecting / unselecting the legend
131- *
132- * @typedef {Object} VueUiDonutSelectedLegend
133- * @property {string} name - The name of the legend item.
134- * @property {number} value - The value associated with the legend item.
135- * @property {string} color - The color representing the legend item.
136- *
137- * @param {VueUiDonutSelectedLegend[]} legend - The current visible series when selecting or unselecting the legend.
138- * @returns {void}
139- */
140- function selectLegend(legend){
141- console.log({ legend });
130+ * @selectDatapoint - On click returns the data related to the selected donut arc
131+ *
132+ * @typedef {Object} VueUiDonutDatapoint
133+ * @property {number} index - The index of the datapoint in the dataset.
134+ * @property {number[]} absoluteValues - The array of absolute values associated with the datapoint.
135+ * @property {string} arcSlice - The SVG path describing the arc slice.
136+ * @property {Object} center - The center point of the donut slice.
137+ * @property {number} center.endX - The ending X coordinate of the center.
138+ * @property {number} center.endY - The ending Y coordinate of the center.
139+ * @property {string} center.path - The path associated with the center point.
140+ * @property {number} center.startX - The starting X coordinate of the center.
141+ * @property {number} center.startY - The starting Y coordinate of the center.
142+ * @property {string} color - The color of the datapoint slice.
143+ * @property {string} comment - A comment or note associated with the datapoint.
144+ * @property {number} cx - The X coordinate of the slice center.
145+ * @property {number} cy - The Y coordinate of the slice center.
146+ * @property {number} endX - The ending X coordinate of the arc.
147+ * @property {number} endY - The ending Y coordinate of the arc.
148+ * @property {Object} firstSeparator - The first separator coordinates for the arc.
149+ * @property {number} firstSeparator.x - The X coordinate of the first separator.
150+ * @property {number} firstSeparator.y - The Y coordinate of the first separator.
151+ * @property {string} name - The name of the datapoint.
152+ * @property {string} path - The SVG path of the arc.
153+ * @property {number} proportion - The proportion of the datapoint relative to the total.
154+ * @property {number} ratio - The ratio of the datapoint relative to the total.
155+ * @property {Object} separator - The separator coordinates for the arc.
156+ * @property {number} separator.x - The X coordinate of the separator.
157+ * @property {number} separator.y - The Y coordinate of the separator.
158+ * @property {number} seriesIndex - The index of the series to which the datapoint belongs.
159+ * @property {number} startX - The starting X coordinate of the arc.
160+ * @property {number} startY - The starting Y coordinate of the arc.
161+ * @property {number} value - The value associated with the datapoint.
162+ *
163+ * Logs the data related to the selected donut arc.
164+ *
165+ * @param {VueUiDonutDatapoint} datapoint - The data related to the selected donut arc.
166+ * @returns {void}
167+ */
168+ function selectDatapoint(datapoint) {
169+ console.log(datapoint);
142170 }` ,
143- funcTs : `type VueUiDonutSelectedLegend = {
144- name: string
145- value: number
146- color: string
171+ funcTs : `type VueUiDonutDatapoint = {
172+ readonly index: number
173+ readonly absoluteValues: number[]
174+ readonly arcSlice: string
175+ readonly center: {
176+ endX: number
177+ endY: number
178+ path: string
179+ startX: number
180+ startY: number
181+ }
182+ readonly color: string
183+ readonly comment: string
184+ readonly cx: number
185+ readonly cy: number
186+ readonly endX: number
187+ readonly endY: number
188+ readonly firstSeparator: {
189+ x: number
190+ y: number
191+ }
192+ readonly name: string
193+ readonly path: string
194+ readonly proportion: number
195+ readonly ratio: number
196+ readonly separator: {
197+ x: number
198+ y: number
199+ }
200+ readonly seriesIndex: number
201+ readonly startX: number
202+ readonly startY: number
203+ readonly value: number
147204 }
148- /*
149- * @selectLegend - Returns the current visible series when selecting / unselecting the legend
205+
206+ /**
207+ * @selectDatapoint - On click returns the data related to the selected donut arc
150208 */
151- function selectLegend(legend: VueUiDonutSelectedLegend[] ){
152- console.log({ legend });
209+ function selectDatapoint(datapoint: VueUiDonutDatapoint ){
210+ console.log(datapoint)
153211 }` ,
154212 } ,
155213 ] ,
0 commit comments