visualifyjs 2.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. package/.github/workflows/static.yml.bak +51 -0
  2. package/LICENSE +674 -0
  3. package/README.md +59 -0
  4. package/config-overrides.js +31 -0
  5. package/dist/visualify.js +188 -0
  6. package/docs/.nojekyll +0 -0
  7. package/docs/docs/CLI.md +34 -0
  8. package/docs/docs/README.md +65 -0
  9. package/docs/docs/Rechart/bar.md +190 -0
  10. package/docs/docs/Rechart/funnel.md +193 -0
  11. package/docs/docs/Rechart/geo.md +0 -0
  12. package/docs/docs/Rechart/line.md +355 -0
  13. package/docs/docs/Rechart/liquidfill.md +0 -0
  14. package/docs/docs/Rechart/pie.md +225 -0
  15. package/docs/docs/Rechart/polar.md +0 -0
  16. package/docs/docs/Rechart/radar.md +253 -0
  17. package/docs/docs/Rechart/sankey.md +0 -0
  18. package/docs/docs/Rechart/scatter.md +0 -0
  19. package/docs/docs/Rechart/sunburst.md +0 -0
  20. package/docs/docs/Rechart/tree.md +0 -0
  21. package/docs/docs/Rechart/wordcloud.md +0 -0
  22. package/docs/docs/_404.md +52 -0
  23. package/docs/docs/_coverpage.md +11 -0
  24. package/docs/docs/_sidebar.md +43 -0
  25. package/docs/docs/components/dotBio.md +34 -0
  26. package/docs/docs/components/echart.md +82 -0
  27. package/docs/docs/components/html.md +34 -0
  28. package/docs/docs/components/macaron.md +145 -0
  29. package/docs/docs/components/markdown.md +0 -0
  30. package/docs/docs/components/more.md +142 -0
  31. package/docs/docs/components/plotly.md +62 -0
  32. package/docs/docs/components/scatterL.md +70 -0
  33. package/docs/docs/components/visium.md +57 -0
  34. package/docs/docs/configuration.md +123 -0
  35. package/docs/docs/deploy.md +31 -0
  36. package/docs/docs/log.md +1 -0
  37. package/docs/docs/more-pages.md +23 -0
  38. package/docs/docs/quickstart.md +119 -0
  39. package/docs/docs/rechart-attributes.md +74 -0
  40. package/docs/docs/rechart-basic-usage.md +162 -0
  41. package/docs/docs/static/_images/deploy-github-pages.png +0 -0
  42. package/docs/docs/static/logo/favicon.ico +0 -0
  43. package/docs/docs/static/logo/logo_128x128.png +0 -0
  44. package/docs/docs/static/logo/logo_192x192.png +0 -0
  45. package/docs/docs/static/logo/logo_256x256.png +0 -0
  46. package/docs/docs/static/logo/logo_512x512.png +0 -0
  47. package/docs/docs/static/logo/logo_64x64.png +0 -0
  48. package/docs/docs/theme.md +5 -0
  49. package/docs/index.html +71 -0
  50. package/docs/manifest.json +24 -0
  51. package/docs/static/css/fluff-stuff.css +170 -0
  52. package/docs/static/css/font-awesome.min.css +4 -0
  53. package/docs/static/css/visualify.css +25 -0
  54. package/docs/static/fonts/fontawesome-webfont.woff2 +0 -0
  55. package/docs/static/images/star.png +0 -0
  56. package/docs/static/js/configuration.js +448 -0
  57. package/docs/static/js/fluff.js +1 -0
  58. package/docs/static/js/visualify.js +188 -0
  59. package/docs/static/logo/favicon.ico +0 -0
  60. package/docs/static/logo/logo_128x128.png +0 -0
  61. package/docs/static/logo/logo_192x192.png +0 -0
  62. package/docs/static/logo/logo_256x256.png +0 -0
  63. package/docs/static/logo/logo_512x512.png +0 -0
  64. package/docs/static/logo/logo_64x64.png +0 -0
  65. package/package.json +84 -0
  66. package/rollup.config.mjs +76 -0
  67. package/src/_css/404.css +116 -0
  68. package/src/_css/App.css +38 -0
  69. package/src/_css/autoSuggestion.css +27 -0
  70. package/src/_css/circular-progress.css +33 -0
  71. package/src/_css/index.css +37 -0
  72. package/src/_css/modern.css +25 -0
  73. package/src/_media/404.png +0 -0
  74. package/src/_media/corner.svg +8 -0
  75. package/src/_media/download.svg +3 -0
  76. package/src/_media/icon.svg +1 -0
  77. package/src/_media/logo.svg +14 -0
  78. package/src/_test/App.test.js +15 -0
  79. package/src/_utils/reportWebVitals.js +13 -0
  80. package/src/core/appContext.js +27 -0
  81. package/src/core/components/Scatter.js +188 -0
  82. package/src/core/components/ScatterBio.js +572 -0
  83. package/src/core/components/VisiumPlot.js +165 -0
  84. package/src/core/components/browser.js +42 -0
  85. package/src/core/components/dotplot.js +413 -0
  86. package/src/core/components/html.js +29 -0
  87. package/src/core/components/list.js +178 -0
  88. package/src/core/components/macaron.js +201 -0
  89. package/src/core/components/markdown.js +56 -0
  90. package/src/core/components/parser.scatterBio.js +579 -0
  91. package/src/core/components/ratio.js +80 -0
  92. package/src/core/components/scatterL.js +173 -0
  93. package/src/core/components/searchbar.js +131 -0
  94. package/src/core/components/selection.js +193 -0
  95. package/src/core/components/timeline.js +281 -0
  96. package/src/core/components/visium.js +97 -0
  97. package/src/core/fetch/condfetch.js +82 -0
  98. package/src/core/fetch/fetch.js +92 -0
  99. package/src/core/fetch/json.js +29 -0
  100. package/src/core/fetch/vfetch.js +42 -0
  101. package/src/core/liveEditor.js +44 -0
  102. package/src/core/modules/codeEditorWithPreview.js +104 -0
  103. package/src/core/modules/echarts/common.js +20 -0
  104. package/src/core/modules/echarts/presetHandler.js +41 -0
  105. package/src/core/modules/echarts/presets/esodev.chromium.js +172 -0
  106. package/src/core/modules/echarts/presets/esodev.codex.js +130 -0
  107. package/src/core/modules/echarts/presets/esodev.visium.js +123 -0
  108. package/src/core/modules/echarts/presets/mmtrbc.js +186 -0
  109. package/src/core/modules/echarts.js +71 -0
  110. package/src/core/modules/echartsUtils.js +43 -0
  111. package/src/core/modules/echartswitcher.js +152 -0
  112. package/src/core/modules/replotly/presetHandler.js +24 -0
  113. package/src/core/modules/replotly/presets/minimum.js +18 -0
  114. package/src/core/modules/replotly/presets/mmtrbc.dot.js +114 -0
  115. package/src/core/modules/replotly/presets/mmtrbc.violin.js +100 -0
  116. package/src/core/modules/replotly.js +71 -0
  117. package/src/core/pages/404.js +50 -0
  118. package/src/core/pages/error.js +27 -0
  119. package/src/core/pages/jsonPage.js +62 -0
  120. package/src/core/pages/loading.js +44 -0
  121. package/src/core/parser/echart.data.js +183 -0
  122. package/src/core/parser/echart.features.js +125 -0
  123. package/src/core/parser/echart.general.js +143 -0
  124. package/src/core/parser/echart.hilbert.js +57 -0
  125. package/src/core/parser/echart.parser.js +210 -0
  126. package/src/core/parser/echart.series.js +67 -0
  127. package/src/core/parser/echart.types.js +76 -0
  128. package/src/core/parser/plotly.config.js +10 -0
  129. package/src/core/parser/plotly.data.js +132 -0
  130. package/src/core/parser/plotly.layout.js +10 -0
  131. package/src/core/parser/plotly.violin.js +18 -0
  132. package/src/core/recharts.js +62 -0
  133. package/src/core/router/alias.js +49 -0
  134. package/src/core/router/jsonRouter.js +31 -0
  135. package/src/core/themes/modern.js +32 -0
  136. package/src/core/themes/themeSelector.js +33 -0
  137. package/src/core/visualify.js +47 -0
  138. package/src/core/widgets/circularProgress.js +24 -0
  139. package/src/core/widgets/controller.js +83 -0
  140. package/src/core/widgets/errorBoundary.js +36 -0
  141. package/src/core/widgets/footer.js +177 -0
  142. package/src/core/widgets/header.js +234 -0
  143. package/src/core/widgets/layout/Grid.js +31 -0
  144. package/src/core/widgets/layout.js +36 -0
  145. package/src/core/widgets/mapping.js +42 -0
  146. package/src/index.js +62 -0
  147. package/src/setupTests.js +5 -0
@@ -0,0 +1,142 @@
1
+ # More components
2
+
3
+ ## Markdown
4
+
5
+ The Markdown component is used to render markdown content on the page.
6
+
7
+
8
+
9
+ ## SearchBar
10
+
11
+ The SearchBar component is used to search for a specific gene.
12
+
13
+ ### Properties
14
+
15
+ The SearchBar component has the following properties:
16
+
17
+ - `type` (string): The type of the component, in this case `SearchBar`.
18
+ - `id` (string): The unique identifier of the component.
19
+ - `row` (int): The row in which the component is to be displayed.
20
+ - `col` (int): The column in which the component is to be displayed.
21
+ - `config` (object): The configuration of the component.
22
+ - `style` (object): The style of the component.
23
+ - `title` (string): The title of the component.
24
+
25
+ ### config Properties
26
+
27
+ The `config` object has the following properties:
28
+
29
+ - `save` (boolean/String): Whether to save the search or not.
30
+ - (string): The name to be saved at global data.
31
+ - `source` (object): The source of the component.
32
+ - `name` (string): The name of the source.
33
+ - `url` (string): The URL of the source.
34
+ - `responseKey` (string): The response key of the source.
35
+
36
+ ### Example
37
+
38
+ ```json
39
+ {
40
+ "id": "mmtrbc_gene",
41
+ "type": "SearchBar",
42
+ "title": "Search Gene",
43
+ "config": {
44
+ "save": true,
45
+ "source": {
46
+ "name": "genelist",
47
+ "url": "https://visualify.pharmacy.arizona.edu/api/mmtrbc/genelist",
48
+ "responseKey": "gene"
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## List
55
+
56
+ The List component is used to display a list of genes.
57
+
58
+ ### Properties
59
+
60
+ The List component has the following properties:
61
+
62
+ - `type` (string): The type of the component, in this case `List`.
63
+ - `id` (string): The unique identifier of the component.
64
+ - `row` (int): The row in which the component is to be displayed.
65
+ - `col` (int): The column in which the component is to be displayed.
66
+ - `rowspan` (int): The number of rows the component is to span.
67
+ - `btn` (object): The button of the component.
68
+ - `style` (object): The style of the component.
69
+ - `title` (string): The title of the component.
70
+
71
+ ### example
72
+
73
+ ```json
74
+ {
75
+ "id": "genelist",
76
+ "type": "List",
77
+ "row": 2,
78
+ "col": 1,
79
+ "rowspan": 3,
80
+ "btn": {
81
+ "add": {
82
+ "text": "Add",
83
+ "show": true,
84
+ "style": {
85
+ "color": "white",
86
+ "backgroundColor": "#FF8E8E",
87
+ "fontSize": "12px",
88
+ "border": "none",
89
+ "cursor": "pointer"
90
+ },
91
+ "addfrom": "mmtrbc_gene"
92
+ },
93
+ "clear": {
94
+ "text": "Clear",
95
+ "show": true,
96
+ "msg": "Successfully cleared the list",
97
+ "style": {
98
+ }
99
+ },
100
+ "remove": {
101
+ "show": true,
102
+ "style": {
103
+ "color": "white",
104
+ "backgroundColor": "#f44336",
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ ## RatioBox
112
+
113
+ The RatioBox component is used to display a ratio box on the page.
114
+
115
+ ### Properties
116
+
117
+ The RatioBox component has the following properties:
118
+
119
+ - `type` (string): The type of the component, in this case `RatioBox`.
120
+ - `id` (string): The unique identifier of the component.
121
+ - `row` (int): The row in which the component is to be displayed.
122
+ - `col` (int): The column in which the component is to be displayed.
123
+ - `choice` (array): The choice of the component.
124
+ - `style` (object): The style of the component.
125
+ - `val` (string): Will save the choices to the name of global variable.
126
+
127
+ ### Example
128
+
129
+ ```json
130
+ {
131
+ "type": "RatioBox",
132
+ "id": "chrom_colour",
133
+ "row": 2,
134
+ "col": 1,
135
+ "choice": ["Cell Type", "Stage"],
136
+ "style": {
137
+ "width": "350px"
138
+ },
139
+ "val": "chrom_colour",
140
+ "title": "Colour by"
141
+ }
142
+ ```
@@ -0,0 +1,62 @@
1
+ # Plotly Component
2
+
3
+ The Plotly component is used to display a plotly plot on the page.
4
+
5
+ ## Properties
6
+
7
+ The Plotly component has the following properties:
8
+
9
+ - `type` (string): The type of the component, in this case `Plotly`.
10
+ - `id` (string): The unique identifier of the component.
11
+ - `row` (int): The row in which the component is to be displayed.
12
+ - `col` (int): The column in which the component is to be displayed.
13
+ - `rowspan` (int): The number of rows the component is to span.
14
+ - `colspan` (int): The number of columns the component is to span.
15
+ - `settings` (object): The settings of the component.
16
+ - `parser` (object): The parser of the component.
17
+ - `trigger` (object): The trigger of the component.
18
+
19
+ ### settings Properties
20
+
21
+ The `settings` object has the following properties:
22
+
23
+ - `preset` (string): The preset of the component.
24
+ - `ignoreEmptyData` (boolean): Whether to ignore empty data or not.
25
+
26
+ ### parser Properties
27
+
28
+ The `parser` object has the following properties:
29
+
30
+ - `sources` (array): The sources of the component.
31
+ - `name` (string): The name of the trigger.
32
+ - `url` (string): The URL of the data.
33
+ - `responseKey` (string): The response key of the component.
34
+ - `exclude` (array): The data to be excluded.
35
+ - `type` (string): The type of the component.
36
+
37
+ ### Example
38
+
39
+ ```json
40
+ {
41
+ "id": "mmtrbc_tsne",
42
+ "type": "Plotly",
43
+ "col": 2,
44
+ "rowspan": 3,
45
+ "settings": {
46
+ "preset": "mmtrbc",
47
+ "ignoreEmptyData": true
48
+ },
49
+ "parser": {
50
+ "sources": [{
51
+ "name": "metadata",
52
+ "url": "<your-backend-url>"
53
+ }, {
54
+ "name": "gene",
55
+ "url": "<your-backend-url>",
56
+ "responseKey": "gene"
57
+ }],
58
+ "exclude": ["BC-Mes", "BC-NE", "BC-Im"],
59
+ "type": "scatter"
60
+ }
61
+ }
62
+ ```
@@ -0,0 +1,70 @@
1
+ # ScatterL Components
2
+
3
+ The ScatterL component is a scatter plot that is used to visualize the data in
4
+ 2D. It is a part of the Plotly library and is used to visualize the data in 2D.
5
+ The ScatterL component is used to visualize the data in 2D.
6
+
7
+ The ScatterL component is designed for a specified data Format, like R-tree, to
8
+ visualize a large data set in 2D.
9
+
10
+ ## Requirements
11
+
12
+ The ScatterL component requires the specified API to fetch the data. Currently,
13
+ the ScatterL component supports the API for fetching the data - in the format of
14
+ JSON, - and it need API to consist as
15
+ `your-backend-server-url/xxx/<x-min>/<y-min>/<x-max>/<y-max>`
16
+
17
+ We will provide an example of the backend to show you how to implement our
18
+ customized Rtree API.
19
+
20
+ ## Properties
21
+
22
+ The ScatterL component has the following properties:
23
+
24
+ - `type` (string): The type of the component, in this case `ScatterL`.
25
+ - `id` (string): The unique identifier of the component.
26
+ - `row` (int): The row in which the component is to be displayed.
27
+ - `col` (int): The column in which the component is to be displayed.
28
+ - `rowspan` (int): The number of rows the component is to span.
29
+ - `config` (object): The configuration of the component.
30
+
31
+ ### config Properties
32
+
33
+ The `config` object has the following properties:
34
+
35
+ - `merge` (boolean): Whether to merge the data or not.
36
+ - `startup_msg` (string): The message to be displayed when the component is
37
+ started.
38
+ - `size` (object): The size of the component.
39
+ - `width` (int): The width of the component.
40
+ - `height` (int): The height of the component.
41
+ - `dotsize` (object): The size of the dots in the scatter plot.
42
+ - `dotFactor` (int): The factor by which the dot size is to be multiplied.
43
+ - `min` (int): The minimum size of the dot.
44
+ - `max` (int): The maximum size of the dot.
45
+ - `colourby` (string): The property by which the dots are to be coloured.
46
+ - `exclusion` (array): The properties to be excluded.
47
+ - `api` (object): The API to be used to fetch the data.
48
+ - `metadata` (object): The metadata API.
49
+ - `href` (string): The URL of the metadata API.
50
+ - `val` (string): The value of the metadata API.
51
+ - `gene` (object): The gene API.
52
+ - `href` (string): The URL of the gene API.
53
+ - `val` (string): The value of the gene API.
54
+ - `dep` (string): The dependent property of the gene API.
55
+ - `mapping` (object): The mapping of the data.
56
+ - `api` (object): The API to be used for mapping.
57
+ - Example:
58
+ - `ENS (S): 'ens_iter_2'` (string): Maps ENS (S) to endo_iter_2 API.
59
+ - `IM (S): 'im_iter_2'` (string): Maps IM (S) to im_iter_2 API.
60
+ - `MES (S): 'mes_iter_2'` (string): Maps MES (S) to mes_iter_2 API.
61
+ - `axis` (object): The axis to be used for mapping.
62
+ - `x: X_Coord` (string): Maps x-axis to specified value name.
63
+ - `y: Y_Coord` (string): Maps y-axis to specified value name.
64
+ - `extra` (object): The extra properties.
65
+ - Example:
66
+ - `Stage : Stage` (string): Mapes the Stage to the stage property.
67
+ - `MT : MT` (string): Maps the MT to the MT property.
68
+ - `Gene : Gene` (string): Maps the Gene to the gene property.
69
+ - `Cell_Type : Cell_Type` (string): Maps the Cell_Type to the cell type property.
70
+ - `Cell_ID : Cell_ID` (string): Maps the Cell_ID to the cell ID property.
@@ -0,0 +1,57 @@
1
+ # Visium Component
2
+
3
+ The Visium component is used to display the Visium data on the page.
4
+
5
+ ## Properties
6
+
7
+ The Visium component has the following properties:
8
+
9
+ - `type` (string): The type of the component, in this case `Visium`.
10
+ - `id` (string): The unique identifier of the component.
11
+ - `row` (int): The row in which the component is to be displayed.
12
+ - `col` (int): The column in which the component is to be displayed.
13
+ - `rowspan` (int): The number of rows the component is to span.
14
+ - `startup_msg` (string): The startup message of the component.
15
+ - `meta` (string): The metadata API of the component.
16
+ - `simpleload` (boolean): Whether to load the data simply or not.
17
+ - `metaval` (string): The metadata variable name we want to use.
18
+ - `gene` (string): The gene API.
19
+ - `geneval` (string): The gene variable name we want to use.
20
+ - `image` (string): The image API.
21
+ - `cellval` (string): The celltype variable name we want to use.
22
+ - `axis_mapping` (object): The axis mapping of the component.
23
+ - `x: X_Coord` (string): Maps the X_Coord to the x-axis.
24
+ - `y: Y_Coord` (string): Maps the Y_Coord to the y-axis.
25
+ - `extra` (object): The extra properties.
26
+ - Example:
27
+ - `BC : BC` (string): Maps the BC to the BC property.
28
+ - `SB-1 : SB-1` (string): Maps the SB-1 to the SB-1 property.
29
+
30
+
31
+ ### Example
32
+
33
+ ```json
34
+ {
35
+ "id": "visium_scatter2d",
36
+ "type": "Visium",
37
+ "row": 1,
38
+ "col": 2,
39
+ "rowspan": 3,
40
+ "startup_msg": "Section",
41
+ "meta": "<your-api-for-metadata>",
42
+ "simpleload": false,
43
+ "metaval": "visium_section",
44
+ "gene": "<your-api-for-gene-data>",
45
+ "geneval": "visium_gene",
46
+ "image": "<your-api-for-image>",
47
+ "cellval": "visium_celltype",
48
+ "axis_mapping": {
49
+ "x": "X_Coord",
50
+ "y": "Y_Coord",
51
+ "extra": {
52
+ "BC": "BC",
53
+ "SB-1": "SB-1",
54
+ }
55
+ }
56
+ }
57
+ ```
@@ -0,0 +1,123 @@
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: 'leolihao/visualify',
106
+ // or
107
+ repo: 'https://github.com/leolihao/visualify/',
108
+ };
109
+ ```
110
+
111
+ ## alias
112
+
113
+ - Type: `Object`
114
+
115
+ Set the route alias. You can freely manage `routing` rules. Supports `RegExp`.
116
+
117
+ ```js
118
+ window.$visualify = {
119
+ alias: {
120
+ '/docsify': 'https://docsify.js.org/#/configuration?id=alias',
121
+ },
122
+ };
123
+ ```
@@ -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)
@@ -0,0 +1 @@
1
+ # log
@@ -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,119 @@
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://visualify.pharmacy.arizona.edu/dist/visualify.js"></script>
12
+ <!-- or -->
13
+ <!-- script src="https://cdn.jsdelivr.net/npm/visualifyjs"></!-- -->
14
+ </head>
15
+ ```
16
+
17
+ Or install `visualify.cli` globally, which helps initializing and previewing the
18
+ website locally.
19
+
20
+ ```bash
21
+ npm i visualify.cli -g
22
+ ```
23
+
24
+ ## Initialize
25
+
26
+ If you want to write the documentation in the `./docs` subdirectory, you can use
27
+ the `init` command.
28
+
29
+ ```bash
30
+ visualify init ./docs
31
+ ```
32
+
33
+ or simply run `visualify init`
34
+
35
+ ```bash
36
+ visualify init
37
+ ```
38
+
39
+ or anywhere you like.
40
+
41
+ ```bash
42
+ visualify init <path>
43
+ ```
44
+
45
+ ## Writing content
46
+
47
+ After the `init` is complete, you can see the file list in the `./docs`
48
+ subdirectory.
49
+
50
+ - `index.html` as the entry file
51
+ - `home.jsom` as the home page
52
+ - `.nojekyll` prevents GitHub Pages from ignoring files that begin with an
53
+ underscore
54
+
55
+ You can easily update the documentation in `./docs/home.json`, of course you can
56
+ add [more pages](more-pages.md).
57
+
58
+ ## Preview your site
59
+
60
+ Run the local server with `visualify serve <docs-path>`. You can preview your
61
+ site in your browser on `http://localhost:3000`.
62
+
63
+ ```bash
64
+ visualify serve docs
65
+ ```
66
+
67
+ ?> For more use cases of `visualify.cli`, head over to the
68
+ [CLI documentation](CLI.md).
69
+
70
+ ## Manual initialization
71
+
72
+ If you don't like `npm` or have trouble installing the tool, you can manually
73
+ create `index.html`:
74
+
75
+ ```html
76
+ <!-- index.html -->
77
+
78
+ <!DOCTYPE html>
79
+ <html>
80
+ <head>
81
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
82
+ <meta charset="UTF-8" />
83
+ </head>
84
+ <body>
85
+ <div id="root"></div>
86
+ <script>
87
+ $visualify = {
88
+ //...
89
+ };
90
+ </script>
91
+ <script src="https://visualify.pharmacy.arizona.edu/dist/visualify.js"></script>
92
+ <!-- or -->
93
+ <!-- script src="https://cdn.jsdelivr.net/npm/visualifyjs"></!-- -->
94
+ </body>
95
+ </html>
96
+
97
+ ```
98
+
99
+ ### Manually preview your site
100
+
101
+ If you have `Node.js` installed on your system, you can easily use it to run a
102
+ static server to preview your site.
103
+
104
+ ```bash
105
+ # install corresponding dependencies
106
+ npm install -g serve
107
+ serve -s ./docs
108
+ ```
109
+
110
+ If you have Python installed on your system, you can easily use it to run a
111
+ static server to preview your site.
112
+
113
+ ```python2
114
+ cd docs && python -m SimpleHTTPServer 3000
115
+ ```
116
+
117
+ ```python3
118
+ cd docs && python -m http.server 3000
119
+ ```