|
| 1 | +import React from 'react'; |
| 2 | +import PropTypes from 'prop-types'; |
| 3 | + |
| 4 | + |
| 5 | +let DatasetForm = (props) => { |
| 6 | + const { fields: { datasetName, headerFile, tarFile }, |
| 7 | + error, handleSubmit, submitting } = props; |
| 8 | + |
| 9 | + const description = { |
| 10 | + fontStyle: 'italic', |
| 11 | + paddingBottom: '1em' |
| 12 | + }; |
| 13 | + |
| 14 | + return ( |
| 15 | + <div> |
| 16 | + <Form onSubmit={handleSubmit} error={error}> |
| 17 | + <TextInput label="Dataset Name" {...datasetName} /> |
| 18 | + <FileInput |
| 19 | + label="Header File" |
| 20 | + {...headerFile} |
| 21 | + data-tip |
| 22 | + data-for="headerfileTooltip" |
| 23 | + /> |
| 24 | + |
| 25 | + <div style={description}> |
| 26 | + Format: comma-separated with columns "filename" (of a time series from the uploaded archive), "label" (class label or numerical value), and any metafeatures (numerical). |
| 27 | + </div> |
| 28 | + |
| 29 | + <FileInput |
| 30 | + label="Data Tarball" |
| 31 | + {...tarFile} |
| 32 | + data-tip |
| 33 | + data-for="tarfileTooltip" |
| 34 | + /> |
| 35 | + <div style={description}> |
| 36 | + Format: zipfile or tarfile containing time series files, each of which is comma-separated with columns "time", "value", "error" (optional). |
| 37 | + </div> |
| 38 | + |
| 39 | + <SubmitButton label="Upload Dataset" disabled={submitting} /> |
| 40 | + </Form> |
| 41 | + |
| 42 | + <CesiumTooltip |
| 43 | + id="headerfileTooltip" |
| 44 | + text={["filename,label", <br />, "ts1.dat,class_A", <br />, "..."]} |
| 45 | + /> |
| 46 | + <CesiumTooltip |
| 47 | + id="tarfileTooltip" |
| 48 | + text={[ |
| 49 | + "Each file in tarball should be formatted as follows", |
| 50 | + <br />, "(column titles are optional)", <br />, <br />, |
| 51 | + "time,value,error", <br />, |
| 52 | + "125912.23,12.31604,0.279105", <br />, |
| 53 | + "..."]} |
| 54 | + /> |
| 55 | + |
| 56 | + </div> |
| 57 | + ); |
| 58 | +}; |
| 59 | +DatasetForm.propTypes = { |
| 60 | + fields: PropTypes.object.isRequired, |
| 61 | + error: PropTypes.string, |
| 62 | + handleSubmit: PropTypes.func.isRequired, |
| 63 | + submitting: PropTypes.bool.isRequired |
| 64 | +}; |
0 commit comments