visualifyjs 2.5.3-2.dev
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/static.yml.bak +51 -0
- package/LICENSE +674 -0
- package/README.md +59 -0
- package/config-overrides.js +31 -0
- package/dist/visualify.js +188 -0
- package/docs/.nojekyll +0 -0
- package/docs/docs/CLI.md +34 -0
- package/docs/docs/README.md +65 -0
- package/docs/docs/Rechart/bar.md +190 -0
- package/docs/docs/Rechart/funnel.md +241 -0
- package/docs/docs/Rechart/geo.md +0 -0
- package/docs/docs/Rechart/line.md +355 -0
- package/docs/docs/Rechart/liquidfill.md +0 -0
- package/docs/docs/Rechart/pie.md +225 -0
- package/docs/docs/Rechart/polar.md +0 -0
- package/docs/docs/Rechart/radar.md +253 -0
- package/docs/docs/Rechart/sankey.md +0 -0
- package/docs/docs/Rechart/scatter.md +298 -0
- package/docs/docs/Rechart/sunburst.md +0 -0
- package/docs/docs/Rechart/tree.md +0 -0
- package/docs/docs/Rechart/wordcloud.md +0 -0
- package/docs/docs/_404.md +52 -0
- package/docs/docs/_coverpage.md +11 -0
- package/docs/docs/_sidebar.md +44 -0
- package/docs/docs/components/dotBio.md +34 -0
- package/docs/docs/components/echart.md +82 -0
- package/docs/docs/components/html.md +34 -0
- package/docs/docs/components/macaron.md +145 -0
- package/docs/docs/components/markdown.md +0 -0
- package/docs/docs/components/more.md +142 -0
- package/docs/docs/components/plotly.md +62 -0
- package/docs/docs/components/scatterL.md +70 -0
- package/docs/docs/components/visium.md +57 -0
- package/docs/docs/configuration.md +121 -0
- package/docs/docs/deploy.md +31 -0
- package/docs/docs/log.md +9 -0
- package/docs/docs/more-pages.md +23 -0
- package/docs/docs/quickstart.md +124 -0
- package/docs/docs/rechart-attributes.md +74 -0
- package/docs/docs/rechart-basic-usage.md +162 -0
- package/docs/docs/static/_images/deploy-github-pages.png +0 -0
- package/docs/docs/static/logo/favicon.ico +0 -0
- package/docs/docs/static/logo/logo_128x128.png +0 -0
- package/docs/docs/static/logo/logo_192x192.png +0 -0
- package/docs/docs/static/logo/logo_256x256.png +0 -0
- package/docs/docs/static/logo/logo_512x512.png +0 -0
- package/docs/docs/static/logo/logo_64x64.png +0 -0
- package/docs/docs/theme.md +5 -0
- package/docs/index.html +71 -0
- package/docs/manifest.json +24 -0
- package/docs/static/css/fluff-stuff.css +170 -0
- package/docs/static/css/font-awesome.min.css +4 -0
- package/docs/static/css/visualify.css +25 -0
- package/docs/static/fonts/fontawesome-webfont.woff2 +0 -0
- package/docs/static/images/star.png +0 -0
- package/docs/static/js/configuration.js +448 -0
- package/docs/static/js/fluff.js +1 -0
- package/docs/static/js/visualify.js +188 -0
- package/docs/static/logo/favicon.ico +0 -0
- package/docs/static/logo/logo_128x128.png +0 -0
- package/docs/static/logo/logo_192x192.png +0 -0
- package/docs/static/logo/logo_256x256.png +0 -0
- package/docs/static/logo/logo_512x512.png +0 -0
- package/docs/static/logo/logo_64x64.png +0 -0
- package/package.json +84 -0
- package/rollup.config.mjs +76 -0
- package/src/_css/404.css +116 -0
- package/src/_css/App.css +38 -0
- package/src/_css/autoSuggestion.css +27 -0
- package/src/_css/circular-progress.css +33 -0
- package/src/_css/index.css +37 -0
- package/src/_css/modern.css +25 -0
- package/src/_media/404.png +0 -0
- package/src/_media/corner.svg +8 -0
- package/src/_media/download.svg +3 -0
- package/src/_media/icon.svg +1 -0
- package/src/_media/logo.svg +14 -0
- package/src/_test/App.test.js +15 -0
- package/src/_utils/reportWebVitals.js +13 -0
- package/src/core/appContext.js +27 -0
- package/src/core/components/Scatter.js +188 -0
- package/src/core/components/ScatterBio.js +572 -0
- package/src/core/components/VisiumPlot.js +165 -0
- package/src/core/components/browser.js +42 -0
- package/src/core/components/dotplot.js +413 -0
- package/src/core/components/html.js +29 -0
- package/src/core/components/list.js +178 -0
- package/src/core/components/macaron.js +201 -0
- package/src/core/components/markdown.js +56 -0
- package/src/core/components/parser.scatterBio.js +587 -0
- package/src/core/components/ratio.js +80 -0
- package/src/core/components/scatterL.js +173 -0
- package/src/core/components/searchbar.js +131 -0
- package/src/core/components/selection.js +193 -0
- package/src/core/components/timeline.js +281 -0
- package/src/core/components/visium.js +97 -0
- package/src/core/fetch/condfetch.js +82 -0
- package/src/core/fetch/fetch.js +92 -0
- package/src/core/fetch/json.js +29 -0
- package/src/core/fetch/vfetch.js +42 -0
- package/src/core/liveEditor.js +44 -0
- package/src/core/modules/codeEditorWithPreview.js +104 -0
- package/src/core/modules/echarts/common.js +20 -0
- package/src/core/modules/echarts/presetHandler.js +41 -0
- package/src/core/modules/echarts/presets/esodev.chromium.js +172 -0
- package/src/core/modules/echarts/presets/esodev.codex.js +130 -0
- package/src/core/modules/echarts/presets/esodev.visium.js +123 -0
- package/src/core/modules/echarts/presets/mmtrbc.js +186 -0
- package/src/core/modules/echarts.js +71 -0
- package/src/core/modules/echartsUtils.js +43 -0
- package/src/core/modules/echartswitcher.js +152 -0
- package/src/core/modules/replotly/presetHandler.js +24 -0
- package/src/core/modules/replotly/presets/minimum.js +18 -0
- package/src/core/modules/replotly/presets/mmtrbc.dot.js +114 -0
- package/src/core/modules/replotly/presets/mmtrbc.violin.js +100 -0
- package/src/core/modules/replotly.js +71 -0
- package/src/core/pages/404.js +50 -0
- package/src/core/pages/error.js +27 -0
- package/src/core/pages/jsonPage.js +62 -0
- package/src/core/pages/loading.js +44 -0
- package/src/core/parser/echart.data.js +183 -0
- package/src/core/parser/echart.features.js +125 -0
- package/src/core/parser/echart.general.js +147 -0
- package/src/core/parser/echart.hilbert.js +57 -0
- package/src/core/parser/echart.parser.js +210 -0
- package/src/core/parser/echart.series.js +67 -0
- package/src/core/parser/echart.types.js +76 -0
- package/src/core/parser/plotly.config.js +10 -0
- package/src/core/parser/plotly.data.js +132 -0
- package/src/core/parser/plotly.layout.js +10 -0
- package/src/core/parser/plotly.violin.js +18 -0
- package/src/core/recharts.js +62 -0
- package/src/core/router/alias.js +49 -0
- package/src/core/router/jsonRouter.js +31 -0
- package/src/core/themes/modern.js +32 -0
- package/src/core/themes/themeSelector.js +33 -0
- package/src/core/visualify.js +47 -0
- package/src/core/widgets/circularProgress.js +24 -0
- package/src/core/widgets/controller.js +83 -0
- package/src/core/widgets/errorBoundary.js +36 -0
- package/src/core/widgets/footer.js +177 -0
- package/src/core/widgets/header.js +234 -0
- package/src/core/widgets/layout/Grid.js +31 -0
- package/src/core/widgets/layout.js +36 -0
- package/src/core/widgets/mapping.js +42 -0
- package/src/index.js +62 -0
- package/src/setupTests.js +5 -0
@@ -0,0 +1,121 @@
|
|
1
|
+
# Configuration
|
2
|
+
|
3
|
+
You can configure Visualify by defining `window.$visualify` or `$visualify` as
|
4
|
+
an object:
|
5
|
+
|
6
|
+
```js
|
7
|
+
<script>
|
8
|
+
window.$visualify = {
|
9
|
+
mode: 'pages',
|
10
|
+
// ...
|
11
|
+
}
|
12
|
+
</script>
|
13
|
+
```
|
14
|
+
|
15
|
+
Or you can initialize `$visualify` as a **Chart Module**:
|
16
|
+
|
17
|
+
```js
|
18
|
+
<script>
|
19
|
+
$visualify = {
|
20
|
+
mode: 'charts',
|
21
|
+
}
|
22
|
+
|
23
|
+
new $visualify.Recharts({...}).mount('#chart')
|
24
|
+
new $visualify.LiveEditor({...}).mount('#ex11');
|
25
|
+
</script>
|
26
|
+
```
|
27
|
+
|
28
|
+
## el
|
29
|
+
|
30
|
+
- Type: `String`
|
31
|
+
- Default: `'#root'`
|
32
|
+
|
33
|
+
The DOM element to be mounted on initialization. It can be a CSS selector string
|
34
|
+
or an actual
|
35
|
+
[HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement).
|
36
|
+
|
37
|
+
```js
|
38
|
+
window.$visualify = {
|
39
|
+
el: '#root',
|
40
|
+
};
|
41
|
+
```
|
42
|
+
|
43
|
+
## mode
|
44
|
+
|
45
|
+
- Type: `String`
|
46
|
+
- Default: `'pages'`
|
47
|
+
- Options: `'pages'`, `'charts'`
|
48
|
+
|
49
|
+
The mode of Visualify. If you want to use Visualify as a chart module, you can
|
50
|
+
set `mode` to `'charts'`.
|
51
|
+
|
52
|
+
```js
|
53
|
+
window.$visualify = {
|
54
|
+
mode: 'charts',
|
55
|
+
};
|
56
|
+
```
|
57
|
+
|
58
|
+
## theme
|
59
|
+
|
60
|
+
- Type: `String`
|
61
|
+
- Default: `'modern'`
|
62
|
+
- Options: `'modern'`, `'classic'`
|
63
|
+
|
64
|
+
The theme of Visualify. The default theme is `'modern'`. Themes usually make
|
65
|
+
changes to the layout and components of the page. Built-in different themes
|
66
|
+
provide different typesetting and functions, please choose different themes
|
67
|
+
according to different needs, you can also replace a single css to change the
|
68
|
+
style.
|
69
|
+
|
70
|
+
```js
|
71
|
+
window.$visualify = {
|
72
|
+
theme: 'modern',
|
73
|
+
};
|
74
|
+
```
|
75
|
+
|
76
|
+
For more themes, please refer to [Themes](themes.md)
|
77
|
+
|
78
|
+
## homepage
|
79
|
+
|
80
|
+
- Type: `String`
|
81
|
+
- Default: `'home.json'`
|
82
|
+
|
83
|
+
The `home.json` in your docs folder will be treated as the homepage for your
|
84
|
+
website, but sometimes you may need to serve another file as your homepage.
|
85
|
+
|
86
|
+
```js
|
87
|
+
window.$visualify = {
|
88
|
+
homepage: 'home',
|
89
|
+
|
90
|
+
// Or use the json in your repo
|
91
|
+
homepage: 'https://raw.githubusercontent.com/leolihao/visualify/master/docs/home.json',
|
92
|
+
}
|
93
|
+
```
|
94
|
+
|
95
|
+
## repo
|
96
|
+
|
97
|
+
- Type: `String`
|
98
|
+
|
99
|
+
Configure the repository url, or a string of `username/repo`, to add the
|
100
|
+
[GitHub Corner](http://tholman.com/github-corners/) widget in the top right
|
101
|
+
corner of the site.
|
102
|
+
|
103
|
+
```js
|
104
|
+
window.$docsify = {
|
105
|
+
repo: 'https://github.com/visualify',
|
106
|
+
};
|
107
|
+
```
|
108
|
+
|
109
|
+
## alias
|
110
|
+
|
111
|
+
- Type: `Object`
|
112
|
+
|
113
|
+
Set the route alias. You can freely manage `routing` rules. Supports `RegExp`.
|
114
|
+
|
115
|
+
```js
|
116
|
+
window.$visualify = {
|
117
|
+
alias: {
|
118
|
+
'/docsify': 'https://docsify.js.org/#/configuration?id=alias',
|
119
|
+
},
|
120
|
+
};
|
121
|
+
```
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Deploy
|
2
|
+
|
3
|
+
## On Your Local Machine
|
4
|
+
|
5
|
+
You can deploy Visualify on your local machine by running a simple HTTP server.
|
6
|
+
For example, you can use the `http-server` package from npm:
|
7
|
+
|
8
|
+
```bash
|
9
|
+
npm install -g http-server
|
10
|
+
http-server ./docs
|
11
|
+
```
|
12
|
+
|
13
|
+
Then open your browser and navigate to `http://localhost:8080`.
|
14
|
+
|
15
|
+
## On GitHub Pages
|
16
|
+
|
17
|
+
There are three places to populate your docs for your GitHub repository:
|
18
|
+
|
19
|
+
- `docs/` folder
|
20
|
+
- main branch
|
21
|
+
- gh-pages branch
|
22
|
+
|
23
|
+
It is recommended that you save your files to the `./docs` subfolder of the
|
24
|
+
`main` branch of your repository. Then select `main branch /docs folder` as your
|
25
|
+
GitHub Pages source in your repository's settings page.
|
26
|
+
|
27
|
+
![GitHub Pages](./static/_images/deploy-github-pages.png)
|
28
|
+
|
29
|
+
!> You can also save files in the root directory and select `main branch`.
|
30
|
+
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs`
|
31
|
+
or the gh-pages branch)
|
package/docs/docs/log.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# More pages
|
2
|
+
|
3
|
+
If you need more pages, you can simply create more `json` configuration files in
|
4
|
+
your visualify directory. If you create a file named `scatter`, then it is
|
5
|
+
accessible via `/scatter`.
|
6
|
+
|
7
|
+
For example, the directory structure is as follows:
|
8
|
+
|
9
|
+
```text
|
10
|
+
.
|
11
|
+
└── docs
|
12
|
+
├── index.html
|
13
|
+
├── scatter.json
|
14
|
+
└── honme.json
|
15
|
+
```
|
16
|
+
|
17
|
+
Matching routes
|
18
|
+
|
19
|
+
```text
|
20
|
+
docs/home.json => http://domain.com
|
21
|
+
=> http://domain.com/home
|
22
|
+
docs/scatter.json => http://domain.com/scatter
|
23
|
+
```
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# Quick start
|
2
|
+
|
3
|
+
It is highly recommended to use `Docisfy` as a document framework and imports
|
4
|
+
`visualify` to quickly present various diagrams.
|
5
|
+
|
6
|
+
Insert the `visualify` script in your `index.html` file.
|
7
|
+
|
8
|
+
```html
|
9
|
+
<head>
|
10
|
+
...
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/visualifyjs"></script>
|
12
|
+
|
13
|
+
<!-- or -->
|
14
|
+
<!-- <script src="https://visualify.pharmacy.arizona.edu/dist/visualify.js"></script -->
|
15
|
+
<!-- or -->
|
16
|
+
<!-- script src="https://cdn.jsdelivr.net/gh/visualify/visualify.js@release/dist/visualify.js"></script> -->
|
17
|
+
</head>
|
18
|
+
```
|
19
|
+
|
20
|
+
Or install `visualify.cli` globally, which helps initializing and previewing the
|
21
|
+
website locally.
|
22
|
+
|
23
|
+
```bash
|
24
|
+
npm i visualify.cli -g
|
25
|
+
```
|
26
|
+
|
27
|
+
## Initialize
|
28
|
+
|
29
|
+
If you want to write the documentation in the `./docs` subdirectory, you can use
|
30
|
+
the `init` command.
|
31
|
+
|
32
|
+
```bash
|
33
|
+
visualify init ./docs
|
34
|
+
```
|
35
|
+
|
36
|
+
or simply run `visualify init`
|
37
|
+
|
38
|
+
```bash
|
39
|
+
visualify init
|
40
|
+
```
|
41
|
+
|
42
|
+
or anywhere you like.
|
43
|
+
|
44
|
+
```bash
|
45
|
+
visualify init <path>
|
46
|
+
```
|
47
|
+
|
48
|
+
## Writing content
|
49
|
+
|
50
|
+
After the `init` is complete, you can see the file list in the `./docs`
|
51
|
+
subdirectory.
|
52
|
+
|
53
|
+
- `index.html` as the entry file
|
54
|
+
- `home.jsom` as the home page
|
55
|
+
- `.nojekyll` prevents GitHub Pages from ignoring files that begin with an
|
56
|
+
underscore
|
57
|
+
|
58
|
+
You can easily update the documentation in `./docs/home.json`, of course you can
|
59
|
+
add [more pages](more-pages.md).
|
60
|
+
|
61
|
+
## Preview your site
|
62
|
+
|
63
|
+
Run the local server with `visualify serve <docs-path>`. You can preview your
|
64
|
+
site in your browser on `http://localhost:3000`.
|
65
|
+
|
66
|
+
```bash
|
67
|
+
visualify serve docs
|
68
|
+
```
|
69
|
+
|
70
|
+
?> For more use cases of `visualify.cli`, head over to the
|
71
|
+
[CLI documentation](CLI.md).
|
72
|
+
|
73
|
+
## Manual initialization
|
74
|
+
|
75
|
+
If you don't like `npm` or have trouble installing the tool, you can manually
|
76
|
+
create `index.html`:
|
77
|
+
|
78
|
+
```html
|
79
|
+
<!-- index.html -->
|
80
|
+
|
81
|
+
<!DOCTYPE html>
|
82
|
+
<html>
|
83
|
+
<head>
|
84
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
85
|
+
<meta charset="UTF-8" />
|
86
|
+
</head>
|
87
|
+
<body>
|
88
|
+
<div id="root"></div>
|
89
|
+
<script>
|
90
|
+
$visualify = {
|
91
|
+
//...
|
92
|
+
};
|
93
|
+
</script>
|
94
|
+
<script src="https://cdn.jsdelivr.net/npm/visualifyjs"></script>
|
95
|
+
<!-- or -->
|
96
|
+
<!-- <script src="https://visualify.pharmacy.arizona.edu/dist/visualify.js"></script> -->
|
97
|
+
<!-- or -->
|
98
|
+
<!-- script src="https://cdn.jsdelivr.net/gh/visualify/visualify.js@release/dist/visualify.js"></script> -->
|
99
|
+
</body>
|
100
|
+
</html>
|
101
|
+
|
102
|
+
```
|
103
|
+
|
104
|
+
### Manually preview your site
|
105
|
+
|
106
|
+
If you have `Node.js` installed on your system, you can easily use it to run a
|
107
|
+
static server to preview your site.
|
108
|
+
|
109
|
+
```bash
|
110
|
+
# install corresponding dependencies
|
111
|
+
npm install -g serve
|
112
|
+
serve -s ./docs
|
113
|
+
```
|
114
|
+
|
115
|
+
If you have Python installed on your system, you can easily use it to run a
|
116
|
+
static server to preview your site.
|
117
|
+
|
118
|
+
```python2
|
119
|
+
cd docs && python -m SimpleHTTPServer 3000
|
120
|
+
```
|
121
|
+
|
122
|
+
```python3
|
123
|
+
cd docs && python -m http.server 3000
|
124
|
+
```
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# Recharts Attributes
|
2
|
+
|
3
|
+
`Rechart` is primarily composed of 4 attribute groups:
|
4
|
+
|
5
|
+
- **Basic** configuration
|
6
|
+
- **Data** configuration
|
7
|
+
- **Plugins** configuration
|
8
|
+
- **Override** configuration.
|
9
|
+
|
10
|
+
## Basic Configuration
|
11
|
+
|
12
|
+
The basic configuration includes:
|
13
|
+
|
14
|
+
| Attribute | Type | Description | Choice | Default |
|
15
|
+
| --------------- | ------------ | ----------------------- | -------------------------- | ------- |
|
16
|
+
| title | string | The main title | User-defined title | - |
|
17
|
+
| subtitle | string | A secondary title | User-defined subtitle | - |
|
18
|
+
| width | string | The width dimension | Any valid CSS width value | - |
|
19
|
+
| height | string | The height dimension | Any valid CSS height value | 400px |
|
20
|
+
| legend | bool | show or hide legend | True, False | true |
|
21
|
+
| xAxis | string/false | The xAxis | User-defined xAxis | {} |
|
22
|
+
| yAxis | string/false | The yAxis | User-defined yAxis | {} |
|
23
|
+
| tooltip | object | The tooltip | User-defined tooltip | {} |
|
24
|
+
| xAxisLineshow | bool | show or hide xAxisLines | True, False | true |
|
25
|
+
| yAxisLineshow | bool | show or hide yAxisLines | True, False | true |
|
26
|
+
| xAxisLabelShow | bool | show or hide xAxisLabel | True, False | true |
|
27
|
+
| yAxisLabelShow | bool | show or hide yAxisLabel | True, False | true |
|
28
|
+
| xAxisLabelColor | string | The xAxisLabelColor | Any valid CSS color value | - |
|
29
|
+
| yAxisLabelColor | string | The yAxisLabelColor | Any valid CSS color value | - |
|
30
|
+
|
31
|
+
## Data Configuration
|
32
|
+
|
33
|
+
The data configuration includes:
|
34
|
+
|
35
|
+
| Attribute | Type | Description | Choice | Default |
|
36
|
+
| --------- | ------------ | ------------------ | ----------------------------------------------------------------------------------------- | --------- |
|
37
|
+
| data | string | The data | User-defined data | {} |
|
38
|
+
| type | string/array | The type | 'line', 'bar' | undefined |
|
39
|
+
| smooth | bool/array | The smooth | True, False, [true, false] | false |
|
40
|
+
| areaStyle | object | The area style | {},[{color: 'red'},{color: 'blue'}] | {} |
|
41
|
+
| stack | string/array | The stack | {}, ['Vue', 'React', 'Angular'],{lang: ['Vue', 'React', 'Angular']} | - |
|
42
|
+
| markArea | object/array | The mark area | {XAxis: [{start: '...', end:'...', name: "..."}, ... ], YAxis: ..., props: ..}, [{}, ...] | - |
|
43
|
+
| markLine | object/array | The mark line | {data: { name: 'average', type: 'average'}, props: .. }, [{ data: {}, props: ..}, ...] | - |
|
44
|
+
| peak | bool/string | name of the peak | True, False, user-defined name of the peak | false |
|
45
|
+
| valley | bool/string | name of the valley | True, False, user-defined name of the valley | false |
|
46
|
+
|
47
|
+
### Specific Data Configuration for Line Charts
|
48
|
+
|
49
|
+
| Attribute | Type | Description | Choice | Default |
|
50
|
+
| ---------- | ----------------- | --------------------------- | ----------------------------------------------------------------- | ------- |
|
51
|
+
| smooth | bool/array | The smooth | True, False, [true, false] | false |
|
52
|
+
| areaStyle | object | The area style | {},[{color: 'red'},{color: 'blue'}] | {} |
|
53
|
+
| stack | string/array | The stack | {}, ['x', 'y'],{lang: ['x', 'y', 'z']} | - |
|
54
|
+
| percentage | bool | The percentage stacked mode | True, False | false |
|
55
|
+
| steps | bool/string/array | The steps | True, False, 'start', 'middle', 'end', ['start', 'middle', 'end'] | false |
|
56
|
+
|
57
|
+
### Specific Data Configuration for Bar Charts
|
58
|
+
|
59
|
+
| Attribute | Type | Description | Choice | Default |
|
60
|
+
| ---------- | ---- | --------------------------- | ----------- | ------- |
|
61
|
+
| percentage | bool | The percentage stacked mode | True, False | false |
|
62
|
+
|
63
|
+
## Plugins Configuration
|
64
|
+
|
65
|
+
The plgins configuration includes:
|
66
|
+
|
67
|
+
| Attribute | Type | Description | Choice | Default |
|
68
|
+
| --------- | ------ | ----------- | -------------------- | ------- |
|
69
|
+
| plugins | string | The plugins | User-defined plugins | - |
|
70
|
+
|
71
|
+
## Override Configuration
|
72
|
+
|
73
|
+
configuration to override the encapsulated preset configurations in order to
|
74
|
+
achieve custom effects.
|
@@ -0,0 +1,162 @@
|
|
1
|
+
<script defers>
|
2
|
+
let ex1 = {
|
3
|
+
title: 'The Popular Web frameworks Before 2017',
|
4
|
+
subtitle: 'GitHub New Star Number',
|
5
|
+
type: 'bar',
|
6
|
+
data: {
|
7
|
+
'Vue': [3000, 3500, 3900, 3100, 3200, 3100, 3600, 3300, 3600, 3400, 3100, 3000],
|
8
|
+
'React': [4000, 4500, 4900, 4300, 4400, 4300, 4800, 4500, 4800, 4600, 4300, 4000],
|
9
|
+
'Angular': [827, 949, 1400, 1000, 884, 911, 983, 989, 925, 1100, 1200, 930, ],
|
10
|
+
},
|
11
|
+
xAxis: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'],
|
12
|
+
};
|
13
|
+
const app = new $visualify.Recharts(ex1).mount('#example1');
|
14
|
+
let ex2 = structuredClone(ex1);
|
15
|
+
ex2.overrides= {
|
16
|
+
series: [{
|
17
|
+
type: 'line',
|
18
|
+
smooth: true
|
19
|
+
}, ]
|
20
|
+
};
|
21
|
+
const app2 = new $visualify.Recharts(ex2).mount('#example2');
|
22
|
+
</script>
|
23
|
+
|
24
|
+
# Visualify.Recharts
|
25
|
+
|
26
|
+
`Visualify.Recharts` is a component library built on `React` and `ECharts` to solve
|
27
|
+
the hassle of complex ECharts configuration items and data conversion. When
|
28
|
+
generating an ECharts chart, users only need to care about **data** and
|
29
|
+
**configuration items**, or even no configuration items, to generate a default
|
30
|
+
chart. `ReCharts` helps you build charts **quickly** and **efficiently**.
|
31
|
+
|
32
|
+
## Quick Start
|
33
|
+
|
34
|
+
<details open>
|
35
|
+
|
36
|
+
<summary>Recharts stands for React-Echarts, in order to use Recharts, you can follow
|
37
|
+
these steps.</summary>
|
38
|
+
|
39
|
+
Insert the `visualify` script in your `index.html` file.
|
40
|
+
|
41
|
+
```html
|
42
|
+
<head>
|
43
|
+
...
|
44
|
+
<script src="https://visualify.pharmacy.arizona.edu/dist/visualify.js"></script>
|
45
|
+
</head>
|
46
|
+
```
|
47
|
+
|
48
|
+
Initilaize the `visualify` object in your `index.html` file.
|
49
|
+
|
50
|
+
```html
|
51
|
+
$visualify = {
|
52
|
+
mode: 'charts',
|
53
|
+
}
|
54
|
+
```
|
55
|
+
|
56
|
+
Use the `Recharts` object in your `index.html` file.
|
57
|
+
|
58
|
+
```html
|
59
|
+
<div id="example1"></div>
|
60
|
+
<script>
|
61
|
+
new $visualify.Recharts( config... ).mount('#example1');
|
62
|
+
</script>
|
63
|
+
```
|
64
|
+
|
65
|
+
</details>
|
66
|
+
|
67
|
+
## Example of Recharts
|
68
|
+
|
69
|
+
<!-- tabs:start -->
|
70
|
+
|
71
|
+
#### **Output**
|
72
|
+
|
73
|
+
<div id="example1">Here is the example of bar chart by using Recharts to show 2017 top popular frames. </div>
|
74
|
+
|
75
|
+
#### **HTML**
|
76
|
+
|
77
|
+
<pre data-lang="html">
|
78
|
+
<code class="lang-html">
|
79
|
+
<div id="example1">Example 1</div>
|
80
|
+
const app = new $visualify.Recharts({
|
81
|
+
title: 'The Popular Web frameworks Before 2017',
|
82
|
+
subtitle: 'GitHub New Star Number',
|
83
|
+
type: 'bar',
|
84
|
+
data: {
|
85
|
+
'Vue': [3000, 3500, 3900, 3100, 3200, 3100, 3600, 3300, 3600, 3400, 3100, 3000],
|
86
|
+
'React': [4000, 4500, 4900, 4300, 4400, 4300, 4800, 4500, 4800, 4600, 4300, 4000],
|
87
|
+
'Angular': [827, 949, 1400, 1000, 884, 911, 983, 989, 925, 1100, 1200, 930, ],
|
88
|
+
},
|
89
|
+
xAxis: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'],
|
90
|
+
});
|
91
|
+
app.mount('#example1');
|
92
|
+
</code>
|
93
|
+
</pre>
|
94
|
+
|
95
|
+
<!-- tabs:end -->
|
96
|
+
|
97
|
+
## Advanced Usage
|
98
|
+
|
99
|
+
### Hybird Types & Smooth & More options
|
100
|
+
|
101
|
+
'Rechart' support hybird types such as `line` , `bar` , `scatter` , and more
|
102
|
+
types by setting `type` as array of types, also for the `smooth`.
|
103
|
+
|
104
|
+
```html
|
105
|
+
{
|
106
|
+
...
|
107
|
+
type: ['line', 'bar']
|
108
|
+
smooth: [true, false]
|
109
|
+
}
|
110
|
+
```
|
111
|
+
|
112
|
+
More options can be found in the [Attributes](rechart-attributes).
|
113
|
+
|
114
|
+
### Overrides Configuration
|
115
|
+
|
116
|
+
The **preset** configuration in `Recharts` can be overridden to match the
|
117
|
+
original `Echarts` configuration. For example, we can set `smooth` to `true` in
|
118
|
+
`series`.
|
119
|
+
|
120
|
+
```html
|
121
|
+
{
|
122
|
+
...
|
123
|
+
overrides: {
|
124
|
+
series: [{
|
125
|
+
type: 'line',
|
126
|
+
smooth: true
|
127
|
+
}, ]
|
128
|
+
},
|
129
|
+
}
|
130
|
+
```
|
131
|
+
|
132
|
+
More advanced usage can be found in the
|
133
|
+
[Echarts documentation](https://echarts.apache.org/en/index.html).
|
134
|
+
|
135
|
+
<!-- tabs:start -->
|
136
|
+
|
137
|
+
#### **Output**
|
138
|
+
|
139
|
+
<div id="example2">Example 2</div>
|
140
|
+
|
141
|
+
#### **HTML**
|
142
|
+
|
143
|
+
<pre data-lang="html">
|
144
|
+
<code class="lang-html">
|
145
|
+
const app = new $visualify.Recharts({
|
146
|
+
...
|
147
|
+
overrides: {
|
148
|
+
series: [{
|
149
|
+
type: 'line',
|
150
|
+
smooth: true
|
151
|
+
}, ]
|
152
|
+
},
|
153
|
+
}).mount('#example1');
|
154
|
+
</code>
|
155
|
+
<button class="docsify-copy-code-button">
|
156
|
+
<span class="label">Copy to clipboard</span>
|
157
|
+
<span class="error">Error</span>
|
158
|
+
<span class="success">Copied</span>
|
159
|
+
</button>
|
160
|
+
</pre>
|
161
|
+
|
162
|
+
<!-- tabs:end -->
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/docs/index.html
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8" />
|
6
|
+
<title>visualify.js official site</title>
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
8
|
+
<meta name="description" content="Description" />
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="static/logo/favicon.ico" />
|
11
|
+
<script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script>
|
12
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.css" />
|
13
|
+
<link rel="stylesheet" href="./static/css/font-awesome.min.css" />
|
14
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" />
|
15
|
+
<link rel="stylesheet" href="./static/css/fluff-stuff.css" />
|
16
|
+
<script src="./static/js/configuration.js"></script>
|
17
|
+
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>
|
18
|
+
<!-- Docsify siderbarbar -->
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/marked@latest/marked.min.js"></script>
|
20
|
+
</head>
|
21
|
+
|
22
|
+
<body>
|
23
|
+
<div id="docsify"></div>
|
24
|
+
<script>
|
25
|
+
// Set html "lang" attribute based on URL
|
26
|
+
var lang = location.hash.match(/#\/(zh-cn)\//);
|
27
|
+
if (lang) {
|
28
|
+
document.documentElement.setAttribute("lang", lang[1]);
|
29
|
+
}
|
30
|
+
|
31
|
+
window.$docsify = config;
|
32
|
+
$visualify = {
|
33
|
+
mode: 'charts',
|
34
|
+
}
|
35
|
+
|
36
|
+
/*
|
37
|
+
const custom_buttons = [
|
38
|
+
["MmTrBC", "./MmTrBC/", 1],
|
39
|
+
["Esodev", "./EsoDev/", 3],
|
40
|
+
];
|
41
|
+
*/
|
42
|
+
</script>
|
43
|
+
<!-- Docsify v4 -->
|
44
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify@4"></script>
|
45
|
+
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
|
46
|
+
<script src="./static/js/fluff.js" defer></script>
|
47
|
+
<!-- Plugins -->
|
48
|
+
<script src="https://polyfill.io/v3/polyfill.min.js?features=String.prototype.normalize"></script>
|
49
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/external-script.js"></script>
|
50
|
+
<!-- Copy to Clipboard -->
|
51
|
+
<script src="https://unpkg.com/docsify-copy-code@2/dist/docsify-copy-code.min.js"></script>
|
52
|
+
<!-- docsify-tabs (latest v1.x.x) -->
|
53
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1/dist/docsify-tabs.min.js"></script>
|
54
|
+
<!-- LaTeX display engine script Here -->
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
56
|
+
<script src="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js"></script>
|
57
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css" />
|
58
|
+
<script src="https://unpkg.com/docsify-latex@0.5.2/dist/docsify-latex.min.js"></script>
|
59
|
+
<!-- flexible-alerts -->
|
60
|
+
<script src="https://unpkg.com/docsify-plugin-flexible-alerts@1.1.1/dist/docsify-plugin-flexible-alerts.min.js"></script>
|
61
|
+
<!-- Mermaid -->
|
62
|
+
<script type="module">
|
63
|
+
import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs"; mermaid.initialize({ startOnLoad: true }); window.mermaid = mermaid;
|
64
|
+
</script>
|
65
|
+
<!-- Prism -->
|
66
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-python.min.js"></script>
|
67
|
+
<!-- Visualify -->
|
68
|
+
<script src="./static/js/visualify.js"></script>
|
69
|
+
</body>
|
70
|
+
|
71
|
+
</html>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"short_name": "visualifyjs",
|
3
|
+
"name": "Create Your Data Portal Simple",
|
4
|
+
"icons": [{
|
5
|
+
"src": "https://lgcyaxi.net/visualify/static/logo/favicon.ico",
|
6
|
+
"sizes": "64x64 32x32 24x24 16x16",
|
7
|
+
"type": "image/x-icon"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"src": "https://lgcyaxi.net/visualify/static/logo/logo192.png",
|
11
|
+
"type": "image/png",
|
12
|
+
"sizes": "192x192"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"src": "https://lgcyaxi.net/visualify/static/logo/logo512.png",
|
16
|
+
"type": "image/png",
|
17
|
+
"sizes": "512x512"
|
18
|
+
}
|
19
|
+
],
|
20
|
+
"start_url": ".",
|
21
|
+
"display": "standalone",
|
22
|
+
"theme_color": "#000000",
|
23
|
+
"background_color": "#ffffff"
|
24
|
+
}
|