@sfgrp/distinguish 0.0.5 → 0.0.8
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/README.md +61 -23
- package/dist/distinguish.es.js +207 -186
- package/dist/distinguish.umd.js +17 -17
- package/dist/style.css +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
# distinguish
|
|
2
2
|
|
|
3
|
-
An interactive key engine that feeds off of [TaxonWorks](https://taxonworks.org)' [API](https://api.taxonworks.org).
|
|
3
|
+
An interactive key engine that feeds off of [TaxonWorks](https://taxonworks.org)' [API](https://api.taxonworks.org). Distinguish is a product of the [Species File Group](https://speciesfilegroup.org) and its collaborators.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
* ... create page
|
|
9
|
-
* ... add module
|
|
10
|
-
* ... add configs TOKEN/API
|
|
11
|
-
* ... add action
|
|
12
|
-
* ... visit page
|
|
7
|
+
See [Example page](#example-page).
|
|
13
8
|
|
|
14
9
|
## Details
|
|
15
10
|
|
|
16
|
-
Interactive keys are tools used by taxonomists and others to diagnosis or seperate one taxon from
|
|
11
|
+
Interactive keys are tools used by taxonomists and others to diagnosis or seperate one taxon (e.g. a species) from others. Distinguish provides an embedable, web-based, interactive key interface. The key uses logic (the "engine") and data managed in an instance of TaxonWorks. Keys can served locally (e.g. by opening a file in your browser) or on websites. They require an internet connection.
|
|
17
12
|
|
|
18
13
|
## Features
|
|
19
14
|
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
15
|
+
* Figure descriptors and observations.
|
|
16
|
+
* Multi-language support.
|
|
17
|
+
* Filter by tagged set.
|
|
18
|
+
* Filter by rank (e.g. "Family" or "Genus").
|
|
19
|
+
* Qualitative, quantitative descriptors.
|
|
20
|
+
* Local (file in your browser) or server-based (both require internet access).
|
|
23
21
|
|
|
24
22
|
## Technical
|
|
25
23
|
|
|
26
|
-
Distinguish is a
|
|
24
|
+
Distinguish is a node module. All functionality is driven from a single, parameterized API call.
|
|
27
25
|
|
|
28
26
|
## Install
|
|
29
27
|
|
|
@@ -41,14 +39,13 @@ yarn add @sfgrp/distinguish
|
|
|
41
39
|
### CDN
|
|
42
40
|
You can copy and paste the following tags into your HTML file.
|
|
43
41
|
|
|
44
|
-
|
|
45
42
|
```html
|
|
46
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sfgrp/distinguish/dist/style.css">
|
|
47
|
-
<script src="https://cdn.jsdelivr.net/npm/@sfgrp/distinguish/dist/distinguish.umd.js"></script>
|
|
43
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sfgrp/distinguish@latest/dist/style.min.css">
|
|
44
|
+
<script src="https://cdn.jsdelivr.net/npm/@sfgrp/distinguish@latest/dist/distinguish.umd.min.js"></script>
|
|
48
45
|
```
|
|
49
46
|
|
|
50
47
|
## Usage
|
|
51
|
-
There are two ways to setup Interactive Keys. The easiest way is to let InteractiveKey auto discover your inputs automatically. For that, you simply need to provide a data attribute
|
|
48
|
+
There are two ways to setup Interactive Keys. The easiest way is to let InteractiveKey auto discover your inputs automatically. For that, you simply need to provide a data attribute on your element.
|
|
52
49
|
|
|
53
50
|
### Declarative
|
|
54
51
|
|
|
@@ -65,8 +62,7 @@ To pass the options you need to add the prefix `data-` and write the option in k
|
|
|
65
62
|
```
|
|
66
63
|
|
|
67
64
|
### Imperative
|
|
68
|
-
You can initialize it by createInteractiveKey function
|
|
69
|
-
|
|
65
|
+
You can initialize it by `createInteractiveKey` function
|
|
70
66
|
|
|
71
67
|
```html
|
|
72
68
|
<div id="interactive-key"></div>
|
|
@@ -91,12 +87,54 @@ const app = createInteractiveKey('#interactive-key', options)
|
|
|
91
87
|
}
|
|
92
88
|
}
|
|
93
89
|
```
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
### Example page
|
|
91
|
+
This uses the [CDN](#cdn) and [Declaritive](#declarative) approach.
|
|
92
|
+
* Copy the text below into a file called `index.html`.
|
|
93
|
+
* Configure the `data-` options to point to your key.
|
|
94
|
+
* Open that file in your browser.
|
|
95
|
+
|
|
96
|
+
```html
|
|
97
|
+
<!DOCTYPE html>
|
|
98
|
+
<html lang="en">
|
|
99
|
+
<head>
|
|
100
|
+
<meta charset="UTF-8" />
|
|
101
|
+
<link rel="icon" href="/favicon.ico" />
|
|
102
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sfgrp/distinguish@latest/dist/style.min.css" />
|
|
103
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
104
|
+
<title>Distinguish</title>
|
|
105
|
+
</head>
|
|
106
|
+
<body>
|
|
107
|
+
<div
|
|
108
|
+
data-interactive-key="true"
|
|
109
|
+
data-observation-matrix-id="1"
|
|
110
|
+
data-project-token="yourprojecttoken"
|
|
111
|
+
data-base-url="https://<your.taxonworks.server>/api/v1"
|
|
112
|
+
></div>
|
|
113
|
+
<script src="https://cdn.jsdelivr.net/npm/@sfgrp/distinguish@latest/dist/distinguish.umd.min.js"></script>
|
|
114
|
+
</body>
|
|
115
|
+
</html>
|
|
116
|
+
```
|
|
96
117
|
|
|
97
|
-
|
|
118
|
+
### Deploying a key on-line
|
|
119
|
+
[GitHub Pages](https://pages.github.com/) is perhaps the quickest way to deploy your key if you don't have access to your own server.
|
|
120
|
+
* Follow instructions above to setup your repository.
|
|
121
|
+
* Add a page to that repository that looks like the [example page](#example-page).
|
|
122
|
+
|
|
123
|
+
### Troubleshooting
|
|
124
|
+
If nothing loads (blank page):
|
|
125
|
+
* Open your Browser's development tools console panel. Reload the page. Errors will appear in red.
|
|
126
|
+
|
|
127
|
+
If when loaded or during use you see:
|
|
128
|
+
* `Request failed with status code 401` - The API configuration parameters are incorrect
|
|
129
|
+
* `Request failed with status code 404` - The API URL path or Token is incorrect (the base of the API URL is correct)
|
|
130
|
+
* `Network error` - The key can not connect to the internet
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## Building a key (in TaxonWorks)
|
|
134
|
+
Distinguish is based of interfaces available inside TaxonWorks. Those interfaces have many additional features facilitating the addition and management of images, curation, annotations, expansion, and editing of the underlying data. To start editing a key find a [TaxonWorks provider](https://docs.taxonworks.org/guide/start-a-project.html#finding-a-collaborating-provider), or [install your own instance](https://github.com/SpeciesFileGroup/install_taxonworks). Need help? [Chat on Gitter](https://gitter.im/SpeciesFileGroup/taxonworks) or [join a TaxonWorks event](https://speciesfilegroup.org/events.html).
|
|
98
135
|
|
|
99
136
|
## Contributing
|
|
137
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
100
138
|
|
|
101
|
-
|
|
102
|
-
|
|
139
|
+
## Lisence
|
|
140
|
+
Distinguish is open source and is presently available under the [University of Illinois/NCSA Open Source License](https://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License).
|