Integrate with the Javascript Library
Use the Universal Data Tool in any javascript application using a <script /> import tage.

Quick Start: UDT in Static HTML Page

Installation

Put a script tag at the top of your page importing the Universal Data Tool "vanilla" library.
The vanilla library bundles all the Universal Data Tool dependencies together into a single file, making it easy to use anywhere!
1
<script
2
type="application/javascript"
3
src="https://unpkg.com/[email protected]/vanilla.js"
4
></script>
Copied!

Usage

Add a container element to your body. Then call window.UniversalDataTool.open to open the UDT in your element.
1
<body>
2
<div id="udt"></div>
3
<script type="application/javascript">
4
window.UniversalDataTool.open({
5
container: document.getElementById("udt"),
6
7
// Your UDT dataset
8
// https://github.com/UniversalDataTool/udt-format
9
udt: {
10
interface: {
11
type: "image_classification",
12
labels: ["A", "B"]
13
},
14
samples: [
15
{
16
imageUrl: "https://placekitten.com/408/287"
17
}
18
]
19
},
20
21
// Called when sample is saved
22
onSaveSample: (index, sample) => {
23
console.log(index, sample);
24
}
25
});
26
</script>
27
</body>
Copied!
Last modified 11mo ago