@markbattistella/docsify-charty 2.0.1 → 3.0.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/CHANGELOG.md +7 -0
- package/README.md +71 -81
- package/dist/docsify-charty.css +5 -10
- package/dist/docsify-charty.js +2 -5
- package/dist/docsify-charty.min.css +5 -6
- package/dist/docsify-charty.min.js +2 -6
- package/package.json +45 -41
- package/.gitattributes +0 -2
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,68 +1,64 @@
|
|
|
1
|
-
<div align="center">
|
|
1
|
+
<div align="center" class="gh">
|
|
2
2
|
|
|
3
|
-
# docsify
|
|
3
|
+
# docsify.js charty
|
|
4
4
|
|
|
5
|
-
<small style="margin-bottom:2em;">by Mark Battistella</small>
|
|
6
|
-
|
|
7
|
-
[](https://www.paypal.me/markbattistella/6AUD)
|
|
8
|
-
[](https://www.buymeacoffee.com/markbattistella)
|
|
9
5
|
</div>
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
This plugin enhances your Docsify documentation by adding SVG charts to your website. It allows you to add in multiple types of charts, including pie, doughnut, sectional, radar, area, scatter, line, and bar types. By utilising this plugin, you can easily show your data in a beautiful interface.
|
|
12
8
|
|
|
13
9
|
## Installation
|
|
14
10
|
|
|
15
11
|
### Update `index.html` file
|
|
16
12
|
|
|
13
|
+
Assuming you have a working [docsify](https://docsify.js.org/) framework set up, it is easy to use the plugin.
|
|
14
|
+
|
|
17
15
|
1. Add the following script and stylesheet to your `index.html` via either CDN or downloading it and using it locally:
|
|
18
16
|
|
|
19
|
-
**unpkg.com**
|
|
20
17
|
```html
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
**locally**
|
|
32
|
-
```html
|
|
18
|
+
<!-- unpkg.com -->
|
|
19
|
+
<script src="https://unpkg.com/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.js"></script>
|
|
20
|
+
<link rel="stylesheet" href="https://unpkg.com/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.css">
|
|
21
|
+
|
|
22
|
+
<!-- jsDelivr -->
|
|
23
|
+
<script src="https://cdn.jsdelivr.net/npm/@markbattistella/docsify-charty@latest"></script>
|
|
24
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.css">
|
|
25
|
+
|
|
26
|
+
<!-- locally -->
|
|
33
27
|
<script src="docsify-charty.min.js"></script>
|
|
34
28
|
<link rel="stylesheet" href="docsify-charty.min.css">
|
|
35
29
|
```
|
|
36
30
|
|
|
37
|
-
1. In docsify setup configure the plugin
|
|
31
|
+
1. In docsify setup, configure the plugin:
|
|
38
32
|
|
|
39
33
|
```js
|
|
34
|
+
<script>
|
|
40
35
|
window.$docsify = {
|
|
41
36
|
charty: {
|
|
42
|
-
"theme": String,
|
|
43
|
-
"mode": String,
|
|
44
|
-
"debug": Boolean
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
```
|
|
48
37
|
|
|
49
|
-
|
|
38
|
+
// Global theme for chart colours in HEX
|
|
39
|
+
theme: '.',
|
|
50
40
|
|
|
51
|
-
|
|
41
|
+
// Accepts "dark" or "light"
|
|
42
|
+
mode: "light",
|
|
52
43
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
// Boolean to enable or disable debug messages
|
|
45
|
+
debug: false
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
56
50
|
|
|
57
51
|
## Configuration
|
|
58
52
|
|
|
59
|
-
|
|
53
|
+
There are several options available for the docsify-charty plugin:
|
|
54
|
+
|
|
55
|
+
> Example: [index.html](https://github.com/markbattistella/docsify-charty/blob/b792e7701e740587f48598c7b61bc7f7ea39c366/docs/index.html#L36-L40)
|
|
60
56
|
|
|
61
|
-
| Name |
|
|
62
|
-
|
|
63
|
-
| `theme` | `String` |
|
|
64
|
-
| `mode` | `String` |
|
|
65
|
-
| `debug` | `Boolean` |
|
|
57
|
+
| Name | Type | Example | Description |
|
|
58
|
+
|---------|-----------|-----------|-------------------------------------------|
|
|
59
|
+
| `theme` | `String` | "#EE5599" | Global theme for chart colours in HEX |
|
|
60
|
+
| `mode` | `String` | "light" | Accepts "dark" or "light" |
|
|
61
|
+
| `debug` | `Boolean` | false | Console logs if charts aren't loading |
|
|
66
62
|
|
|
67
63
|
### Per chart settings
|
|
68
64
|
|
|
@@ -81,104 +77,98 @@ npm i @markbattistella/docsify-charty
|
|
|
81
77
|
|
|
82
78
|
### Markdown code
|
|
83
79
|
|
|
84
|
-
```
|
|
80
|
+
```js
|
|
81
|
+
```charty
|
|
85
82
|
{
|
|
86
83
|
"title": '',
|
|
87
84
|
"caption": '',
|
|
88
85
|
"type": '',
|
|
89
86
|
"options": {
|
|
90
87
|
"theme": '',
|
|
91
|
-
|
|
88
|
+
"legend": '',
|
|
92
89
|
"labels": '',
|
|
93
90
|
"numbers": ''
|
|
94
91
|
},
|
|
95
92
|
"data": [
|
|
96
93
|
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
"label": '',
|
|
95
|
+
"value": '',
|
|
96
|
+
"colour": ''
|
|
100
97
|
}
|
|
101
98
|
]
|
|
102
99
|
}
|
|
100
|
+
\`\`\`
|
|
103
101
|
```
|
|
104
102
|
|
|
105
103
|
## Types of charts
|
|
106
104
|
|
|
107
105
|
### Circular
|
|
108
106
|
|
|
109
|
-
####
|
|
107
|
+
#### Pie chart
|
|
110
108
|
|
|
111
|
-

|
|
109
|
+

|
|
112
110
|
|
|
113
|
-
####
|
|
111
|
+
#### Donut / Doughnut chart
|
|
114
112
|
|
|
115
|
-

|
|
113
|
+

|
|
116
114
|
|
|
117
|
-
####
|
|
115
|
+
#### Section / Sectional chart
|
|
118
116
|
|
|
119
|
-

|
|
117
|
+

|
|
120
118
|
|
|
121
|
-
####
|
|
119
|
+
#### Rings chart
|
|
122
120
|
|
|
123
|
-

|
|
121
|
+

|
|
124
122
|
|
|
125
123
|
### Area
|
|
126
124
|
|
|
127
|
-
####
|
|
125
|
+
#### Radar chart
|
|
128
126
|
|
|
129
|
-

|
|
127
|
+

|
|
130
128
|
|
|
131
|
-
####
|
|
129
|
+
#### Area chart
|
|
132
130
|
|
|
133
|
-

|
|
131
|
+

|
|
134
132
|
|
|
135
133
|
### Plot
|
|
136
134
|
|
|
137
|
-
####
|
|
135
|
+
#### Scatter chart
|
|
138
136
|
|
|
139
|
-

|
|
137
|
+

|
|
140
138
|
|
|
141
|
-
####
|
|
139
|
+
#### Bubble chart
|
|
142
140
|
|
|
143
|
-

|
|
141
|
+

|
|
144
142
|
|
|
145
|
-
####
|
|
143
|
+
#### Line chart
|
|
146
144
|
|
|
147
|
-
<br>
|
|
148
|
-

|
|
145
|
+
<br>
|
|
146
|
+

|
|
149
147
|
|
|
150
148
|
### Bar / Column
|
|
151
149
|
|
|
152
|
-
###
|
|
150
|
+
### Bar / Bar-stack chart
|
|
153
151
|
|
|
154
|
-
<br>
|
|
155
|
-

|
|
152
|
+
<br>
|
|
153
|
+

|
|
156
154
|
|
|
157
|
-
###
|
|
155
|
+
### Column / Column-stack chart
|
|
158
156
|
|
|
159
|
-
<br>
|
|
160
|
-

|
|
157
|
+
<br>
|
|
158
|
+

|
|
161
159
|
|
|
162
160
|
### Rating
|
|
163
161
|
|
|
164
|
-

|
|
162
|
+

|
|
165
163
|
|
|
166
164
|
## Contributing
|
|
167
165
|
|
|
168
|
-
1. Clone the repo:
|
|
169
|
-
|
|
170
|
-
`git clone https://github.com/markbattistella/docsify-charty.git`
|
|
171
|
-
|
|
172
|
-
1. Create your feature branch:
|
|
173
|
-
|
|
174
|
-
`git checkout -b my-feature`
|
|
175
|
-
|
|
176
|
-
1. Commit your changes:
|
|
166
|
+
1. Clone the repo: `git clone https://github.com/markbattistella/docsify-charty.git`
|
|
177
167
|
|
|
178
|
-
|
|
168
|
+
1. Create your feature branch: `git checkout -b my-feature`
|
|
179
169
|
|
|
180
|
-
1. `
|
|
170
|
+
1. Commit your changes: `git commit -am 'Add some feature'`
|
|
181
171
|
|
|
182
|
-
|
|
172
|
+
1. `Push` to the branch: `git push origin my-new-feature`
|
|
183
173
|
|
|
184
174
|
1. Submit the `pull` request
|
package/dist/docsify-charty.css
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* docsify-charty.css v2.0.1 (https://markbattistella.github.io/docsify-charty/)
|
|
3
|
-
* Copyright (c) 2021 Mark Battistella (@markbattistella)
|
|
4
|
-
* Licensed under MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/*! docsify-charty 3.0.0 | (c) Mark Battistella */
|
|
8
2
|
|
|
9
3
|
/*
|
|
10
4
|
* core
|
|
@@ -35,9 +29,6 @@
|
|
|
35
29
|
font-size: calc( var(--charty-size-baseline) * 1px );
|
|
36
30
|
line-height: calc( var(--charty-size-baseline) * 1px * 1.5 );
|
|
37
31
|
color: var(--charty-colour-text);
|
|
38
|
-
|
|
39
|
-
/* printing colour */
|
|
40
|
-
color-adjust: exact;
|
|
41
32
|
}
|
|
42
33
|
|
|
43
34
|
/* mode: dark */
|
|
@@ -289,6 +280,10 @@
|
|
|
289
280
|
transform: scale(0.5) translate(50%, 50%);
|
|
290
281
|
}
|
|
291
282
|
|
|
283
|
+
.docsify-charty .dataset.radar svg * {
|
|
284
|
+
transform-origin: 0 0;
|
|
285
|
+
}
|
|
286
|
+
|
|
292
287
|
.docsify-charty .dataset.radar .data-header circle:nth-child( even ) {
|
|
293
288
|
opacity: 0.3;
|
|
294
289
|
}
|
package/dist/docsify-charty.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* docsify-charty.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
.docsify-charty{--charty-colour-focus:#FDCB6E;--charty-colour-dark:#333;--charty-colour-light:#CCC;--charty-colour-medium:#888;--charty-size-title:0;--charty-size-baseline:16;--charty-size-hole:50;--charty-size-radius:0.3;position:relative;display:block;margin:0 auto;padding:0;border:0;width:100%;font-size:calc(var(--charty-size-baseline) * 1px);line-height:calc(var(--charty-size-baseline) * 1px * 1.5);color:var(--charty-colour-text);color-adjust:exact}.docsify-charty.dark{--charty-colour-focus:#023491;--charty-colour-dark:#CCC;--charty-colour-light:#333;--charty-colour-medium:#777}.docsify-charty,.docsify-charty *,.docsify-charty :after,.docsify-charty :before,.docsify-charty:after,.docsify-charty:before{box-sizing:border-box;vertical-align:middle}.docsify-charty .container{display:flex;flex-direction:row;margin-bottom:4em!important}.docsify-charty .container>*{align-self:center}.docsify-charty .dataset{max-width:25em;width:100%}.docsify-charty .dataset svg{overflow:visible;max-width:25em;max-height:25em}.docsify-charty .dataset svg *{transform-origin:center center}.docsify-charty .dataset line,.docsify-charty .dataset polyline,.docsify-charty .dataset.radar .data-header circle{fill:none;stroke:var(--charty-colour-light)}.docsify-charty text{transition:all .6s;alignment-baseline:middle;text-anchor:middle;font-size:15%;fill:var(--charty-colour-light)}.docsify-charty .data-header text{fill:var(--charty-colour-medium)}.docsify-charty .data-item text{opacity:0}.docsify-charty .dataset.radar text{font-size:35%}.docsify-charty .focus:after{content:'';position:absolute;z-index:-1;background:var(--charty-colour-focus);border-radius:calc(var(--charty-size-radius) * 1em);opacity:.5;top:0;bottom:0;left:0;right:0}.docsify-charty header{margin-bottom:1.3em}.docsify-charty h3{--charty-size-title:1.35;font-size:calc(var(--charty-size-title) * 1em);font-weight:700;text-align:left}.docsify-charty figcaption{font-size:.9em;color:var(--charty-colour-medium)}.docsify-charty.legend fieldset{order:2;margin-left:auto;border-width:5px 0 0 0;border-color:var(--charty-colour-light);border-style:solid;font-size:.9em;max-width:30%;width:100%}.docsify-charty.legend fieldset legend{font-size:1em;font-family:sans-serif;font-weight:700;padding:0 1em;margin:0 0 .5em -1em}.docsify-charty.legend fieldset label{display:block;text-indent:-2em;margin:.25em 0 0 2em;line-height:1.5em;border-radius:3px;padding:2px 5px}.docsify-charty.legend fieldset label span{height:1em;width:1em;margin-right:1em;border-radius:.2em;display:inline-block}.docsify-charty.legend fieldset label:hover{background:var(--charty-colour-light)}.docsify-charty.legend .dataset .data-item{opacity:.85;transition:opacity .3s}.docsify-charty.legend.hover .dataset .data-item{opacity:.1}.docsify-charty .data-item:hover text,.docsify-charty .data-text text.focus,.docsify-charty .data-text text:hover,.docsify-charty .dataset .data-item.active .data-text text,.docsify-charty .dataset.bar .data-item:hover:after,.docsify-charty header:hover~.container .data-item:after,.docsify-charty header:hover~.container .data-text text,.docsify-charty.legend.hover .dataset .data-item.active{opacity:1}.docsify-charty.axes .dataset{padding:0;margin:0;border-width:0 0 3px 3px;border-style:solid;border-color:var(--charty-colour-dark,#333);position:relative}.docsify-charty.axes .dataset[axes-horizontal]{margin-bottom:2em}.docsify-charty.axes .dataset[axes-vertical]{margin-left:3.5em}.docsify-charty.axes .dataset:after,.docsify-charty.axes .dataset:before{content:'';position:absolute;z-index:-1;left:0;width:100%;font-size:.7em;font-weight:700;text-align:center;letter-spacing:1px;color:var(--charty-colour-dark,#333)}.docsify-charty.axes .dataset:before{content:attr(axes-horizontal);bottom:-5.5em}.docsify-charty.axes .dataset:after{content:attr(axes-vertical);transform-origin:top right;left:calc(-100% - 5.5em);transform:rotate(-90deg)}.docsify-charty .dataset.radar svg{transform:scale(.5) translate(50%,50%)}.docsify-charty .dataset.radar .data-header circle:nth-child(even){opacity:.3}.docsify-charty .dataset.radar .data-container,.docsify-charty .dataset.radar .data-header .data-text,.docsify-charty .dataset.radar .data-header line{transform-origin:top left}.docsify-charty .dataset.radar svg .data-header line{transform:rotate(calc(var(--angle) * 1deg))}.docsify-charty .dataset.radar .data-header text{font-weight:700;transform:rotate(calc(var(--angle) * 1deg))}.docsify-charty .dataset.donut .data-item,.docsify-charty .dataset.pie .data-item,.docsify-charty .dataset.ring .data-item,.docsify-charty .dataset.section .data-item{transform:rotate(-90deg)}.docsify-charty .dataset.donut #donut-hole circle{fill:#000}.docsify-charty .dataset.ring .data-item circle.ring-bg{fill:none;stroke:var(--charty-colour-light)}.docsify-charty .dataset.column .data-container,.docsify-charty .dataset.column-stack .data-container{transform:rotate(90deg)}.docsify-charty .dataset.rating{max-width:none}.docsify-charty .dataset.rating small{display:block;text-align:right}.docsify-charty .dataset.rating .data-item{display:flex;font-weight:700;color:#fff;text-align:center;line-height:2.75;margin-top:1px;overflow:hidden}.docsify-charty .dataset.rating .data-item:nth-of-type(1){border-radius:2px 2px 0 0}.docsify-charty .dataset.rating .data-item:nth-last-of-type(1){border-radius:0 0 2px 2px}.docsify-charty .dataset.rating .data-item>div{margin-right:1px;width:100%}.docsify-charty .dataset.rating .data-item .rating-label{max-width:10em;background:var(--charty-colour-dark)}.docsify-charty .dataset.rating .data-item .rating-value{max-width:4em;background:var(--charty-colour-medium)}.docsify-charty .dataset.rating .rating-bar-container{background:var(--charty-colour-light)}.docsify-charty .dataset.rating .rating-bar-colour{width:0%;height:100%;background:var(--charty-colour-light)}@media(max-width:800px){.docsify-charty .container{flex-direction:column}.docsify-charty .container>*{align-self:flex-start}.docsify-charty.legend fieldset{margin:2em 0;max-width:25em}}@media(max-width:480px){.docsify-charty.axes .dataset[axes-vertical]{margin-left:1em}}
|
|
1
|
+
/*! docsify-charty 3.0.0 | (c) Mark Battistella */
|
|
2
|
+
.docsify-charty{--charty-colour-focus:#FDCB6E;--charty-colour-dark:#333;--charty-colour-light:#CCC;--charty-colour-medium:#888;--charty-size-title:0;--charty-size-baseline:16;--charty-size-hole:50;--charty-size-radius:.3;position:relative;display:block;margin:0 auto;padding:0;border:0;width:100%;font-size:calc(var(--charty-size-baseline) * 1px);line-height:calc(var(--charty-size-baseline) * 1px * 1.5);color:var(--charty-colour-text);color-adjust:exact}.docsify-charty.dark{--charty-colour-focus:#023491;--charty-colour-dark:#CCC;--charty-colour-light:#333;--charty-colour-medium:#777}.docsify-charty,.docsify-charty:before,.docsify-charty:after,.docsify-charty *,.docsify-charty :before,.docsify-charty :after{box-sizing:border-box;vertical-align:middle}.docsify-charty .container{display:flex;flex-direction:row;margin-bottom:4em!important}.docsify-charty .container > *{align-self:center}.docsify-charty .dataset{max-width:25em;width:100%}.docsify-charty .dataset svg{overflow:visible;max-width:25em;max-height:25em}.docsify-charty .dataset svg *{transform-origin:center center}.docsify-charty .dataset polyline,.docsify-charty .dataset line,.docsify-charty .dataset.radar .data-header circle{fill:none;stroke:var(--charty-colour-light)}.docsify-charty text{transition:all 600ms;alignment-baseline:middle;text-anchor:middle;font-size:15%;fill:var(--charty-colour-light)}.docsify-charty .data-header text{fill:var(--charty-colour-medium)}.docsify-charty .data-item text{opacity:0}.docsify-charty .dataset.radar text{font-size:35%}.docsify-charty .focus:after{content:'';position:absolute;z-index:-1;background:var(--charty-colour-focus);border-radius:calc(var(--charty-size-radius) * 1em);opacity:.5;top:0;bottom:0;left:0;right:0}.docsify-charty header{margin-bottom:1.3em}.docsify-charty h3{--charty-size-title:1.35;font-size:calc(var(--charty-size-title) * 1em);font-weight:700;text-align:left}.docsify-charty figcaption{font-size:.9em;color:var(--charty-colour-medium)}.docsify-charty.legend fieldset{order:2;margin-left:auto;border-width:5px 0 0;border-color:var(--charty-colour-light);border-style:solid;font-size:.9em;max-width:30%;width:100%}.docsify-charty.legend fieldset legend{font-size:1em;font-family:sans-serif;font-weight:700;padding:0 1em;margin:0 0 .5em -1em}.docsify-charty.legend fieldset label{display:block;text-indent:-2em;margin:.25em 0 0 2em;line-height:1.5em;border-radius:3px;padding:2px 5px}.docsify-charty.legend fieldset label span{height:1em;width:1em;margin-right:1em;border-radius:.2em;display:inline-block}.docsify-charty.legend fieldset label:hover{background:var(--charty-colour-light)}.docsify-charty.legend .dataset .data-item{opacity:.85;transition:opacity 300ms}.docsify-charty.legend.hover .dataset .data-item{opacity:.1}.docsify-charty header:hover ~ .container .data-text text,.docsify-charty header:hover ~ .container .data-item:after,/* hover: label */
|
|
3
|
+
.docsify-charty .dataset .data-item.active .data-text text,.docsify-charty.legend.hover .dataset .data-item.active,/* hover: data-item */
|
|
4
|
+
.docsify-charty .data-item:hover text,/* hover: data-text */
|
|
5
|
+
.docsify-charty .data-text text:hover,.docsify-charty .data-text text.focus,.docsify-charty .dataset.bar .data-item:hover:after{opacity:1}.docsify-charty.axes .dataset{padding:0;margin:0;border-width:0 0 3px 3px;border-style:solid;border-color:var(--charty-colour-dark,#333);position:relative}.docsify-charty.axes .dataset[axes-horizontal]{margin-bottom:2em}.docsify-charty.axes .dataset[axes-vertical]{margin-left:3.5em}.docsify-charty.axes .dataset:before,.docsify-charty.axes .dataset:after{content:'';position:absolute;z-index:-1;left:0;width:100%;font-size:.7em;font-weight:700;text-align:center;letter-spacing:1px;color:var(--charty-colour-dark,#333)}.docsify-charty.axes .dataset:before{content:attr(axes-horizontal);bottom:-5.5em}.docsify-charty.axes .dataset:after{content:attr(axes-vertical);transform-origin:top right;left:calc(-100% - 5.5em);transform:rotate(-90deg)}.docsify-charty .dataset.radar svg{transform:scale(0.5) translate(50%,50%)}.docsify-charty .dataset.radar svg *{transform-origin:0 0}.docsify-charty .dataset.radar .data-header circle:nth-child( even ){opacity:.3}.docsify-charty .dataset.radar .data-container,.docsify-charty .dataset.radar .data-header line,.docsify-charty .dataset.radar .data-header .data-text{transform-origin:top left}.docsify-charty .dataset.radar svg .data-header line{transform:rotate(calc(var(--angle) * 1deg))}.docsify-charty .dataset.radar .data-header text{font-weight:700;transform:rotate(calc(var(--angle) * 1deg))}.docsify-charty .dataset.pie .data-item,.docsify-charty .dataset.donut .data-item,.docsify-charty .dataset.section .data-item,.docsify-charty .dataset.ring .data-item{transform:rotate(-90deg)}.docsify-charty .dataset.donut #donut-hole circle{fill:#000;r:calc(var(--charty-size-hole,50) * 1% / 2)}.docsify-charty .dataset.ring .data-item circle.ring-bg{fill:none;stroke:var(--charty-colour-light)}.docsify-charty .dataset.column .data-container,.docsify-charty .dataset.column-stack .data-container{transform:rotate(90deg)}.docsify-charty .dataset.rating{max-width:none}.docsify-charty .dataset.rating small{display:block;text-align:right}.docsify-charty .dataset.rating .data-item{display:flex;font-weight:700;color:#FFF;text-align:center;line-height:2.75;margin-top:1px;overflow:hidden}.docsify-charty .dataset.rating .data-item:nth-of-type(1){border-radius:2px 2px 0 0}.docsify-charty .dataset.rating .data-item:nth-last-of-type(1){border-radius:0 0 2px 2px}.docsify-charty .dataset.rating .data-item > div{margin-right:1px;width:100%}.docsify-charty .dataset.rating .data-item .rating-label{max-width:10em;background:var(--charty-colour-dark)}.docsify-charty .dataset.rating .data-item .rating-value{max-width:4em;background:var(--charty-colour-medium)}.docsify-charty .dataset.rating .rating-bar-container{background:var(--charty-colour-light)}.docsify-charty .dataset.rating .rating-bar-colour{width:0;height:100%;background:var(--charty-colour-light)}@media( max-width: 800px ){.docsify-charty .container{flex-direction:column}.docsify-charty .container > *{align-self:flex-start}.docsify-charty.legend fieldset{margin:2em 0;max-width:25em}}@media( max-width: 480px ){.docsify-charty.axes .dataset[axes-vertical]{margin-left:1em}}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* docsify-charty.js v2.0.1 (https://markbattistella.github.io/docsify-charty/)
|
|
3
|
-
* Copyright (c) 2021 Mark Battistella (@markbattistella)
|
|
4
|
-
* Licensed under MIT
|
|
5
|
-
*/
|
|
6
|
-
"use strict";function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var a=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=a){var n,r,c=[],o=!0,l=!1;try{for(a=a.call(t);!(o=(n=a.next()).done)&&(c.push(n.value),!e||c.length!==e);o=!0);}catch(t){l=!0,r=t}finally{try{o||null==a.return||a.return()}finally{if(l)throw r}}return c}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function ownKeys(e,t){var a,n=Object.keys(e);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(e),t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach(function(t){_defineProperty(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function _defineProperty(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(a="Object"===a&&t.constructor?t.constructor.name:a)||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}function getChartyOptions(t){return[""!=t.theme?t.theme:"#0984E3",""!=t.mode?t.mode:"light",!0===t.debug]}var chartyOptions={theme:"",mode:"light",debug:0};function charty(t,e){var a=getChartyOptions(chartyOptions),tt=a[0],et=a[1],at=a[2],nt=["radar","area","donut","doughnut","pie","section","sectional","rings","line","plot","scatter","bubble","rating","review","bar","column","bar-stack","bar-stacked","column-stack","column-stacked"];function rt(t){var e=360*Math.PI/180;return[50+50*Math.cos(e*t),50+50*Math.sin(e*t)]}console.log(at),t.afterEach(function(t,e){var a=document.createElement("div");a.innerHTML=t,a.querySelectorAll("pre[data-lang=charty]").forEach(function(t){var e=document.createElement("figure");if(e.textContent=t.textContent,function(t){try{JSON.parse(t)}catch(t){return void console.log(t)}return 1}(e.innerHTML)){var a,n,r,p="http://www.w3.org/2000/svg",c=JSON.parse(e.innerHTML.replace(/"color":/g,'"colour":')),b=c.type&&nt.includes(c.type)?"doughnut"===c.type?"donut":"sectional"===c.type?"section":"rings"===c.type?"ring":"scatter"===c.type?"plot":"review"===c.type?"rating":c.type.endsWith("-stacked")?c.type.replace("-stacked","-stack"):c.type:null,o=c.options,l=tt&&o.theme?o.theme:tt,m=!!o.legend,s=!!o.labels,g=!!o.numbers,f=Array.isArray(c.data)?c.data:[c.data],i=(r=(n=f).map(function(t){return t.value}),"number"==typeof n[0].value?[r]:r).reduce(function(t,e){var a,n=t.pop();try{!Array.isArray(e)&&!e.length||e.some(isNaN)||(a={min:Math.min.apply(Math,_toConsumableArray(e)),max:Math.max.apply(Math,_toConsumableArray(e)),sum:_toConsumableArray(e).reduce(function(t,e){return t+e}),avg:_toConsumableArray(e).reduce(function(t,e){return t+e})/_toConsumableArray(e).length},t.push(a),a.max>n.largest&&(n.largest=a.max))}catch(t){return at?console.log(t):null}return t.push(n),t},[{largest:-1/0}]),S=(a=i[i.length-1],i.slice(0,-1).map(function(t){return _objectSpread(_objectSpread({},t),a)})),A=f.map(function(t,e){if(t.colour)return t.colour;var a=function(t,e){var a=1<arguments.length&&void 0!==e?e:1;if(3===(t=t.replace(/#/g,"")).length&&(t=t.split("").map(function(t){return t+t}).join("")),!(l=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})[\da-z]{0,0}$/i.exec(t)))return null;var n,r=parseInt(l[1],16)/255,c=parseInt(l[2],16)/255,o=parseInt(l[3],16)/255,e=Math.max(r,c,o),t=Math.min(r,c,o),l=(e+t)/2;if(e==t)n=s=0;else{var i=e-t,s=.5<l?i/(2-e-t):i/(e+t);switch(e){case r:n=(c-o)/i+(c<o?6:0);break;case c:n=(o-r)/i+2;break;case o:n=(r-c)/i+4}n/=6}return s=Math.round(100*s),{h:n=Math.round(360*n),s:s,l:l=1!=a&&a<101&&0<a?Math.round(98/a):Math.round(100*l)}}(l,f.length),t=1===f.length?50:0;return"hsl( ".concat(a.h,", ").concat(a.s,"%, ").concat(a.l*e+t,"% )")});e.classList.add("docsify-charty"),e.classList.add("".concat(et)),s&&["area","plot","bubble","line","bar","column","bar-stack","column-stack"].includes(b)&&e.classList.add("axes");var u=document.createElementNS(p,"svg"),d=document.createElementNS(p,"defs"),v=document.createElementNS(p,"g"),h=document.createElement("div"),y=document.createElement("div"),N=document.createElement("fieldset"),E=document.createElement("title"),o=document.createElement("desc");switch(u.setAttributeNS("charty","viewBox","0 0 100 100"),u.setAttributeNS("charty","preserveAspectRatio","xMidYMid meet"),d.innerHTML='<filter x="-0.25" y="-0.25" width="1.5" height="1.5" id="text-bg"><feFlood flood-color="var(--charty-colour-dark)"/><feComposite in="SourceGraphic" operator="over"/></filter>',h.setAttributeNS("charty","class","container"),y.setAttributeNS("charty","class","dataset ".concat(b)),v.setAttributeNS("charty","class","data-container"),E.innerHTML=c.title,o.innerHTML=c.caption,u.appendChild(E),u.appendChild(o),g&&u.appendChild(d),u.appendChild(v),["rating"].includes(b)||y.appendChild(u),h.appendChild(y),m&&!["rating"].includes(b)&&(e.classList.add("legend"),h.appendChild(N),N.innerHTML="<legend>Legend</legend>"),b){case"radar":var x=document.createElementNS(p,"g"),C=document.createElementNS(p,"g"),M=document.createElementNS(p,"g"),L=document.createElementNS(p,"g"),T=void 0===f[0].points?0:f[0].points;x.setAttributeNS("charty","class","data-header"),C.setAttributeNS("charty","class","data-lines"),M.setAttributeNS("charty","class","data-rings"),L.setAttributeNS("charty","class","data-label");for(var k=1;k<=5;k++)M.innerHTML+='<circle cx="0" cy="0" r="'+20*k+'"/>';x.appendChild(C),x.appendChild(M),s&&x.appendChild(L),0<T.length&&T.forEach(function(t,e){var a=document.createElementNS(p,"text"),n=document.createElementNS(p,"line");a.setAttributeNS("charty","x",0),a.setAttributeNS("charty","y",105),a.setAttributeNS("charty","style","--angle: ".concat(360/T.length*e)),n.setAttributeNS("charty","x1",0),n.setAttributeNS("charty","x2",100),n.setAttributeNS("charty","y1",0),n.setAttributeNS("charty","y2",0),n.setAttributeNS("charty","style","--angle: ".concat(360/T.length*e)),a.innerHTML=t,L.appendChild(a),C.appendChild(n)}),v.appendChild(x),f.forEach(function(r,t){if(T.length!==r.value.length)return at?console.log(">>> Charty input error\n --\x3e ".concat(r.label," has ").concat(r.value.length," values but you have created ").concat(T.length," labels - not creating the data")):null;var e=document.createElementNS(p,"g"),a=document.createElementNS(p,"polygon"),c=document.createElementNS(p,"g"),o="";r.value.forEach(function(t,e){if(t<0||100<t)return at?console.log(">>> Charty input error\n --\x3e ".concat(r.label," has a value of ").concat(t," in its array. Values need to be between 0-100")):null;var a=0<=t&&t<=100?t/100:0,n=360/T.length*e*(Math.PI/180),e=100*Math.cos(n)*a,n=100*Math.sin(n)*a,a=document.createElementNS(p,"text");o+="".concat(e," ").concat(n," "),a.setAttributeNS("charty","x","".concat(e)),a.setAttributeNS("charty","y","".concat(n)),a.setAttributeNS("charty","filter","url(#text-bg)"),a.innerHTML="".concat(t,"%"),c.appendChild(a)}),e.setAttributeNS("charty","class","data-item"),a.setAttributeNS("charty","points",o),a.setAttributeNS("charty","fill",A[t]),c.setAttributeNS("charty","class","data-text"),m&&(N.innerHTML+='<label><span style="background: '.concat(A[t],';"></span>').concat(r.label,"</label>")),e.appendChild(a),g&&e.appendChild(c),v.appendChild(e)});break;case"area":var w=document.createElementNS(p,"g"),H=document.createElementNS(p,"g"),_=document.createElementNS(p,"g");f.length;w.setAttributeNS("charty","class","data-header"),H.setAttributeNS("charty","class","data-text"),_.setAttributeNS("charty","class","data-line"),y.setAttributeNS("charty","axes-vertical","Values");for(k=1;k<=10;k++){var O=10*(k-1),j=Math.round(S[0].largest-S[0].largest/10*(k-1));_.innerHTML+='<line x1="0" x2="100" y1="'.concat(O,'" y2="').concat(O,'" stroke-width="0.2" stroke-dasharray="4,4" />'),H.innerHTML+='<text x="'.concat(-5,'" y="').concat(O,'">').concat(j,"</text>")}s&&w.appendChild(H),w.appendChild(_),v.appendChild(w),f.forEach(function(t,e){var a=document.createElementNS(p,"polygon"),r=f[e].value.length-1,n=1<f.length?e:0,c=S[n].largest,n=document.createElementNS(p,"g"),o=document.createElementNS(p,"g"),l="";t.value.forEach(function(t,e){var a=100-t/c*100,n=document.createElementNS(p,"text");n.setAttributeNS("charty","x","".concat(100/r*e)),n.setAttributeNS("charty","y","".concat(a)),n.setAttributeNS("charty","filter","url(#text-bg)"),n.innerHTML=t,o.appendChild(n),l+="".concat(100/r*e," ").concat(a,", ")}),l+="100 100, 0 100",a.setAttributeNS("charty","points",l),a.setAttributeNS("charty","fill",A[e]),n.setAttributeNS("charty","class","data-item"),o.setAttributeNS("charty","class","data-text"),n.appendChild(a),g&&n.appendChild(o),v.appendChild(n),m&&(N.innerHTML+='<label><span style="background: '.concat(A[e],';"></span>').concat(t.label,"</label>"))});break;case"pie":case"donut":case"section":var I=S[0].sum,P=0;f.forEach(function(t,e){var a="section"===b?t.value:t.value/I,n=document.createElementNS(p,"g"),r=g?f[e].value?"section"===b?" (".concat((100*t.value).toFixed(2),"%)"):" (".concat(t.value.toLocaleString()," - ").concat((100*a).toFixed(2),"%)"):null:"",c=_slicedToArray(rt(P),2),o=c[0],l=c[1],i=_slicedToArray(rt(P+=a),2),c=i[0],i=i[1],a=.5<a?1:0,c=["M ".concat(o," ").concat(l),"A 50 50 0 ".concat(a," 1 ").concat(c," ").concat(i),"L 50 50"].join(" "),i=document.createElementNS(p,"path");i.setAttributeNS("charty","d",c),i.setAttributeNS("charty","fill",A[e]),n.setAttributeNS("charty","class","data-item"),n.appendChild(i),m&&(t=s?t.label:"",N.innerHTML+='<label> <span style="background:'.concat(A[e],';"></span>').concat(t," ").concat(r,"</label>")),v.appendChild(n)}),"donut"===b&&(d.innerHTML+='<mask id="donut-hole"><rect width="100" height="100" fill="white" /><circle cx="50" cy="50"/></mask>',v.setAttributeNS("charty","mask","url(#donut-hole)"));break;case"ring":var W=32/f.length;f.forEach(function(t,e){var a=document.createElementNS(p,"g"),n=document.createElementNS(p,"circle"),r=document.createElementNS(p,"circle"),c=50-(3*e+1)*W/2,o=0<=t.value&&t.value<=1&&S[0].sum<=+f.length?t.value:0<=t.value&&t.value<=100&&S[0].sum<=100*f.length?t.value/100:null;a.setAttributeNS("charty","class","data-item"),n.setAttributeNS("charty","class","ring-bg"),n.setAttributeNS("charty","cx","50"),n.setAttributeNS("charty","cy","50"),n.setAttributeNS("charty","stroke-width","".concat(W)),n.setAttributeNS("charty","r","".concat(c)),r.setAttributeNS("charty","cx","50"),r.setAttributeNS("charty","cy","50"),r.setAttributeNS("charty","stroke","".concat(A[e])),r.setAttributeNS("charty","fill","none"),r.setAttributeNS("charty","stroke-width","".concat(W)),r.setAttributeNS("charty","r","".concat(c)),r.setAttributeNS("charty","stroke-dasharray","".concat(2*Math.PI*c," ").concat(2*Math.PI*c)),r.setAttributeNS("charty","stroke-dashoffset","".concat(2*Math.PI*c-100*o/100*(2*Math.PI*c))),a.appendChild(n),a.appendChild(r),v.appendChild(a),m&&(t=s?t.label:"",o=g?" (".concat(100*o.toFixed(2),"%)"):"",N.innerHTML+='<label> <span style="background:'.concat(A[e],';"></span>').concat(t).concat(o,"</label>"))});break;case"plot":case"line":case"bubble":var $=document.createElementNS(p,"g"),D=document.createElementNS(p,"g"),F=document.createElementNS(p,"g");f.length;$.setAttributeNS("charty","class","data-header"),D.setAttributeNS("charty","class","data-text"),F.setAttributeNS("charty","class","data-line"),y.setAttributeNS("charty","axes-vertical","Values");for(k=1;k<=10;k++){var R=10*(k-1),V=Math.round(S[0].largest-S[0].largest/10*(k-1));F.innerHTML+='<line x1="0" x2="100" y1="'.concat(R,'" y2="').concat(R,'" stroke-width="0.2" stroke-dasharray="4,4" />'),D.innerHTML+='<text x="'.concat(-5,'" y="').concat(R,'">').concat(V,"</text>")}s&&$.appendChild(D),$.appendChild(F),v.appendChild($),f.forEach(function(t,o){var l=document.createElementNS(p,"g"),i=document.createElementNS(p,"g"),s=f[o].value.length,u=1<f.length?o:0,d=S[u].largest,e=f[o].value,h=document.createElementNS(p,"polyline"),y="";l.setAttributeNS("charty","class","data-item"),e.forEach(function(t,e){var a=document.createElementNS(p,"circle"),n=document.createElementNS(p,"text"),r=100/s*(e+1)-100/s/2,c=100-t/d*100,e="bubble"===b?1.25+5*t/S[u].sum:1.25;a.setAttributeNS("charty","r","".concat(e)),a.setAttributeNS("charty","cx","".concat(r)),a.setAttributeNS("charty","cy","".concat(c)),a.setAttributeNS("charty","fill","".concat(A[o])),"line"===b&&(y+=" ".concat(r," "),y+="".concat(c),h.setAttributeNS("charty","points","".concat(y)),h.setAttributeNS("charty","stroke-width","0.3"),h.setAttributeNS("charty","style","stroke: ".concat(A[o],";")),l.appendChild(h)),i.setAttributeNS("charty","class","data-text"),n.setAttributeNS("charty","x","".concat(r)),n.setAttributeNS("charty","y","".concat(c-6)),n.setAttributeNS("charty","filter","url(#text-bg)"),n.innerHTML=t,g&&i.appendChild(n),l.appendChild(a)}),l.appendChild(i),v.appendChild(l),m&&(N.innerHTML+='<label> <span style="background:'.concat(A[o],';"></span>').concat(t.label,"</label>"))});break;case"bar":case"column":case"bar-stack":case"column-stack":var z=!!b.startsWith("column"),B=!!b.endsWith("stack"),w=document.createElementNS(p,"g"),K=document.createElementNS(p,"g"),q=document.createElementNS(p,"g"),J=f.length,G=f.map(function(t,e,a){for(var n=[],r=0,c=0;c<t.value.length;c++)c<1?r=0:r+=a[c-1].value[e],n.push(r);return n}),U=f.slice(1).reduce(function(t,e){var a=e.value;return t.map(function(t,e){return t+a[e]})},f[0].value);B||($=z?"vertical":"horizontal",y.setAttributeNS("charty","axes-".concat(z?"horizontal":"vertical"),"Values"),y.setAttributeNS("charty","axes-".concat($),"Labels")),w.setAttributeNS("charty","class","data-header"),K.setAttributeNS("charty","class","data-label"),q.setAttributeNS("charty","class","data-line");for(k=1;k<=10;k++){var Y=z?110:0,Q=10*(k-1),X=B?100-10*(k-1):Math.round(S[0].largest-S[0].largest/10*(k-1));q.innerHTML+='<line x1="0" x2="100" y1="'.concat(Q,'" y2="').concat(Q,'" stroke-width="0.2" stroke-dasharray="4, 4" />'),K.innerHTML+='<text x="'.concat(Y-5,'" y="').concat(Q,'"> ').concat(X," </text>")}s&&w.appendChild(K),w.appendChild(q),v.appendChild(w),f.forEach(function(r,c){var t=Array.isArray(r.value)?r.value:[r.value],o=(G[c][G[c].length-1],t.length),l=100/J,i=l/o,s=i/2,u=document.createElementNS(p,"g"),d=document.createElementNS(p,"g");u.setAttributeNS("charty","class","data-item"),d.setAttributeNS("charty","class","data-text"),v.appendChild(u),t.forEach(function(t,e){return J!==o?at?console.log("Charty error:\n>>> The number of items in the value list does not match the number of titles"):null:void(B?(n=t/U[e]*100,a=G[e][c]/U[e]*100,u.innerHTML+=' <rect width="'.concat(l,'" height="').concat(n,'" fill="').concat(A[c],'" x="').concat(l*e,'" y="').concat(a,'" /> '),g&&(d.innerHTML+='<text filter="url(#text-bg)" y="'.concat(a+n/2,'" x="').concat(l/2+e*l,'">').concat(t,"</text>"))):(n=100-(a=t/S[c].largest*100),u.innerHTML+=' <rect width="'.concat(i,'" height="').concat(a,'" fill="').concat(A[c],'" x="').concat(i*c+l*e,'" y="').concat(n,'" /> '),K.innerHTML+='<text y="'.concat(105,'" x="',i*c+l*e+s,' "> ').concat(r.label," </text>"),g&&(d.innerHTML+='<text filter="url(#text-bg)" y="'.concat(100-a,'" x="').concat(i*c+l*e+s,'">').concat(t,"</text>"))));var a,n}),m&&(N.innerHTML+='<label><span style="background:'.concat(A[c],';"></span>').concat(r.label,"</label>")),u.appendChild(d)});break;case"rating":var Z=S[0].max;f.forEach(function(t,e){var a=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),c=document.createElement("div"),o=document.createElement("div"),l=t.value/Z*100;a.setAttribute("class","data-item"),n.setAttribute("class","rating-label"),r.setAttribute("class","rating-value"),c.setAttribute("class","rating-bar-container"),o.setAttribute("class","rating-bar-colour"),n.innerHTML=t.label,r.innerHTML=t.value,o.setAttribute("style","width: ".concat(l,"%; background-color: ").concat(A[e],";")),s&&a.appendChild(n),g&&a.appendChild(r),a.appendChild(c),c.appendChild(o),y.appendChild(a)}),y.innerHTML+="<small><em>Ratings are out of a total of <strong>".concat(Z,"</strong></em></small>");break;default:return}(charty=h.outerHTML)&&(h=""!==c.title&&c.title?"<h3>".concat(c.title,"</h3>"):"",c=""!==c.caption&&c.caption?"<figcaption>".concat(c.caption,"</figcaption>"):"",c=h||c?"<header>".concat(h).concat(c,"</header>"):"",e.innerHTML="".concat(c).concat(charty),t.parentNode.replaceChild(e,t))}}),e(a.innerHTML)}),t.doneEach(function(){document.querySelectorAll(".docsify-charty").forEach(function(e,t){var n=_toConsumableArray(e.getElementsByClassName("data-item"));_toConsumableArray(e.getElementsByTagName("label")).forEach(function(t,a){t.addEventListener("mouseover",function(t){e.classList.add("hover"),n.forEach(function(t,e){a===e?t.classList.add("active"):t.classList.remove("active")})}),t.addEventListener("mouseout",function(t){e.classList.remove("hover"),n.forEach(function(t){return t.classList.remove("active")})})})})})}window.$docsify.charty=Object.assign(chartyOptions,window.$docsify.charty),window.$docsify.plugins=[].concat(charty,window.$docsify.plugins);
|
|
1
|
+
/*! docsify-charty 3.0.0 | (c) Mark Battistella */
|
|
2
|
+
"use strict";function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var a=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=a){var r,n,c=[],o=!0,l=!1;try{for(a=a.call(t);!(o=(r=a.next()).done)&&(c.push(r.value),!e||c.length!==e);o=!0);}catch(t){l=!0,n=t}finally{try{o||null==a.return||a.return()}finally{if(l)throw n}}return c}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function ownKeys(e,t){var a,r=Object.keys(e);return Object.getOwnPropertySymbols&&(a=Object.getOwnPropertySymbols(e),t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)),r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach(function(t){_defineProperty(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function _defineProperty(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){var a;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(a="Object"===(a=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:a)||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,e):void 0}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function getChartyOptions(t){return[""!=t.theme?t.theme:"#0984E3",""!=t.mode?t.mode:"light",!0===t.debug]}var chartyOptions={theme:"",mode:"light",debug:0};function charty(t,e){var a=getChartyOptions(chartyOptions),Y=a[0],Q=a[1],X=a[2],Z=["radar","area","donut","doughnut","pie","section","sectional","rings","line","plot","scatter","bubble","rating","review","bar","column","bar-stack","bar-stacked","column-stack","column-stacked"];function tt(t){var e=360*Math.PI/180;return[50+50*Math.cos(e*t),50+50*Math.sin(e*t)]}console.log(X),t.afterEach(function(t,e){var a=document.createElement("div");a.innerHTML=t,a.querySelectorAll("pre[data-lang=charty]").forEach(function(t){var e=document.createElement("figure");if(e.textContent=t.textContent,function(t){try{JSON.parse(t)}catch(t){return console.log(t),0}return 1}(e.innerHTML)){var p="http://www.w3.org/2000/svg",a=JSON.parse(e.innerHTML.replace(/"color":/g,'"colour":')),b=a.type&&Z.includes(a.type)?"doughnut"===a.type?"donut":"sectional"===a.type?"section":"rings"===a.type?"ring":"scatter"===a.type?"plot":"review"===a.type?"rating":a.type.endsWith("-stacked")?a.type.replace("-stacked","-stack"):a.type:null,r=a.options,P=Y&&r.theme?r.theme:Y,m=!!r.legend,s=!!r.labels,g=!!r.numbers,f=Array.isArray(a.data)?a.data:[a.data];n=(r=f).map(function(t){return t.value});var W,r=("number"==typeof r[0].value?[n]:n).reduce(function(t,e){var a,r=t.pop();try{!Array.isArray(e)&&!e.length||e.some(isNaN)||(a={min:Math.min.apply(Math,_toConsumableArray(e)),max:Math.max.apply(Math,_toConsumableArray(e)),sum:_toConsumableArray(e).reduce(function(t,e){return t+e}),avg:_toConsumableArray(e).reduce(function(t,e){return t+e})/_toConsumableArray(e).length},t.push(a),a.max>r.largest&&(r.largest=a.max))}catch(t){return X?console.log(t):null}return t.push(r),t},[{largest:-1/0}]),S=(W=r[r.length-1],r.slice(0,-1).map(function(t){return _objectSpread(_objectSpread({},t),W)})),A=f.map(function(t,e){var a;return t.colour||(t=function(t,e){if(e=1<arguments.length&&void 0!==e?e:1,3===(t=t.replace(/#/g,"")).length&&(t=t.split("").map(function(t){return t+t}).join("")),!(t=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})[\da-z]{0,0}$/i.exec(t)))return null;var a,r=parseInt(t[1],16)/255,n=parseInt(t[2],16)/255,c=parseInt(t[3],16)/255,t=Math.max(r,n,c),o=Math.min(r,n,c),l=(t+o)/2;if(t==o)a=s=0;else{var i=t-o,s=.5<l?i/(2-t-o):i/(t+o);switch(t){case r:a=(n-c)/i+(n<c?6:0);break;case n:a=(c-r)/i+2;break;case c:a=(r-n)/i+4}a/=6}return s=Math.round(100*s),{h:a=Math.round(360*a),s:s,l:l=1!=e&&e<101&&0<e?Math.round(98/e):Math.round(100*l)}}(P,f.length),a=1===f.length?50:0,"hsl( ".concat(t.h,", ").concat(t.s,"%, ").concat(t.l*e+a,"% )"))}),n=(e.classList.add("docsify-charty"),e.classList.add("".concat(Q)),s&&["area","plot","bubble","line","bar","column","bar-stack","column-stack"].includes(b)&&e.classList.add("axes"),document.createElementNS(p,"svg")),c=document.createElementNS(p,"defs"),N=document.createElementNS(p,"g"),r=document.createElement("div"),i=document.createElement("div"),v=document.createElement("fieldset"),o=document.createElement("title"),l=document.createElement("desc");switch(n.setAttributeNS("charty","viewBox","0 0 100 100"),n.setAttributeNS("charty","preserveAspectRatio","xMidYMid meet"),c.innerHTML='<filter x="-0.25" y="-0.25" width="1.5" height="1.5" id="text-bg"><feFlood flood-color="var(--charty-colour-dark)"/><feComposite in="SourceGraphic" operator="over"/></filter>',r.setAttributeNS("charty","class","container"),i.setAttributeNS("charty","class","dataset ".concat(b)),N.setAttributeNS("charty","class","data-container"),o.innerHTML=a.title,l.innerHTML=a.caption,n.appendChild(o),n.appendChild(l),g&&n.appendChild(c),n.appendChild(N),["rating"].includes(b)||i.appendChild(n),r.appendChild(i),m&&!["rating"].includes(b)&&(e.classList.add("legend"),r.appendChild(v),v.innerHTML="<legend>Legend</legend>"),b){case"radar":var u=document.createElementNS(p,"g"),d=document.createElementNS(p,"g"),h=document.createElementNS(p,"g"),y=document.createElementNS(p,"g"),E=void 0===f[0].points?0:f[0].points;u.setAttributeNS("charty","class","data-header"),d.setAttributeNS("charty","class","data-lines"),h.setAttributeNS("charty","class","data-rings"),y.setAttributeNS("charty","class","data-label");for(var x=1;x<=5;x++)h.innerHTML+='<circle cx="0" cy="0" r="'+20*x+'"/>';u.appendChild(d),u.appendChild(h),s&&u.appendChild(y),0<E.length&&E.forEach(function(t,e){var a=document.createElementNS(p,"text"),r=document.createElementNS(p,"line");a.setAttributeNS("charty","x",0),a.setAttributeNS("charty","y",105),a.setAttributeNS("charty","style","--angle: ".concat(360/E.length*e)),r.setAttributeNS("charty","x1",0),r.setAttributeNS("charty","x2",100),r.setAttributeNS("charty","y1",0),r.setAttributeNS("charty","y2",0),r.setAttributeNS("charty","style","--angle: ".concat(360/E.length*e)),a.innerHTML=t,y.appendChild(a),d.appendChild(r)}),N.appendChild(u),f.forEach(function(n,t){if(E.length!==n.value.length)return X?console.log(">>> Charty input error\n --\x3e ".concat(n.label," has ").concat(n.value.length," values but you have created ").concat(E.length," labels - not creating the data")):null;var e=document.createElementNS(p,"g"),a=document.createElementNS(p,"polygon"),c=document.createElementNS(p,"g"),o="";n.value.forEach(function(t,e){if(t<0||100<t)return X?console.log(">>> Charty input error\n --\x3e ".concat(n.label," has a value of ").concat(t," in its array. Values need to be between 0-100")):null;var a=0<=t&&t<=100?t/100:0,e=360/E.length*e*(Math.PI/180),r=100*Math.cos(e)*a,e=100*Math.sin(e)*a,a=document.createElementNS(p,"text");o+="".concat(r," ").concat(e," "),a.setAttributeNS("charty","x","".concat(r)),a.setAttributeNS("charty","y","".concat(e)),a.setAttributeNS("charty","filter","url(#text-bg)"),a.innerHTML="".concat(t,"%"),c.appendChild(a)}),e.setAttributeNS("charty","class","data-item"),a.setAttributeNS("charty","points",o),a.setAttributeNS("charty","fill",A[t]),c.setAttributeNS("charty","class","data-text"),m&&(v.innerHTML+='<label><span style="background: '.concat(A[t],';"></span>').concat(n.label,"</label>")),e.appendChild(a),g&&e.appendChild(c),N.appendChild(e)});break;case"area":var u=document.createElementNS(p,"g"),C=document.createElementNS(p,"g"),M=document.createElementNS(p,"g");f.length;u.setAttributeNS("charty","class","data-header"),C.setAttributeNS("charty","class","data-text"),M.setAttributeNS("charty","class","data-line"),i.setAttributeNS("charty","axes-vertical","Values");for(x=1;x<=10;x++){var L=10*(x-1),$=Math.round(S[0].largest-S[0].largest/10*(x-1));M.innerHTML+='<line x1="0" x2="100" y1="'.concat(L,'" y2="').concat(L,'" stroke-width="0.2" stroke-dasharray="4,4" />'),C.innerHTML+='<text x="'.concat(-5,'" y="').concat(L,'">').concat($,"</text>")}s&&u.appendChild(C),u.appendChild(M),N.appendChild(u),f.forEach(function(t,e){var a=document.createElementNS(p,"polygon"),n=f[e].value.length-1,r=1<f.length?e:0,c=S[r].largest,r=document.createElementNS(p,"g"),o=document.createElementNS(p,"g"),l="";t.value.forEach(function(t,e){var a=100-t/c*100,r=document.createElementNS(p,"text");r.setAttributeNS("charty","x","".concat(100/n*e)),r.setAttributeNS("charty","y","".concat(a)),r.setAttributeNS("charty","filter","url(#text-bg)"),r.innerHTML=t,o.appendChild(r),l+="".concat(100/n*e," ").concat(a,", ")}),l+="100 100, 0 100",a.setAttributeNS("charty","points",l),a.setAttributeNS("charty","fill",A[e]),r.setAttributeNS("charty","class","data-item"),o.setAttributeNS("charty","class","data-text"),r.appendChild(a),g&&r.appendChild(o),N.appendChild(r),m&&(v.innerHTML+='<label><span style="background: '.concat(A[e],';"></span>').concat(t.label,"</label>"))});break;case"pie":case"donut":case"section":var D=S[0].sum,F=0;f.forEach(function(t,e){var a="section"===b?t.value:t.value/D,r=document.createElementNS(p,"g"),n=g?f[e].value?"section"===b?" (".concat((100*t.value).toFixed(2),"%)"):" (".concat(t.value.toLocaleString()," - ").concat((100*a).toFixed(2),"%)"):null:"",c=_slicedToArray(tt(F),2),o=c[0],c=c[1],l=_slicedToArray(tt(F+=a),2),i=l[0],l=l[1],a=.5<a?1:0,o=["M ".concat(o," ").concat(c),"A 50 50 0 ".concat(a," 1 ").concat(i," ").concat(l),"L 50 50"].join(" "),c=document.createElementNS(p,"path");c.setAttributeNS("charty","d",o),c.setAttributeNS("charty","fill",A[e]),r.setAttributeNS("charty","class","data-item"),r.appendChild(c),m&&(a=s?t.label:"",v.innerHTML+='<label> <span style="background:'.concat(A[e],';"></span>').concat(a," ").concat(n,"</label>")),N.appendChild(r)}),"donut"===b&&(c.innerHTML+='<mask id="donut-hole"><rect width="100" height="100" fill="white" /><circle cx="50" cy="50"/></mask>',N.setAttributeNS("charty","mask","url(#donut-hole)"));break;case"ring":var T=32/f.length;f.forEach(function(t,e){var a=document.createElementNS(p,"g"),r=document.createElementNS(p,"circle"),n=document.createElementNS(p,"circle"),c=50-(3*e+1)*T/2,o=0<=t.value&&t.value<=1&&S[0].sum<=+f.length?t.value:0<=t.value&&t.value<=100&&S[0].sum<=100*f.length?t.value/100:null;a.setAttributeNS("charty","class","data-item"),r.setAttributeNS("charty","class","ring-bg"),r.setAttributeNS("charty","cx","50"),r.setAttributeNS("charty","cy","50"),r.setAttributeNS("charty","stroke-width","".concat(T)),r.setAttributeNS("charty","r","".concat(c)),n.setAttributeNS("charty","cx","50"),n.setAttributeNS("charty","cy","50"),n.setAttributeNS("charty","stroke","".concat(A[e])),n.setAttributeNS("charty","fill","none"),n.setAttributeNS("charty","stroke-width","".concat(T)),n.setAttributeNS("charty","r","".concat(c)),n.setAttributeNS("charty","stroke-dasharray","".concat(2*Math.PI*c," ").concat(2*Math.PI*c)),n.setAttributeNS("charty","stroke-dashoffset","".concat(2*Math.PI*c-100*o/100*(2*Math.PI*c))),a.appendChild(r),a.appendChild(n),N.appendChild(a),m&&(c=s?t.label:"",r=g?" (".concat(100*o.toFixed(2),"%)"):"",v.innerHTML+='<label> <span style="background:'.concat(A[e],';"></span>').concat(c).concat(r,"</label>"))});break;case"plot":case"line":case"bubble":var u=document.createElementNS(p,"g"),k=document.createElementNS(p,"g"),w=document.createElementNS(p,"g");f.length;u.setAttributeNS("charty","class","data-header"),k.setAttributeNS("charty","class","data-text"),w.setAttributeNS("charty","class","data-line"),i.setAttributeNS("charty","axes-vertical","Values");for(x=1;x<=10;x++){var H=10*(x-1),R=Math.round(S[0].largest-S[0].largest/10*(x-1));w.innerHTML+='<line x1="0" x2="100" y1="'.concat(H,'" y2="').concat(H,'" stroke-width="0.2" stroke-dasharray="4,4" />'),k.innerHTML+='<text x="'.concat(-5,'" y="').concat(H,'">').concat(R,"</text>")}s&&u.appendChild(k),u.appendChild(w),N.appendChild(u),f.forEach(function(t,o){var l=document.createElementNS(p,"g"),i=document.createElementNS(p,"g"),s=f[o].value.length,u=1<f.length?o:0,d=S[u].largest,e=f[o].value,h=document.createElementNS(p,"polyline"),y="";l.setAttributeNS("charty","class","data-item"),e.forEach(function(t,e){var a=document.createElementNS(p,"circle"),r=document.createElementNS(p,"text"),e=100/s*(e+1)-100/s/2,n=100-t/d*100,c="bubble"===b?1.25+5*t/S[u].sum:1.25;a.setAttributeNS("charty","r","".concat(c)),a.setAttributeNS("charty","cx","".concat(e)),a.setAttributeNS("charty","cy","".concat(n)),a.setAttributeNS("charty","fill","".concat(A[o])),"line"===b&&(y=(y+=" ".concat(e," "))+"".concat(n),h.setAttributeNS("charty","points","".concat(y)),h.setAttributeNS("charty","stroke-width","0.3"),h.setAttributeNS("charty","style","stroke: ".concat(A[o],";")),l.appendChild(h)),i.setAttributeNS("charty","class","data-text"),r.setAttributeNS("charty","x","".concat(e)),r.setAttributeNS("charty","y","".concat(n-6)),r.setAttributeNS("charty","filter","url(#text-bg)"),r.innerHTML=t,g&&i.appendChild(r),l.appendChild(a)}),l.appendChild(i),N.appendChild(l),m&&(v.innerHTML+='<label> <span style="background:'.concat(A[o],';"></span>').concat(t.label,"</label>"))});break;case"bar":case"column":case"bar-stack":case"column-stack":var V,_=!!b.startsWith("column"),O=!!b.endsWith("stack"),u=document.createElementNS(p,"g"),j=document.createElementNS(p,"g"),I=document.createElementNS(p,"g"),z=f.length,B=f.map(function(t,e,a){for(var r=[],n=0,c=0;c<t.value.length;c++)c<1?n=0:n+=a[c-1].value[e],r.push(n);return r}),K=f.slice(1).reduce(function(t,e){var a=e.value;return t.map(function(t,e){return t+a[e]})},f[0].value);O||(V=_?"vertical":"horizontal",i.setAttributeNS("charty","axes-".concat(_?"horizontal":"vertical"),"Values"),i.setAttributeNS("charty","axes-".concat(V),"Labels")),u.setAttributeNS("charty","class","data-header"),j.setAttributeNS("charty","class","data-label"),I.setAttributeNS("charty","class","data-line");for(x=1;x<=10;x++){var q=_?110:0,J=10*(x-1),G=O?100-10*(x-1):Math.round(S[0].largest-S[0].largest/10*(x-1));I.innerHTML+='<line x1="0" x2="100" y1="'.concat(J,'" y2="').concat(J,'" stroke-width="0.2" stroke-dasharray="4, 4" />'),j.innerHTML+='<text x="'.concat(q-5,'" y="').concat(J,'"> ').concat(G," </text>")}s&&u.appendChild(j),u.appendChild(I),N.appendChild(u),f.forEach(function(n,c){var t=Array.isArray(n.value)?n.value:[n.value],o=(B[c][B[c].length-1],t.length),l=100/z,i=l/o,s=i/2,u=document.createElementNS(p,"g"),d=document.createElementNS(p,"g");u.setAttributeNS("charty","class","data-item"),d.setAttributeNS("charty","class","data-text"),N.appendChild(u),t.forEach(function(t,e){if(z!==o)return X?console.log("Charty error:\n>>> The number of items in the value list does not match the number of titles"):null;var a,r;O?(r=t/K[e]*100,a=B[e][c]/K[e]*100,u.innerHTML+=' <rect width="'.concat(l,'" height="').concat(r,'" fill="').concat(A[c],'" x="').concat(l*e,'" y="').concat(a,'" /> '),g&&(d.innerHTML+='<text filter="url(#text-bg)" y="'.concat(a+r/2,'" x="').concat(l/2+e*l,'">').concat(t,"</text>"))):(r=100-(a=t/S[c].largest*100),u.innerHTML+=' <rect width="'.concat(i,'" height="').concat(a,'" fill="').concat(A[c],'" x="').concat(i*c+l*e,'" y="').concat(r,'" /> '),j.innerHTML+='<text y="'.concat(105,'" x="',i*c+l*e+s,' "> ').concat(n.label," </text>"),g&&(d.innerHTML+='<text filter="url(#text-bg)" y="'.concat(100-a,'" x="').concat(i*c+l*e+s,'">').concat(t,"</text>")))}),m&&(v.innerHTML+='<label><span style="background:'.concat(A[c],';"></span>').concat(n.label,"</label>")),u.appendChild(d)});break;case"rating":var U=S[0].max;f.forEach(function(t,e){var a=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div"),c=document.createElement("div"),o=document.createElement("div"),l=t.value/U*100;a.setAttribute("class","data-item"),r.setAttribute("class","rating-label"),n.setAttribute("class","rating-value"),c.setAttribute("class","rating-bar-container"),o.setAttribute("class","rating-bar-colour"),r.innerHTML=t.label,n.innerHTML=t.value,o.setAttribute("style","width: ".concat(l,"%; background-color: ").concat(A[e],";")),s&&a.appendChild(r),g&&a.appendChild(n),a.appendChild(c),c.appendChild(o),i.appendChild(a)}),i.innerHTML+="<small><em>Ratings are out of a total of <strong>".concat(U,"</strong></em></small>");break;default:return}(charty=r.outerHTML)&&(o=""!==a.title&&a.title?"<h3>".concat(a.title,"</h3>"):"",l=""!==a.caption&&a.caption?"<figcaption>".concat(a.caption,"</figcaption>"):"",n=o||l?"<header>".concat(o).concat(l,"</header>"):"",e.innerHTML="".concat(n).concat(charty),t.parentNode.replaceChild(e,t))}}),e(a.innerHTML)}),t.doneEach(function(){document.querySelectorAll(".docsify-charty").forEach(function(e,t){var r=_toConsumableArray(e.getElementsByClassName("data-item"));_toConsumableArray(e.getElementsByTagName("label")).forEach(function(t,a){t.addEventListener("mouseover",function(t){e.classList.add("hover"),r.forEach(function(t,e){a===e?t.classList.add("active"):t.classList.remove("active")})}),t.addEventListener("mouseout",function(t){e.classList.remove("hover"),r.forEach(function(t){return t.classList.remove("active")})})})})})}window.$docsify.charty=Object.assign(chartyOptions,window.$docsify.charty),window.$docsify.plugins=[].concat(charty,window.$docsify.plugins);
|
package/package.json
CHANGED
|
@@ -1,43 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
"name": "@markbattistella/docsify-charty",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Add charts and graphs to your docsify website",
|
|
5
|
+
"main": "dist/docsify-charty.min.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/markbattistella/docsify-charty.git"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"launch": "docsify serve ./docs -o",
|
|
12
|
+
"update": "ncu -u",
|
|
13
|
+
"babel": "npx babel ./dist/docsify-charty.js -o ./dist/docsify-charty.babel.js",
|
|
14
|
+
"uglify": "uglifyjs ./dist/docsify-charty.babel.js --verbose -c -m -o ./dist/docsify-charty.min.js",
|
|
15
|
+
"minify": "npm run babel && npm run uglify",
|
|
16
|
+
"patch": "node ./.github/scripts/release.js -patch",
|
|
17
|
+
"minor": "node ./.github/scripts/release.js -minor",
|
|
18
|
+
"major": "node ./.github/scripts/release.js -major"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@babel/cli": "^7.24.7",
|
|
22
|
+
"@babel/core": "^7.24.7",
|
|
23
|
+
"@babel/preset-env": "^7.24.7",
|
|
24
|
+
"jsonfile": "^6.1.0"
|
|
25
|
+
},
|
|
26
|
+
"babel": {
|
|
27
|
+
"presets": [
|
|
28
|
+
"@babel/env"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"unpkg": "./dist/docsify-charty.min.js",
|
|
32
|
+
"jsdelivr": "./dist/docsify-charty.min.js",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"docsify",
|
|
35
|
+
"plugin",
|
|
36
|
+
"charts",
|
|
37
|
+
"graphs",
|
|
38
|
+
"pie chart",
|
|
39
|
+
"line graph"
|
|
40
|
+
],
|
|
41
|
+
"author": "Mark Battistella",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/markbattistella/docsify-charty/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://charty.docsify.markbattistella.com/"
|
|
43
47
|
}
|
package/.gitattributes
DELETED