-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Save): add tests to cmd that test you can save a transform and viz (
#649) Tests ensure you can savec a Viz or Transform to a dataset without having to add other dataset components as well. Also, fixes to `prepareViz()` to ensure that we have a `Viz.Script` before creating the datasets
- Loading branch information
Showing
6 changed files
with
124 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"qri": "ds:0", | ||
"meta": { | ||
"qri": "md:0", | ||
"title": "example movie data" | ||
}, | ||
"structure": { | ||
"qri": "st:0", | ||
"format": "csv", | ||
"formatConfig": { | ||
"headerRow": true | ||
}, | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"title": "title", | ||
"type": "string" | ||
}, | ||
{ | ||
"title": "duration", | ||
"type": "integer" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"transform": { | ||
"scriptPath": "tf.star" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"qri": "ds:0", | ||
"meta": { | ||
"qri": "md:0", | ||
"title": "example movie data" | ||
}, | ||
"structure": { | ||
"qri": "st:0", | ||
"format": "csv", | ||
"formatConfig": { | ||
"headerRow": true | ||
}, | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"title": "title", | ||
"type": "string" | ||
}, | ||
{ | ||
"title": "duration", | ||
"type": "integer" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"viz": { | ||
"scriptPath": "viz.html" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# transform that doesn't change anything. | ||
def transform(ds, ctx): | ||
print("hello Qri! \n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>My Viz Template</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<style> | ||
body { margin: 0; padding: 0; font-family: helvetica, sans-serif; } | ||
</style> | ||
</head> | ||
<body> | ||
<div style="width: 100%; margin: 50px auto"> | ||
<h1>{{ .Meta.Title }}</h1> | ||
<p>{{ .Meta.Description }}</p> | ||
<small>Data Format: <b>{{ .Structure.Format }}</b></small> | ||
</div> | ||
</body> | ||
</html> |