vue-data-ui-cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +7 -0
- package/LICENCE +21 -0
- package/README.md +32 -0
- package/boilerplate.js +76 -0
- package/datasets.js +1288 -0
- package/emits.js +159 -0
- package/index.js +594 -0
- package/package.json +35 -0
package/emits.js
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export default(componentName) => {
|
|
2
|
+
const emitExamples = {
|
|
3
|
+
VueUiXy: [
|
|
4
|
+
{
|
|
5
|
+
name: 'selectLegend',
|
|
6
|
+
func: `/**
|
|
7
|
+
* @selectLegend - Returns the current visible series when selecting / unselecting the legend
|
|
8
|
+
*
|
|
9
|
+
* @typedef {Object} VueUiXySelectedLegend
|
|
10
|
+
* @property {string} name - The name of the legend item.
|
|
11
|
+
* @property {number[]} values - The array of values associated with the legend item.
|
|
12
|
+
* @property {string} color - The color representing the legend item.
|
|
13
|
+
* @property {"line" | "bar" | "plot"} type - The type of the series.
|
|
14
|
+
*
|
|
15
|
+
* @param {VueUiXySelectedLegend[]} legend - The current visible series when selecting or unselecting the legend.
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
function selectLegend(legend){
|
|
19
|
+
console.log({ legend });
|
|
20
|
+
}`,
|
|
21
|
+
funcTs: `type VueUiXySelectedLegend = {
|
|
22
|
+
name: string
|
|
23
|
+
values: number[]
|
|
24
|
+
color: string
|
|
25
|
+
type: 'line' | 'bar' | 'plot'
|
|
26
|
+
}
|
|
27
|
+
/*
|
|
28
|
+
* @selectLegend - Returns the current visible series when selecting / unselecting the legend
|
|
29
|
+
*/
|
|
30
|
+
function selectLegend(legend: VueUiXySelectedLegend[]){
|
|
31
|
+
console.log({ legend });
|
|
32
|
+
}`,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'selectX',
|
|
36
|
+
func: `/**
|
|
37
|
+
* @selectX - Returns the selected X-axis data
|
|
38
|
+
*
|
|
39
|
+
* @typedef {Object} DatasetItem
|
|
40
|
+
* @property {string} name - The name of the dataset item.
|
|
41
|
+
* @property {number} value - The value associated with the dataset item.
|
|
42
|
+
* @property {string} color - The color representing the dataset item.
|
|
43
|
+
* @property {"line" | "bar" | "plot"} type - The type of the dataset item.
|
|
44
|
+
*
|
|
45
|
+
* @typedef {Object} VueUiXySelectedX
|
|
46
|
+
* @property {DatasetItem[]} dataset - An array of dataset items representing the selected X-axis data.
|
|
47
|
+
* @property {number} index - The index of the selected item.
|
|
48
|
+
* @property {string} indexLabel - The label of the selected index.
|
|
49
|
+
*
|
|
50
|
+
* Logs the selected X-axis data.
|
|
51
|
+
*
|
|
52
|
+
* @param {VueUiXySelectedX} selectedX - The data representing the selected X-axis.
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
55
|
+
function selectX(selectedX) {
|
|
56
|
+
console.log({ selectedX });
|
|
57
|
+
}`,
|
|
58
|
+
funcTs: `/*
|
|
59
|
+
* @selectX - Returns the selected X-axis data
|
|
60
|
+
*/
|
|
61
|
+
type VueUiXySelectedX = {
|
|
62
|
+
dataset: Array<{
|
|
63
|
+
name: string
|
|
64
|
+
value: number
|
|
65
|
+
color: string
|
|
66
|
+
type: 'line' | 'bar' | 'plot'
|
|
67
|
+
}>
|
|
68
|
+
index: number
|
|
69
|
+
indexLabel: string
|
|
70
|
+
}
|
|
71
|
+
function selectX(selectedX: VueUiXySelectedX) {
|
|
72
|
+
console.log({ selectedX });
|
|
73
|
+
}`,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'selectTimeLabel',
|
|
77
|
+
func: `/**
|
|
78
|
+
* @selectTimeLabel - Returns the data associated with the selected time label
|
|
79
|
+
*
|
|
80
|
+
* @typedef {Object} DatapointItem
|
|
81
|
+
* @property {"circle" | "triangle" | "square" | "diamond" | "pentagon" | "star" | "hexagon"} shape - The shape representing the datapoint.
|
|
82
|
+
* @property {string} name - The name of the datapoint.
|
|
83
|
+
* @property {string} color - The color associated with the datapoint.
|
|
84
|
+
* @property {"line" | "bar" | "plot"} type - The type of the datapoint.
|
|
85
|
+
* @property {number} value - The value of the datapoint.
|
|
86
|
+
* @property {string[]} comments - Additional comments associated with the datapoint.
|
|
87
|
+
* @property {string} prefix - A prefix to be displayed with the value.
|
|
88
|
+
* @property {string} suffix - A suffix to be displayed with the value.
|
|
89
|
+
*
|
|
90
|
+
* @typedef {Object} VueUiXySelectedTimeLabel
|
|
91
|
+
* @property {DatapointItem[]} datapoint - An array of datapoints representing the selected time label.
|
|
92
|
+
* @property {number} absoluteIndex - The absolute index of the selected time label.
|
|
93
|
+
* @property {string} label - The label of the selected time.
|
|
94
|
+
*
|
|
95
|
+
* Logs the data associated with the selected time label.
|
|
96
|
+
*
|
|
97
|
+
* @param {VueUiXySelectedTimeLabel} selectedTimeLabel - The data associated with the selected time label.
|
|
98
|
+
* @returns {void}
|
|
99
|
+
*/
|
|
100
|
+
function selectTimeLabel(selectedTimeLabel) {
|
|
101
|
+
console.log({ selectedTimeLabel });
|
|
102
|
+
}`,
|
|
103
|
+
funcTs: `/*
|
|
104
|
+
* @selectTimeLabel - Returns the data associated with the selected time label
|
|
105
|
+
*/
|
|
106
|
+
type VueUiXySelectedTimeLabel = {
|
|
107
|
+
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
|
|
116
|
+
}>
|
|
117
|
+
absoluteIndex: number
|
|
118
|
+
label: string
|
|
119
|
+
}
|
|
120
|
+
function selectTimeLabel(selectedTimeLabel: VueUiXySelectedTimeLabel) {
|
|
121
|
+
console.log({ selectedTimeLabel })
|
|
122
|
+
}
|
|
123
|
+
`
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
VueUiDonut: [
|
|
127
|
+
{
|
|
128
|
+
name: 'selectLegend',
|
|
129
|
+
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 });
|
|
142
|
+
}`,
|
|
143
|
+
funcTs: `type VueUiDonutSelectedLegend = {
|
|
144
|
+
name: string
|
|
145
|
+
value: number
|
|
146
|
+
color: string
|
|
147
|
+
}
|
|
148
|
+
/*
|
|
149
|
+
* @selectLegend - Returns the current visible series when selecting / unselecting the legend
|
|
150
|
+
*/
|
|
151
|
+
function selectLegend(legend: VueUiDonutSelectedLegend[]){
|
|
152
|
+
console.log({ legend });
|
|
153
|
+
}`,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return emitExamples[componentName]
|
|
159
|
+
}
|