public class Dsv<T>
extends com.google.gwt.core.client.JavaScriptObject
Modifier | Constructor and Description |
---|---|
protected |
Dsv() |
Modifier and Type | Method and Description |
---|---|
Dsv<T> |
get(DsvCallback<T> callback)
Defines a callback to invoke on request response.
|
DsvRows<DsvRow> |
parse(String csvContent)
Parse a CSV string into objects using the header row.
|
DsvRows<T> |
parse(String csvContent,
DsvObjectAccessor<T> accessor)
Parse a CSV string into objects using the header row.
|
DsvRows<com.google.gwt.core.client.JsArrayString> |
parseRows(String csvContent)
Parses the specified string, which is the contents of a CSV file,
returning an array of arrays representing the parsed rows.
|
DsvRows<T> |
parseRows(String csvContent,
DsvArrayAccessor<T> accessor)
Parses the specified string, which is the contents of a CSV file,
returning an array of arrays representing the parsed rows.
|
Dsv<T> |
row(DsvObjectAccessor<T> accessor)
Defines an accessor to invoke on each rows.
|
public final Dsv<T> get(DsvCallback<T> callback)
When the CSV data is available, the specified callback will be invoked with the parsed rows as the argument. If an error occurs, the callback function will instead be invoked with null.
callback
- the callback.public final Dsv<T> row(DsvObjectAccessor<T> accessor)
An optional accessor function may be specified, which is then passed to d3.csv.parse; the accessor may also be specified by using the return request object’s row function.
accessor
- the accessor.public final DsvRows<DsvRow> parse(String csvContent)
Parses the specified string, which is the contents of a CSV file, returning an array of objects representing the parsed rows. The string is assumed to be RFC4180-compliant. Unlike the parseRows method, this method requires that the first line of the CSV file contain a comma-separated list of column names; these column names become the attributes on the returned objects.
csvContent
- the content of a CSV file.public final DsvRows<T> parse(String csvContent, DsvObjectAccessor<T> accessor)
Parses the specified string, which is the contents of a CSV file, returning an array of objects representing the parsed rows. The string is assumed to be RFC4180-compliant. Unlike the parseRows method, this method requires that the first line of the CSV file contain a comma-separated list of column names; these column names become the attributes on the returned objects.
csvContent
- the content of a CSV file.accessor
- the accessor.public final DsvRows<com.google.gwt.core.client.JsArrayString> parseRows(String csvContent)
The string is assumed to be RFC4180-compliant. Unlike the parse method, this method treats the header line as a standard row, and should be used whenever the CSV file does not contain a header. Each row is represented as an array rather than an object. Rows may have variable length.
csvContent
- the contents of a CSV filepublic final DsvRows<T> parseRows(String csvContent, DsvArrayAccessor<T> accessor)
The string is assumed to be RFC4180-compliant. Unlike the parse method, this method treats the header line as a standard row, and should be used whenever the CSV file does not contain a header. Each row is represented as an array rather than an object. Rows may have variable length.
csvContent
- the contents of a CSV fileaccessor
- the accessorCopyright © 2015 gwt-d3. All rights reserved.